nav2567
asked on
Checking the status of multiple windows services using powershell.
Hello,
I am working on a script to read list of computer names and inventory the status of two windows services on each computer. Does anyone know what to put after the Get-WMIOBJECT command? Thanks.
$compArray = get-content C:\Servers.txt
foreach($strComputer in $compArray)
{
Get-WMIObject Win32_Service -ComputerName $strComputer | ....
}
I am working on a script to read list of computer names and inventory the status of two windows services on each computer. Does anyone know what to put after the Get-WMIOBJECT command? Thanks.
$compArray = get-content C:\Servers.txt
foreach($strComputer in $compArray)
{
Get-WMIObject Win32_Service -ComputerName $strComputer | ....
}
ASKER
Thanks, oBdA,
I need to see those computers which do not have the services running.
Your script only lists status of computers which have the services running.
I need to see those computers which do not have the services running.
Your script only lists status of computers which have the services running.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works. Thank you!
This will query two services and export selected properties of the results to a csv:
Open in new window