This week I started to play with Windows 8 and of course one of the first things I looked for was PowerShell 3.0 Smile And then I found a great blogpost on the PowerShellMagazine website by Shay Levy where he shows how find all the changes between the two versions of PowerShell (v2 and v3).

That’s when I thought why not use the same approach for finding the changes between the OpsMgr 2007 R2 PowerShell Commands and the OM12 PowerShell Commands.

This is the script I slightly modified to get it to work for OpsMgr 2007 and OM12.

# Compare differences OpsMgr 2007 PowerShell Commands and OM 12 PowerShell Commands.
# Idea and initial script from Shay Levy on PowerShellMagazine. (http://www.powershellmagazine.com/2011/09/15/how-to-find-out-whats-new-in-powershell-vnext)
# Small changes by Stefan Stranger
# Date: 21-09-2011

#Run in OpsMgr 2007 Command Shell
Get-Command -Module Microsoft.EnterpriseManagement.OperationsManager.Client | Select-Object -Property Name,@{Name='Parameters';Expression={(Get-Command $_).Parameters.Keys}} | Export-Clixml d:\temp\opsmgr2007.xml

#Run in OM12 Command Shell
Get-Command -Module OperationsManager | Select-Object -Property Name,@{Name='Parameters';Expression={(Get-Command $_).Parameters.Keys}} | Export-Clixml d:\temp\om12.xml


# run either in OpsMgr2007  or OM12 console
$OpsMgr2007 = Import-CliXml d:\temp\opsmgr2007.xml | Sort-Object -Property Name
$OM12 = Import-CliXml d:\temp\om12.xml | Sort-Object -Property Name

