Home > OM12, OM12 Powershell > Loading the OpsMgr 2007 snap-in for OpsMgr 2012

Loading the OpsMgr 2007 snap-in for OpsMgr 2012

Please note this was not an exhaustive test, if you are considering running OpsMgr 2007 scripts in an OpsMgr 2012 environment please do so in a lab setup to verify it works as expected before doing this in a production environment.

Well, I just tested this in a lab. Not that it is anything special, just thought I should note this as I did it to just make sure it works. The standard OM07 cmdlets seemed to work with out much trouble. When you load the OpsMgr 2012 console, the OpsMgr 2007 snap-in file is installed as well. You just need to tell PowerShell about it and that is only four lines of code.

Add-PSSnapIn Microsoft.EnterpriseManagement.OperationsManager.Client
cd \
cd "$env:c:\Program Files\System Center 2012\Operations Manager\Console"
.\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1

 

The first line loads the snap-in into PowerShell,  the Second line changes the directory to the root, of the C drive in my case, the third line changes the directory to the location where the OpsMgr 07 startup file is located, the fourth line actually runs the startup file.

Advertisements
Categories: OM12, OM12 Powershell
  1. September 3, 2012 at 6:07 am

    Great Scott!

    My friend Ivan Hadzhiyski did it like this:

    $Server = “scomms12.contoso.com”
    Add-PSSnapin “Microsoft.EnterpriseManagement.OperationsManager.Client”
    Set-Location “OperationsManagerMonitoring::”
    New-ManagementGroupConnection `
    –ConnectionString $Server
    Set-location $Server

    And of course that first line had the server name of a management server in it.
    Hope it helps.

  2. September 3, 2012 at 7:11 am

    Thank you Bob!

  1. September 9, 2012 at 3:10 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: