Quantcast
Channel: Operations Manager - General forum
Viewing all articles
Browse latest Browse all 11941

Exporting output of powershell to notepad

$
0
0

How can I redirect output of this powershell query to a notepad.

$Agents = Get-Agent | where {$_.Name -like ‘*.com'}
$Agents | sort | foreach {
       Write-Host "";
       "Agent    :: " + $_.Name;
       "--Primary MS  :: " + ($_.GetPrimaryManagementServer()).ComputerName;
       $failoverServers = $_.getFailoverManagementServers();
       foreach ($managementServer in $failoverServers) {
              "--Failover MS :: " + ($managementServer.ComputerName);
       }
}
Write-Host "";


Thanks, Harry :-)


Viewing all articles
Browse latest Browse all 11941

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>