This script is just a wrapper to Kevin Holman's solution mentioned in Explicit Group Membership in SCOM using PowerShell.
Using my script you can maintain your explict group memberships by just maintaining a psd file explaiened here
- OperationsManager Console installed.
- You möust download The
AddRemoveComputersToSCOMGroup.ps1
from here must be and put int the same directory withAdd-GropupsFromPsd.ps1
.\Add-GropupsFromPSd.ps1 -ConfigPath .\GroupConfig.Psd1 -ManagementServer 'scom' -LogFilePath .\SCOMGroups.log -Verbose
Parameter | Definition |
---|---|
ConfigPath | Path to Configuration. Which must be a psd file. |
ManagementServer | Management Server Name. |
LogfilePath | Path to Log file |
The psd file contaisn GroupIDs as keys (left side) and a hashtable containing the MPName which should be fullname and COmputer list array. The MPName must be part of the GroupID.
@{
# 'GroupID' = @{MpName ='MPID/FullName';Computers=@('Computer1','Computer')}
'Contoso.SSMGroup.NOC' = @{MPName = 'Contoso.SSMGroup'; Computers =@('web03.contoso.com')}
'Contoso.SSMGroup.NOC1' = @{MPName = 'Contoso.SSMGroup'; Computers =@('web05.contoso.com','web01.contoso.com')}
}