最近打算把CMDB 當中的字段資訊與SCCM 做內建, 我們的CMDB 環境中定義了資産的業務等級, 例如: 生産, 測試, QA, 開發
- Powershell 導入SCCM 子產品 Import-Moudle ConfigurationManager
- 連接配接SCCM 站點
$SCCMSiteServer = 'SCCM2016'
$SCCMsiteCode = 'BeijingOffice'
$CMCollection = [wmiclass]("\\$SCCMSiteServer\ROOT\sms\site_$SCCMsiteCode" + ":SMS_Collection")
- 更新Device Category
[String]$CategoryID = ''
[Int]$ResourceID = ''
$CMCollection.SetDeviceCategory($CategoryID,$ResourceID)