Comparing Services

Share |

Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Powershell Plus

13 Free SQL Tools from Idera

Free Ebook: Mastering Powershell

Compare-Object can help when troubleshooting computers. For example, you should try this to compare the service status on two machines and find out where services are configured differently:

$machine1 = Get-Service -ComputerName server1-or-IP1
$machine2 = Get-Service -ComputerName server2-or-IP2
Compare-Object -ReferenceObject $machine1 -DifferenceObject $machine2 -Property Name,Status `
-passThru | Sort-Object Name | Select-Object Name, Status, MachineName

Twitter This Tip! ReTweet this Tip!

Posted Dec 31 2010, 08:00 AM by ps1
Copyright 2012 All rights reserved.