AD Admin Commands Flashcards

Administrative commands for Active Directory

1
Q

How to find an AD user by name?

A

Get-ADUser -Filter “Name -eq [name]” -Properties *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to remove an AD user?

A

Remove-ADUser -Identity [SamAccountName]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to add an AD User?

A

Add-ADUser (-FullName …, -SamAccountName…, -DisplayName…, -Password.., ect.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to unlock an AD account?

A

Unlock-ADAccount [SamAccountName]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to reset the password for an AD account?

A

Set-ADAccountPassword -Identity [SamAccountName] -Reset -NewPassword (ConvertTo-SecureString -AsPlainText [password] -Force)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to set an AD Account to create a new password at next logon?

A

Set-ADUser -Identity [SamAccountName] -ChangePasswordAtLogon $true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to copy a GPO?

A

Copy-GPO -SourceName [GPO-to-copy] -TargetName [copied GPO name]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to link a GPO to an OU?

A

New-GPLink -Name [GPO name] -Target [OU name] -LinkEnabled Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command is used to domain-join a local computer?

A

Add-Computer -DomainName [domain name] -Credential INLANEFREIGHT[admin uname] -Restart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What command is used to domain join a remote computer?

A

Add-Computer -ComputerName [hostname] -LocalCredential [local admin uname] -DomainName [domain name] -Credential [domain admin uname] -Restart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to find the OU membership of a computer?

A

Get-ADComputer -Identity [hostname] -Properties * | select CN,CanonicalName,IPv4Address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly