-
New Script: Find Services Using a Domain Account on Specified Computers in Microsoft Active Directory (Get-ServiceAccounts V1.00)
One of the questions asked when I am either doing Active Directory (AD) remediation work or preparing a customer for an AD migration is “what domain accounts are used by what services and on what computers?”
That question is what this script is designed to answer.
This is my first script that accepts input from the pipeline. I believe I tested every scenario I could think of. I am sure you will let me know what I forgot to test. 🙂
Below are screenshots of what I tested.
Figure 1 (Get-ADComputer -Filter * | Sort Name | .\Get-ServiceAccounts.ps1) Figure 2 (Get-ADComputer -Filter {OperatingSystem -like “*window*”} | Sort Name | .\Get-ServiceAccounts.ps1 -Folder C:\Webster\) Figure 3 (Get-ADComputer -Filter {OperatingSystem -like “*window*”} -SearchBase “OU=XENDESKTOP1909,OU=LAB,DC=LABADDOMAIN,DC=COM” -SearchScope Subtree -Properties Name -EA 0 | Sort Name | .\Get-ServiceAccounts.ps1) Figure 4 (.\Get-ServiceAccounts.ps1 -Name labsql1) Figure 5 (Reading an input file of computer names) Figure 6 (Sample input file of computer names) Figure 7 (Sample output file of service accounts with domain credentials) You can always find the most current script by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/
Thanks
Webster
December 19, 2019
Active Directory, PowerShell