Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Help with a script to query win32_service

$
0
0

Hi,

I have the follwing script that has been created to help me identify the version of EMC Powerpath installed on my Windows servers.

The script is working fine, but instead of ending having queried the last server in the list, it seems to go into a loop and starts querying all the servers again from the beginning.  Is there something I can do to stop this happening?

$Servers=(get-contentD:\powershell\Servers.txt)

 

 

Foreach

 

 

 

($serverin$servers

){

Get-WmiObject

 

 

 

-computername$servers-ClassWin32_service-Filter"Name like '%EmcPowSrv%'"|Selectsystemname,name,displayname,

status

}

I would also like to get it to pipe out the results to a csv file, but export-csv just seems to export some rubbish text.

Thanks for any help with this.


Viewing all articles
Browse latest Browse all 10624

Trending Articles