If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.
#Set Error Action to Silently Continue $ErrorActionPreference = "SilentlyContinue" #Log File Info $sLogPath = "C:\Windows\Temp" $sLogName = "Write_PA_PasswordPolicy.log" $sLogFile = Join-Path -Path $sLogPath -ChildPath $sLogName $Error.Clear() Import-Module ActiveDirectory $OU1 = 'OU=SecTest,OU=Priviledged_Access,OU=_Users,DC=test,DC=org' $SecGroup = (Get-ADGroup -Identity 'PrivilegedUserPasswordPolicy').DistinguishedName Get-ADUser –SearchBase $OU1 –LDAPFilter "(&(objectCategory=person)(objectClass=user)(!(memberOf=$SecGroup)))" | Add-ADPrincipalGroupMembership –MemberOf $SecGroup #Log Error $Error | Out-file $sLogFile -Append
Join the community of 500,000 technology professionals and ask your questions.