# Get Execution Policyget-executionpolicy# Show PowerShell Version$PSVersionTable
# User listGet-ADUser-Filter *# Get User and List All Properties (attributes)Get-ADUser username -Properties *# Get All Users From a Specific OUGet-ADUser-SearchBase “OU=ADPRO Users,dc=ad,dc=activedirectorypro.com”-Filter *# Get AD Users by Nameget-Aduser-Filter {name -like"*robert*"}# Find All Locked User AccountsSearch-ADAccount-LockedOut# create a new usernet user john abc123!# create a domain usernet user john abc123!/add /domain# add the created user to a groupnet group "Exchange Windows Permissions" john /add# add the created user to a localgroupnet localgroup "Remote Management Users" john /add# to verifynet user john
# Get All Security Groups
Get-ADGroup -filter *
# Get All Computers by Name
Get-ADComputer -filter * | select name
# Get all Windows 10 Computers
Get-ADComputer -filter {OperatingSystem -Like '*Windows 10*'} -property * | select name, operatingsystem
# Get All Computers
Get-AdComputer -filter *
# Get all GPOs by status
get-GPO -all | select DisplayName, gpostatus
# all Active Directory commands
get-command -Module ActiveDirectory
# Basic Domain Information
Get-ADDomain
# Get all DC
Get-ADDomainController -filter * | select hostname, operatingsystem
# Get all Fine Grained Password Policies
Get-ADFineGrainedPasswordPolicy -filter *
# Get Domain Default Password Policy
Get-ADDefaultDomainPasswordPolicy