Active Directory - One Liners
Count Members of an AD Group
(Get-ADGroup "Enforce MFA" -Properties *).Member.Count
Get LAPS Password
Get-LapsADPassword mut7gpc202 -AsPlainText
Get-AllADDomainControllers
Gets a list of all Domain Controllers within the current domain. Install Active Directory mod...
Powershell to Get All Unique Properties in AD
get-aduser -filter * -property title | Select-Object title | sort-object title -unique
Force Active Directory replication on a domain controller
To force Active Directory replication run the command ‘repadmin /syncall /AeD’ on the domain cont...
List all users hidden from the GAL
Get-ADUser -Filter {msExchHideFromAddressLists -eq "TRUE"} |Select-Object UserPrincipalName Or...
Get Groups From AD User
Get-ADPrincipalGroupMembership adminrgastineau | Select-Object name
Get Unique Departments From Active Directory
get-aduser -filter * -property department | Select-Object -ExpandProperty department | sort-objec...
Get ACL for Files and Folders
The first PowerShell cmdlet used to manage file and folder permissions is get-acl; it lists all o...