r/sysadmin•
haggeant

Automating change of DSRM Password

Hey all, I am working on automating defining the DSRM password. Below is what I currently have, but NTDSUTIL gets started as a separate process, I would really like to capture the output of this to parse for success/failure. However, I can't find anything, it does create a security audit log, but I would rather see for myself success, or failure.

$Password = "Password1!"

cmd.exe /c start cmd

Start-Sleep -Milliseconds 900

System.Windows.Forms.SendKeys::SendWait("Set DSRM Password")

System.Windows.Forms.SendKeys::SendWait("Reset Password on server null")

Posted May 26, 2017, 8:22 PM UTC

32
[deleted]•

[deleted]

1
prophetnite•

I would use Start-Process, below is an example. https://defuse.ca/b/74eAxzp7TytElmuXbUHL6y

1
[deleted]•

[deleted]

1
MisterITSysadmin•

Wrap in powershell, use a try catch block.

1