• New Script: Find Services Using a Domain Account on Specified Computers in Microsoft Active Directory (Get-ServiceAccounts V1.00)

    December 19, 2019

    Active Directory, PowerShell

    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 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 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 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 4 (.\Get-ServiceAccounts.ps1 -Name labsql1)
    Figure 5 (Reading an input file of computer names)
    Figure 5 (Reading an input file of computer names)
    Figure 6 (Sample input file of computer names)
    Figure 6 (Sample input file of computer names)
    Figure 7 (Sample output file of service accounts with domain credentials)
    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







    About Carl Webster

    Carl Webster is an independent consultant specializing in Citrix, Active Directory, and technical documentation. Carl (aka “Webster”) serves the broader Citrix community by writing articles (see CarlWebster.com) and by being the most active person in the Citrix Zone on Experts Exchange. Webster has a long history in the IT industry beginning with mainframes in 1977, PCs and application development in 1986, and network engineering in 2001. He has worked with Citrix products since 1990 with the premiere of their first product – the MULTIUSER OS/2.

    View all posts by Carl Webster

    No comments yet.

    Leave a Reply