Finding Service with Account Name Using Microsoft PowerShell V1.0
A few months back, I worked on a project where the customer needed to find all services on all servers that used a specific Active Directory (AD) account name. The problem was, they had no idea how the account name had been entered, nor did they know which server or what service used the account. I created a hard-coded script to search all computers in Active Directory for a partial account name. I finally made the time to make the script more useful and generic.
By default, the script requires an account name and will search all computers in AD that have “server” in the OperatingSystem property. The parameter, -AccountName, will have “*” added before and after the name. For example, entering “ctx” will cause the script to search all services for “*ctx*”. This will find [email protected], domainsvc_ctxaccount, and domain.tldsvc_ctxaccount.
Using -LiteralAccountName causes the script to use the account name entered exactly as typed. For example, -LiteralAccountName “[email protected]” will look for only that specific account name. The script will not search for domainsvc_ctxaccount or domain.tldsvc_ctxaccount.
Read the entire article here, Finding Service with Account Name Using Microsoft PowerShell V1.0
via Carl Webster