here is my script
You forgot to include your script.
$servers = Get-Content c:\temp\servers.txt
foreach ($srv in $servers) {
$out = "Something to display."
"{0} - {1}" -f $out, $srv
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
mY script is simple i get the servers names from a text file $servers = Get-Content c:\temp\servers.txti am only displaying Status, Name, and Display
here is my script
Status Name DisplayName
Running spooler Print Spooler
Running spooler Print Spooler
Running spooler Print Spooler
Running spooler Print Spooler
Running spooler Print Spooler
Running spooler Print Spooler
Running spooler Print Spooler
Running spooler Print Spoole
How do i make the servers appear in the report as a 4th column?
I know tthat t i am extracting the servers from a text file
here is my script
You forgot to include your script.
$servers = Get-Content c:\temp\servers.txt
foreach ($srv in $servers) {
$out = "Something to display."
"{0} - {1}" -f $out, $srv
}
You didn't post your script, just what looks like some output. You also didn't specify what $servers contains (e.g. server names, contents of some program output, etc).
Just completely taking a guess that you are getting a list of servers from some file, then calling some PS function to get the status of spooler on that server using something like Get-Service
. You want to combine these into a table output. The key is how you're getting the service status. Get-Service
in PS 5 can be used but PS Core removed support for remote computers.
$servers = Get-Content 'c:\temp\servers.txt'
Get-Service -ComputerName $servers -Name spooler | Select-Object -Property Status, Name, DisplayName, MachineName
Hi @Christopher Ellis ,
this is the third time you asked the same question within the last days. Your second time question is deleted now.
But the first time question with an answer is still there: https://learn.microsoft.com/en-us/answers/questions/466305/how-do-i-add-the-servers-queried-in-4th-colunmn-wh.html
I don't see the reason why repeating the same question again and again is helpful.
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
Hi
Please do not post the same question on the forum, for we will keep following up your question until solving it.