• Profile picture of Alex Aymonier

    Alex Aymonier replied to the topic Triggering Cmdlet with Output in the forum General PowerShell Q&A 1 month ago

    I’ve take what you’ve already done above and tweaked it a bit to answer your question.
    $Servers = ‘server1′,’server2′,’server3’

    Foreach ($server in $servers) {

    $CHECKSPOOLER = get-service -name spooler -ComputerName $Server | Where-Object {$_.Status -eq “Stopped” }
    $CHECKSPOOLER | Select-Object -Property ‘name’,’machinename’,’status’ |…[Read more]