[Powershell] Invoke-RestMethod call REST Api

cls

$authInfo = @{
username = “username"
password = “password"
}

$base64AuthInfo = [Convert]::ToBase64String(
[Text.Encoding]::ASCII.GetBytes(
(“{0}:{1}" -f $authInfo.username, $authInfo.password)))

$basePath = “http://path/to/baseUrl"

$uri = $basePath + “{0}" -f “/api/softwareInfo/version"

$resMsg = Invoke-RestMethod -Uri $uri -Headers @{Authorization=(“Basic {0}" -f $base64AuthInfo)} -Method Get

if($resMsg.version -ne $null)
{
echo $resMsg.version
return @{
username = $authInfo.username
password = $authInfo.password
uri = $basePath
}
}

SCOM 2012 Reference

寫Management Pack的幾個方法:
http://technet.microsoft.com/en-us/library/hh457569.aspx

1. 用SCOM Authoring寫 (Web Application Availability Monitoring – 簡單較沒彈性):
http://www.opsmanfan.com/index.php/6-use-scom-2012-to-monitor-a-webapi-without-using-scripts

2. 用SCOM Authoring寫(Web Application Transaction Monitoring – 困難較有彈性):
http://www.opsmanfan.com/index.php/8-scom-2012-actionable-web-application-alerts-a-scripted-solution

3. 用VS2012 Authoring Extentions寫 (困難最有彈性):
先安裝VS2012, 再安裝 VisualStudioAuthoringConsole_x64.msi(http://www.microsoft.com/en-us/download/details.aspx?id=30169)

TechEd SCOM 2012:

EPC Group.net

Management Pack Reference:
http://msdn.microsoft.com/en-us/library/jj130093.aspx
1. Elemnts:
http://msdn.microsoft.com/en-us/library/jj130347.aspx
2. Data Type:
http://msdn.microsoft.com/en-us/library/jj129838.aspx
3. Module Type:
http://msdn.microsoft.com/en-us/library/jj130161.aspx
4. Schema Type:
http://msdn.microsoft.com/en-us/library/jj130175.aspx

SCOM 2012 SDK:
https://msdn.microsoft.com/en-us/library/hh329086.aspx
https://msdn.microsoft.com/en-us/library/hh329022.aspx
https://msdn.microsoft.com/en-us/library/jj130058.aspx
SCOM 2007 SDK:
http://msdn.microsoft.com/en-us/library/cc268402.aspx
Key Concept:
https://technet.microsoft.com/zh-tw/library/ee957039.aspx
Entity Types:
https://msdn.microsoft.com/en-us/library/jj129881.aspx
Articles:
Self-study:
http://blogs.technet.com/b/musings_of_a_technical_tam/archive/2012/06/19/system-center-2012-self-study-guides-part-5-operations-manager.aspx
MP Dashboard:
http://social.technet.microsoft.com/wiki/contents/articles/12324.creating-a-widget-for-operations-manager-dashboard-walkthrough-1-custom-ui-control.aspx
SCOM set SessionID parameter:
http://technet.microsoft.com/en-us/library/gg494976.aspx
SQL:
SELECT * FROM [OperationsManager].[dbo].[ManagedType] — 列出可用 Type
SELECT * FROM [OperationsManager].[dbo].[PendingSdkDataSource] — 列出 SDK 塞的 Event & Performance Data

SCOM 2012 安裝步驟

http://www.randomtechtips.com/install-system-center-operations-manager-2012-r2-step-by-step/

http://www.windows-noob.com/forums/index.php?/topic/8588-scom-2012-sp1-in-a-lab-installation-part-e-install-scom/

http://blogs.technet.com/b/kevinholman/archive/2013/10/18/opsmgr-2012-r2-quickstart-deployment-guide.aspx

http://srvcore.wordpress.com/2010/01/04/scom-agent-firewall-ports-and-requirements/