Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Last active September 11, 2017 15:19
Show Gist options
  • Select an option

  • Save mczerniawski/61d0158e056099a8e71245844fed5468 to your computer and use it in GitHub Desktop.

Select an option

Save mczerniawski/61d0158e056099a8e71245844fed5468 to your computer and use it in GitHub Desktop.
Alter OU permissions for LAPS
$OUsServers | ForEach-Object {
$serverProps = @{
Identity = $_
AllowedPrincipals = $ServerGroupProps.SamAccountName
}
Set-AdmPwdComputerSelfPermission -OrgUnit $_
Set-AdmPwdReadPasswordPermission @serverProps
}
$OUsWorkstations | ForEach-Object {
$workstationProps = @{
Identity = $_
AllowedPrincipals = $WorkstationGroupProps.SamAccountName
}
Set-AdmPwdComputerSelfPermission -OrgUnit $_
Set-AdmPwdReadPasswordPermission @workstationProps
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment