get-managementserver -path parmater
I'm trying to write a SCOM script and when I try to run the get-managementserver cmdlet I get the error "The 'Path' parameter is empty of the required provider is not set.". What do I need to do? Thanks and sorry if this was already covered somewhere
else. I going to search now.
Scott M
April 28th, 2011 3:31pm
Hi Scott
It might help to copy and paste your script here so that we can look at it more depth.
I take it that the OpsMgr PShell is initialised? Marnix has a snippet of code here that initialises the snap-in:
http://thoughtsonopsmgr.blogspot.com/2009/07/powershell-changing-resolution-state.html
Cheers
GrahamView OpsMgr tips and tricks at
http://systemcentersolutions.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2011 4:29pm
You ahve probably navigated your powershell prompt into the filesystem in order to call your script. The Ops Mgr snapin relies on the powershell provider model and requires you to be in the default Monitoring:\ provider. If you navigate to the
filesystem then the cmdlets don't know who to connect to.
So leave the prompt in the default place after opening the shell, and just call your script using the full file path.
Thanks,
-Lincoln
April 28th, 2011 5:25pm
Hi,
I also think the script is needed to be checked. Please also post the script here if you don’t mind.
Regarding the usage of the “get-managementserver”, please also refer to:
Get-ManagementServer
http://technet.microsoft.com/en-us/library/gg132239.aspx
Hope this helps.
Thanks.
Nicholas Li - MSFT
Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
May 2nd, 2011 2:26am