Today I wanted to use my powershell prompt to connect to my SCOM environment. I started down this path because, I had to use an admin account when accessing my SCOM environment and I wanted to create a shortcut that opened up powershell and then made that connection to SCOM.
The simplest way to do this would be just to open up the Operations Manager Shell, but I was hard headed. I wanted to understand what was needed to be done if I wanted to connect to my SCOM management group by just opening up powershell.
So here is how I did it:
Also I want to note this was done on a windows 7 x64 workstation
1. You need to make sure you have the SCOM console installed on the system you are connecting from. ( you don’t necessarily need to have the console installed, but this is the easiest way to do it)
2. Hold Shift and right click on my shortcut for powershell and select “ Run As different User” Enter your credentials that has admin access to SCOM
You should see the following prompts
and then this
(Note: I just found out that they removed the feature to change the properties of the shortcut and add a different User account so it would launch with alternate credentials every time. As far as I know you have to download and use a Systernal’s tool called “shellrunas” This will allow you to setup the shortcut to automatically prompt you for credentials.)
A Link explanining the Run As Utility
http://social.technet.microsoft.com/Forums/en/w7itproui/thread/bb1480cf-c920-4d83-b889-4654f5713c8f
Systernal’s Shell run as tool
http://technet.microsoft.com/en-us/sysinternals/cc300361.aspx
3. I used the following commands @ my powershell prompt
$rootMS = "Your RMS Server"
add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin
new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin
New-PSDrive -Name: Monitoring -PSProvider: OperationsManagerMonitoring -Root: \ -ErrorAction SilentlyContinue -ErrorVariable Err
Set-Location Monitoring:\$rootMS
or
cd Monitoring:\$rootMS
4. Now you should have access to your SCOM Environment
**I give no warranty or responsible for anything you try on this site using any of the tips or information posted on this blog. Use at your own risk. Be Smart backup!