Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import-Module "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
- $listOfApp = ('App1','App2')
- $ou = "OU=AppGroups,DC=Domain,DC=TLD"
- Foreach ($app in $listOfApp)
- {
- $GroupName = "App" + $app + "Users"
- New-AdGroup -Name $GroupName -Path $ou -GroupCategory Security -GroupScope Global -Description "Members of this group has access to $app"
- New-CMUserCollection -Name $GroupName -RefreshType ConstantUpdate -LimitingCollectionName "All User Groups" -Comment "Members of this group has access to $app"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement