Get when the active directory was last copied

Does anyone know how we can find

When was the active directory the last time backed up using C #?

according to my knowledge, when we run this repadmin / showbackup command

his will shows us complete detail. I tried to get the dsa signature value using C #, but even this value does not make much sense and will help us get the correct information.

How and with what backup of the domain controller and when?

Does anyone know how to get the latest backup of the active directory using C #?

Thanks in advance

+5
source share
1 answer

, WMI. , , .

System.Diagnostics.ProcessStartInfo PSI =
new System.Diagnostics.ProcessStartInfo("cmd", "/c " + "Repadmin.exe /showbackup");

PSI.RedirectStandardOutput = true;
PSI.UseShellExecute = false;

PSI.CreateNoWindow = true;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = PSI;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
Console.WriteLine(result);
      }
      catch (Exception e)
      {
      Messagebox.Show(e.InnerException);
      }
}
0

All Articles