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

server name or MachineName not showing up in results of my script

$
0
0

I am attempting to display the server name (Machinename) however i think it is linking MachineName to the get-service command
I run a script which displays service, Status however MachineName does not display

Here is my script

get-content -path c:\temp\servers2.txt | foreach {Get-service lanmanserver} | select Name, Machinename, Status

Name                                                MachineName             Status                                                                               ----                                                   -----------                                                                                            ------
lanmanserver                                           .                           Running                                                                        lanmanserver                                           .                           Running                                                                          lanmanserver                                           .                           Running                                                                          lanmanserver                                           .                           Running                                                                         

I am missing something however I don't know what

any assistance would be greatly appreciated


Viewing all articles
Browse latest Browse all 6937

Trending Articles