Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Last active September 11, 2017 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mczerniawski/393d9207671290be7e49b1252d902e2f to your computer and use it in GitHub Desktop.
Save mczerniawski/393d9207671290be7e49b1252d902e2f to your computer and use it in GitHub Desktop.
Create AD groups for LAPS
$Share_GPOInstalls_RGroupProps = @{
Name = 'GPOInstalls_R'
SamAccountName = 'GPOInstalls_R'
Description = 'Members allowed to read from Share GPOInstalls'
DisplayName = 'GPOInstalls_R'
GroupCategory = 'Security'
GroupScope= 'Universal'
Path = 'OU=AD,OU=Security Groups,DC=contoso,DC=com'
}
New-ADGroup @Share_GPOInstalls_RGroupProps
$Share_GPOInstalls_RWGroupProps = @{
Name = 'GPOInstalls_RW'
SamAccountName = 'GPOInstalls_RW'
Description = 'Members with full access to Share GPOInstalls'
DisplayName = 'GPOInstalls_RW'
GroupCategory = 'Security'
GroupScope= 'Universal'
Path = 'OU=AD,OU=Security Groups,DC=contoso,DC=com'
}
New-ADGroup @Share_GPOInstalls_RWGroupProps
Add-ADGroupMember -Identity $Share_GPOInstalls_RGroupProps.SamAccountName -Members 'Domain users'
Add-ADGroupMember -Identity $Share_GPOInstalls_RWGroupProps.SamAccountName -Members 'Domain admins'
$ServerGroupProps = @{
Name = 'LAPSServer_Read'
SamAccountName = 'LAPSServers_Read'
Description = 'Members allowed to read LAPS attributes for Servers'
DisplayName = 'LAPSServers_Read'
GroupCategory = 'Security'
GroupScope= 'Universal'
Path = 'OU=AD,OU=Security Groups,DC=contoso,DC=com'
}
New-ADGroup @ServerGroupProps
$WorkstationGroupProps = @{
Name = 'LAPSWorkstation_Read'
SamAccountName = 'LAPSWorkstation_Read'
Description = 'Members allowed to read LAPS attributes for Workstations'
DisplayName = 'LAPSWorkstation_Read'
GroupCategory = 'Security'
GroupScope= 'Universal'
Path = 'OU=AD,OU=Security Groups,DC=contoso,DC=com'
}
New-ADGroup @WorkstationGroupProps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment