Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Get-Server Help

$
0
0

I want to apologize ahead of time.  I'm fairly new to PowerShell.

I am trying to check if a service (just 1 service) is on several servers in my environment and the service's status.

I run this in PowerShell, "Get-Content C:\Tmp\TEST.Csv | Foreach-Object {Get-Service -Name Sep*}"

It appears to work as the output is:

Status     Name                     DisplayName
------      ----                        -----------
Running  SepMasterService   Symantec Endpoint Protection
Running  SepMasterService   Symantec Endpoint Protection
Running  SepMasterService   Symantec Endpoint Protection
Running  SepMasterService   Symantec Endpoint Protection

I want to pipe this to an output file using Export-Csv.  The issue I am having is I cannot figure out how to list the name of the server(s) along with the Status, Name and DisplayName, so I can import it into Excel.

Any help is greatly appreciated.

Thank you

 

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles