Hi @D Vijayakumar VLR ,
Maybe this is helpful:
$servernames = "server1","server2"
$file = "C:\Junk\ResultServices.txt"
$result = "ServerName;Service;Status;StartType`r`n"
foreach ($Server in $Servernames){
$services = Get-service -ComputerName $server | select Name, Status, StartType | Foreach-Object {
$result += $server + ";"+ $_.name + ";" + $_.Status + ";" + $_.StartType + "`r`n"
}
}
$result > $file
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten