Category Archives: Scripting

Cleaning up AdminSDHolder orphans

I quite regularly come across Active Directory environments where users have been mistakenly added to groups protected by the AdminSDHolder and subsequently removed when the mistake has been realised.  This process creates “orphans” because the AdminSDHolder process doesn’t tidy up after itself.  Here’s what happens: User added to group protected by the AdminSDHolder (e.g. Account… Read More: Cleaning up AdminSDHolder orphans »

Powershell method to find when your Domain Controllers were promoted

I recently came across an old blog post by fellow MVP Joe Richards.  In the post Joe points out that whenChanged is not a replicated attribute, which makes it a poor candidate for accurately determining when an object was last modified.  He does however indicate that the whenChanged attribute provides a handy way to report… Read More: Powershell method to find when your Domain Controllers were promoted »

PowerShell script to submit certificate requests in bulk using certreq.exe

Here’s something I put together to handle bulk certificate requests for submission to an Enterprise CA using certreq.exe.  Enjoy! ######################################################### # # Name: Request-Certificates.ps1 # Author: Tony Murray # Version: 1.0 # Date: 4/12/2012 # Comment: PowerShell script to submit certificate # requests in bulk using certreq.exe # ######################################################### # Specify the location of the… Read More: PowerShell script to submit certificate requests in bulk using certreq.exe »

Powershell search for Active Directory objects excluding an OU

If you’re familiar with LDAP searches you will probably at some point have been frustrated at the inability to exclude objects in a specific Organisational Unit, i.e “Give me all User objects in the domain, except those in the Sales OU”.   To workaround the problem you typically need to do some scripting. There are several… Read More: Powershell search for Active Directory objects excluding an OU »

The directory service can perform the requested operation only on a leaf object

If you come across this error when using Powershell to delete an object, it is most likely because the object has child objects associated with it.  The most obvious example is computer objects that have print queue, service connection point, RRAS or various other types of child objects.  The workaround is to determine the child… Read More: The directory service can perform the requested operation only on… »