π‘Useful AD Commands
AD Commands
# Get Execution Policy
get-executionpolicy
# Show PowerShell Version
$PSVersionTable# User list
Get-ADUser -Filter *
# Get User and List All Properties (attributes)
Get-ADUser username -Properties *
# Get All Users From a Specific OU
Get-ADUser -SearchBase βOU=ADPRO Users,dc=ad,dc=activedirectorypro.comβ -Filter *
# Get AD Users by Name
get-Aduser -Filter {name -like "*robert*"}
# Find All Locked User Accounts
Search-ADAccount -LockedOut
# create a new user
net user john abc123!
# create a domain user
net user john abc123! /add /domain
# add the created user to a group
net group "Exchange Windows Permissions" john /add
# add the created user to a localgroup
net localgroup "Remote Management Users" john /add
# to verify
net user johnLast updated
Was this helpful?