

Not game-changing, but a fun little way to spend my lunch and I learned a few things along the way.

No more need to remember dsa.msc, and only one cmd window left open (which can be closed by hand without affecting AD, or you can leave it alone and it will close automatically when you close AD). Viola! The shortcut will now open a cmd window which will automatically open AD under your admin credentials. %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe &’C:\PowerShell scripts\DSA.ps1′ Create a shortcut with the following (making any changes if you haven’t used the same folder structure I have): Start-Process “C:\Windows\System32\cmd.exe” -workingdirectory $PSHOME -Credential -ArgumentList “/c dsa.msc”ģ. Make a ps1 file (mine is DSA.ps1) with the following (filling in your domain\admin account): I use ‘C:\PowerShell scripts’ but I also tested running this from my desktop, so I believe it could be anywhere (possibly even on a file share, although I would assume you would need to use the FQDN. Create a PowerShell script folder somewhere.

Run PowerShell as an administrator, then run “Set-ExecutionPolicy remotesigned”. Not so hard for an administrator, but perhaps tricky for my student workers.Īt lunch today I thought “PowerShell has to be able to do this better” and with some google-fu and trail and error, it turns out I was right. This worked well enough, but there were a few caveats: first, there were two cmd windows open after you had AD up and running, and second, you had to remember the “dsa.msc” part. From there, you could type dsa.msc to start Active Directory running as that instead of the account you were logged in as. Which would start a new cmd window running under the credentials. So the old methodology we used to use for opening up Active Directory was a little cmd file:
