You are on page 1of 16

11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

1 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

2 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

New-ADComputer -Name "ComputerName" -SamAccountName "ComputerName" -Path


"OU=Computers,DC=Domain,DC=com"

New-ADGroup -Name "Security Group Name" -SamAccountName "SecurityGroupName"


-GroupCategory Security -GroupScope Global -DisplayName "Security Group Name" -Path
"CN=Groups,DC=Domain,DC=com" -Description "Brief description of the what security
group is used for"

New-ADUser -Name "User Account Name" -SamAccountName "UserAccountName"

-AccountPassword (ConvertTo-SecureString "password" -AsPlainText -Force) -DisplayName

3 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

"User Name" -Enabled $True -GivenName "FirstName" -Path "CN=Users,,DC=Domain,DC=com"


-Server "controller.domain.com" -Surname "LastName" -UserPrincipalName
"username@domain.com"

New-ADOrganizationalUnit -Name "OU Name" -Path "DC=Domain,DC=com"

Add-ADGroupMember SecurityGroupName -Members Username01 -Server

4 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

"controller.domain.com" Remove-ADGroupMember SecurityGroupName -Members Username01


-Server "controller.domain.com"

Get-AdmPwdPassword -ComputerName "computer.domain.net"

Add-Computer -DomainName "domain.com" -Credential Domain\Username -Restart -Force

5 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

Enable-ADAccount -Identity "ComputerName"

Disable-ADAccount -Identity "Username"

Unlock-ADAccount -Identity "Username"

Search-ADAccount -AccountDisabled | FT Name,ObjectClass

6 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

Test-ComputerSecureChannel -Server "controller.domain.com"

7 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

8 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

9 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

10 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

11 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

12 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

14 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

15 of 16 22-03-2022, 22:58
11 PowerShell commands to use in managing Active Directory | TechRe... https://www.techrepublic.com/article/11-powershell-commands-to-use-i...

16 of 16 22-03-2022, 22:58

You might also like