Please refer to the following blog, Brian Wren develop a powershell script to retrieve SCOM performance data
https://gallery.technet.microsoft.com/scriptcenter/Retrieve-Performance-Data-c4595e2a
Roger
its not about retreiving,its about creating a performance counter in scom using powershell,i have used the following script but it has no effect its not creating any performance counter in scom can some help me doing this
$api = new-Object -ComObject 'Mom.ScriptAPI'$bag = $api.CreatePropertyBag()
$bag.Addvalue('LocationName', 10)
#$api.Return($bag)
- Edited by Suresh Gaddam Wednesday, November 19, 2014 10:44 AM
- Proposed as answer by Chinna2580 Tuesday, February 03, 2015 7:50 AM
its not about retreiving,its about creating a performance counter in scom using powershell,i have used the following script but it has no effect its not creating any performance counter in scom can some help me doing this
$api = new-Object -ComObject 'Mom.ScriptAPI'$bag = $api.CreatePropertyBag()
$bag.Addvalue('LocationName', 10)
#$api.Return($bag)
- Edited by Suresh Gaddam Wednesday, November 19, 2014 10:44 AM
- Proposed as answer by Chinna2580 Tuesday, February 03, 2015 7:50 AM
Hi,
To create performance counters please refer to the links below:
Use PowerShell to Create and Update Performance Counters
Creating Performance Collection Rules in SCOM 2012 with PowerShell
http://blogs.msdn.com/b/rslaten/archive/2013/06/02/creating-performance-collection-rules-in-scom-2012-with-powershell.aspx
Regards,
Yan Li
Hi Yan Li,
Cant we directly create performance counter in scom using powershell ?
I have tried those,but i need to create directly in the scom, Is it possible to do so ?
- Edited by Suresh Gaddam Thursday, November 20, 2014 6:09 AM
Hi Yan Li,
Cant we directly create performance counter in scom using powershell ?
I have tried those,but i need to create directly in the scom, Is it possible to do so ?
- Edited by Suresh Gaddam Thursday, November 20, 2014 6:09 AM
No, you can't. This template can create monitor for cscript.exe (js/vbs). But you can find in internet management pack which can add powershell template.Hi Yan Li,
Cant we directly create performance counter in scom using powershell ?
I have tried those,but i need to create directly in the scom, Is it possible to do so ?
I found only powershell monitor,can you please provide those links?
thanks & Regards,
Suresh Gaddam
Hi Vladimir,
I have found the solution by creating a custom management pack using MP Author i used a rule to execute powershell script and it is working like a charm.
Thanks & Regards,
Suresh Gaddam
Hi Suresh
I know this post is old, but maybe you will comment on which Data Source you used? And maybe even post a sample solution?
Thanks
Michael