AD Admin Commands Flashcards
Administrative commands for Active Directory
How to find an AD user by name?
Get-ADUser -Filter “Name -eq [name]” -Properties *
How to remove an AD user?
Remove-ADUser -Identity [SamAccountName]
How to add an AD User?
Add-ADUser (-FullName …, -SamAccountName…, -DisplayName…, -Password.., ect.)
How to unlock an AD account?
Unlock-ADAccount [SamAccountName]
How to reset the password for an AD account?
Set-ADAccountPassword -Identity [SamAccountName] -Reset -NewPassword (ConvertTo-SecureString -AsPlainText [password] -Force)
How to set an AD Account to create a new password at next logon?
Set-ADUser -Identity [SamAccountName] -ChangePasswordAtLogon $true
How to copy a GPO?
Copy-GPO -SourceName [GPO-to-copy] -TargetName [copied GPO name]
How to link a GPO to an OU?
New-GPLink -Name [GPO name] -Target [OU name] -LinkEnabled Yes
What command is used to domain-join a local computer?
Add-Computer -DomainName [domain name] -Credential INLANEFREIGHT[admin uname] -Restart
What command is used to domain join a remote computer?
Add-Computer -ComputerName [hostname] -LocalCredential [local admin uname] -DomainName [domain name] -Credential [domain admin uname] -Restart
How to find the OU membership of a computer?
Get-ADComputer -Identity [hostname] -Properties * | select CN,CanonicalName,IPv4Address