Friday, October 5, 2018

Standardized AD computer decommissioner

We seem to have a lack of , shall we say, "process engagement" here where folks don't always do their due diligence with removing computers from the environment.  To address that I created this script to automate and standardize removing systems from AD.

The idea here is that the script will be called by SharePoint.  A minimal GUI will be created on SharePoint asking for the target system and the users AD user ID.  When they click OK, or RUN or whatever the button says, it sends the two items as input variables to the script.

The script has it's own AD credential to perform the actions.  It verifies that the user is in a group preset from the XML config file.  It then checks for an AD record for the target and if found, deletes the record.  It then checks DNS for a record and again, if found, deletes it.

The resultant data set is formatted and sent in an HTML email to the users specified.  Below is an example of the resultant email.

The script is available on the PowerShell Gallery here: 
https://www.powershellgallery.com/profiles/Kcmjr


No comments:

Post a Comment