Compare-Object $OpsMgr2007 $OM12 -Property Name -IncludeEqual -PassThru | ForEach-Object {

    $Command = $_

    if($_.SideIndicator -eq ‘==’)
    {
        $Command = $_

        $cOpsMgr2007 = $OpsMgr2007  | Where-Object {$_.Name -eq $Command.Name} | Select-Object -ExpandProperty Parameters
        $cOM12 = $OM12 | Where-Object {$_.Name -eq $Command.Name} | Select-Object -ExpandProperty Parameters

        $compare = Compare-Object $cOpsMgr2007  $cOM12

        if($compare)
        {
            try
            {
                $NewParameters = $compare | Where-Object {$_.SideIndicator -eq ‘=>’} | ForEach-Object {$_.InputObject + ‘ (+)’}
                $RemovedParameters = $compare | Where-Object {$_.SideIndicator -eq ‘<=’} | ForEach-Object {$_.InputObject + ‘ (-)’}

                “$($command.Name) (!)”
                $NewParameters + $RemovedParameters | Sort-Object | ForEach-Object { “`t$_”}
                “`n”
            }
            catch{}
        }
    }
    elseif($_.SideIndicator -eq ‘=>’)
    {
        “$($Command.name) (+)`n”
    }
    else
    {
        “$($Command.name) (-)`n”
    }
}

 

OpsMgr 2007 Command Shell

image

 

OM12 Command Shell

image

 

Legend

> Changed
+ > New
- > Removed

 

Add-ConnectorToTier (-) Get-RelationshipClass (-) Import-SCManagementPack (+)
Add-RemotelyManagedComputer (-) Get-RelationshipObject (-) Import-SCOMManagementPack (+)
Add-RemotelyManagedDevice (-) Get-RemotelyManagedComputer (-) Install-Agent (-)
Add-SCOMAgentlessManagedComputer (+) Get-RemotelyManagedDevice (-) Install-AgentByName (-)
Add-UserToUserRole (-) Get-ResultantCategoryOverride (-) Install-ManagementPack (-)
Approve-AgentPendingAction (-) Get-ResultantRuleOverride (-) Install-SCOMAgent (+)
Approve-SCOMPendingManagement (+) Get-ResultantUnitMonitorOverride (-) New-CustomMonitoringObject (-)
Deny-SCOMPendingManagement (+) Get-RootManagementServer (-) New-DeviceDiscoveryConfiguration (-)
Disable-NotificationSubscription (-) Get-Rule (-) New-LdapQueryDiscoveryCriteria (-)
Disable-Rule (-) Get-RunAsAccount (-) New-MaintenanceWindow (-)
Disable-SCOMAgentProxy (+) Get-SCClass (+) New-ManagementGroupConnection (-)
Disable-SCOMDiscovery (+) Get-SCDiscovery (+) New-MonitoringPropertyValuePair (-)
Disable-SCOMMonitor (+) Get-SCManagementGroupConnection (+) New-SCManagementGroupConnection (+)
Disable-SCOMNotificationSubscription (+) Get-SCManagementPack (+) New-SCOMManagementGroupConnection (+)
Disable-SCOMRule (+) Get-SCOMAccessLicense (+) New-SCOMResourcePool (+)
Enable-NotificationSubscription (-) Get-SCOMAgent (+) New-Tier (-)
Enable-Rule (-) Get-SCOMAgentlessManagedComputer (+) New-WindowsDiscoveryConfiguration (-)
Enable-SCOMAgentProxy (+) Get-SCOMAgentManagementServerSetting (+) Reject-AgentPendingAction (-)
Enable-SCOMDiscovery (+) Get-SCOMAlert (+) Remove-ConnectorFromTier (-)
Enable-SCOMMonitor (+) Get-SCOMAlertHistory (+) Remove-DisabledMonitoringObject (-)
Enable-SCOMNotificationSubscription (+) Get-SCOMClass (+) Remove-ManagementGroupConnection (-)
Enable-SCOMRule (+) Get-SCOMClassInstance (+) Remove-RemotelyManagedComputer (-)
Export-ManagementPack (-) Get-SCOMCommand (+) Remove-RemotelyManagedDevice (-)
Export-SCManagementPack (+) Get-SCOMConnector (+) Remove-SCManagementGroupConnection (+)
Export-SCOMEffectiveMonitoringConfiguration (+) Get-SCOMDiagnostic (+) Remove-SCManagementPack (+)
Export-SCOMManagementPack (+) Get-SCOMDiscovery (+) Remove-SCOMAgentlessManagedComputer (+)
Get-Agent (-) Get-SCOMEvent (+) Remove-SCOMDisabledClassInstance (+)
Get-AgentPendingAction (-) Get-SCOMGatewayManagementServer (+) Remove-SCOMManagementGroupConnection (+)
Get-Alert (-) Get-SCOMGroup (+) Remove-SCOMManagementPack (+)
Get-AlertDestination (-) Get-SCOMMaintenanceMode (+) Remove-SCOMResourcePool (+)
Get-AlertHistory (-) Get-SCOMManagementGroupConnection (+) Remove-SCOMRMSEmulator (+)
Get-Connector (-) Get-SCOMManagementPack (+) Remove-Tier (-)
Get-DefaultSetting (-) Get-SCOMManagementServer (+) Resolve-Alert (-)
Get-Diagnostic (-) Get-SCOMMonitor (+) Set-AlertDestination (-)
Get-Discovery (-) Get-SCOMNotificationAction (+) Set-DefaultSetting (-)
Get-Event (-) Get-SCOMNotificationEndpoint (+) Set-MaintenanceWindow (-)
Get-FailoverManagementServer (-) Get-SCOMNotificationRecipient (+) Set-ManagementServer (-)
Get-GatewayManagementServer (-) Get-SCOMNotificationSubscription (+) Set-ProxyAgent (-)
Get-MaintenanceWindow (-) Get-SCOMOverride (+) Set-SCManagementGroupConnection (+)
Get-ManagementGroupConnection (-) Get-SCOMOverrideResult (+) Set-SCOMAgentlessManagedComputer (+)
Get-ManagementPack (-) Get-SCOMPendingManagement (+) Set-SCOMAgentManagementServerSetting (+)
Get-ManagementServer (-) Get-SCOMRecovery (+) Set-SCOMAlert (+)
Get-Monitor (-) Get-SCOMRelationship (+) Set-SCOMMaintenanceMode (+)
Get-MonitorHierarchy (-) Get-SCOMRelationshipInstance (+) Set-SCOMManagementGroupConnection (+)
Get-MonitoringClass (-) Get-SCOMResourcePool (+) Set-SCOMResourcePool (+)
Get-MonitoringClassProperty (-) Get-SCOMRMSEmulator (+) Set-SCOMRMSEmulator (+)
Get-MonitoringObject (-) Get-SCOMRule (+) Set-SCOMRunAsProfile (+)
Get-MonitoringObjectGroup (-) Get-SCOMRunAsAccount (+) Set-SCOMUserRole (+)
Get-MonitoringObjectPath (-) Get-SCOMRunAsProfile (+) Start-Discovery (-)
Get-MonitoringObjectProperty (-) Get-SCOMTask (+) Start-SCOMMaintenanceMode (+)
Get-NotificationAction (-) Get-SCOMTaskResult (+) Start-SCOMTask (+)
Get-NotificationEndpoint (-) Get-SCOMUserRole (+) Start-Task (-)
Get-NotificationRecipient (-) Get-SCRelationship (+) Uninstall-Agent (-)
Get-NotificationSubscription (-) Get-SCRelationshipInstance (+) Uninstall-ManagementPack (-)
Get-OperationsManagerCommand (-) Get-State (-) Uninstall-SCOMAgent (+)
Get-Override (-) Get-Task (-)  
Get-PerformanceCounter (-) Get-TaskResult (-)  
Get-PerformanceCounterValue (-) Get-Tier (-)  
Get-PrimaryManagementServer (-) Get-UserRole (-)  
Get-Recovery (-)    

 

Most of the changes are changes in the noun naming convention Smile Example: Get-Alert is changed in Get-SCOMAlert.

 

Have fun!