ChinkoNinja
Technical User
Hi,
I'm a new scripting so please bear with me.
I need a simple script to:
1) Get a list of services on remote Windows servers (from a txt file, e.g., serverlist.txt) that are associated with a specific "Logon Account"
2) Then pipe the result into a text file.
For example:
I need to find services on servers that has a StartName (Logon As) of "NT Authority\NetworkService"
So the result should be similar to:
service-list.txt (sample name of output file)
Servername: SERVER0001
Name StartName
---- ---------
RpcSs NT AUTHORITY\NetworkService
Dhcp NT AUTHORITY\NetworkService
aspnet_state NT AUTHORITY\NetworkService
Dnscache NT AUTHORITY\NetworkService
MSDTC NT AUTHORITY\NetworkService
LicenseService NT AUTHORITY\NetworkService
Servername: SERVER0002
Name StartName
---- ---------
MSSQLServerADHelper NT AUTHORITY\NetworkService
MsDtsServer NT AUTHORITY\NetworkService
RpcLocator NT AUTHORITY\NetworkService
SysmonLog NT Authority\NetworkService
Any help would be GREATLY appreciated.
Thank you!
I'm a new scripting so please bear with me.
I need a simple script to:
1) Get a list of services on remote Windows servers (from a txt file, e.g., serverlist.txt) that are associated with a specific "Logon Account"
2) Then pipe the result into a text file.
For example:
I need to find services on servers that has a StartName (Logon As) of "NT Authority\NetworkService"
So the result should be similar to:
service-list.txt (sample name of output file)
Servername: SERVER0001
Name StartName
---- ---------
RpcSs NT AUTHORITY\NetworkService
Dhcp NT AUTHORITY\NetworkService
aspnet_state NT AUTHORITY\NetworkService
Dnscache NT AUTHORITY\NetworkService
MSDTC NT AUTHORITY\NetworkService
LicenseService NT AUTHORITY\NetworkService
Servername: SERVER0002
Name StartName
---- ---------
MSSQLServerADHelper NT AUTHORITY\NetworkService
MsDtsServer NT AUTHORITY\NetworkService
RpcLocator NT AUTHORITY\NetworkService
SysmonLog NT Authority\NetworkService
Any help would be GREATLY appreciated.
Thank you!