Link to home
Start Free TrialLog in
Avatar of MilesLogan
MilesLoganFlag for United States of America

asked on

Verify if local administrator account is being used to start services on multiple servers


Can someone help me with this search ..
I need to search a list of servers and output if any of those servers have any services running with these two local accounts.
Local accounts = X123 and Administrator

The output file should tell me the server name,Name,StartName

or if easier .. the output can show me all the local accounts being used .. I can then sort the output by just those accounts
Avatar of Chris H
Chris H
Flag of United States of America image

I use this command locally:

wmic service get Caption,StartName

It will return results as such:
Portable Device Enumerator Service                      LocalSystem

Windows Presentation Foundation Font Cache      NT AUTHORITY\LocalServic
Windows Update                                          LocalSystem

Open in new window

Avatar of MilesLogan


Yeah , I can get the basics with this search but not multiple servers or just to check for those two local accounts ..

Get-WMIObject Win32_Service -ComputerName server123 | Where-Object{$_.StartName -eq '.\x123'} | Sort-Object -Property StartName | Format-Table Name, StartName
wmic /node:%servername% service get Caption,StartName | find ".\x123"

Open in new window

This worked for me
wmic /node:d service get Caption,StartName | find "local"


Application Experience                                  localSystem                  
Wired AutoConfig                                        localSystem                  
Extensible Authentication Protocol                      localSystem                  
Health Key and Certificate Management                   localSystem                  
Remote Access Auto Connection Manager                   localSystem                  
Remote Access Connection Manager                        localSystem                  
Routing and Remote Access                               localSystem                  
Terminal Services Configuration                         localSystem                  
Windows Modules Installer                               localSystem                  
Terminal Services UserMode Port Redirector              localSystem                  
Desktop Window Manager Session Manager                  localSystem                  
Block Level Backup Engine Service                       localSystem                  
Problem Reports and Solutions Control Panel Support     localSystem                  
Windows Error Reporting Service                         localSystem                  
Windows Management Instrumentation                      localSystem                  
WMI Performance Adapter                                 localSystem

d being the name of my remote server
Avatar of Chris H
Chris H
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks !