-
Get User Information – Retrieve user details for viewing.
Get-ADUser -Identity <username> -Properties * | Select-Object Name, EmailAddress, Title, Department
-
Unlock a User Account – Unlocks an account after too many failed login attempts.
Unlock-ADAccount -Identity <username>
-
Get Group Information – View details for a specific group.
Get-ADGroup -Identity "GroupName" -Properties * | Select-Object Name, Description
-
Add a User to a Specific Group – Adds a user to an authorized group.
Add-ADGroupMember -Identity "GroupName" -Members <username>
-
List All Members of a Group – View group membership.
Get-ADGroupMember -Identity "GroupName"
-
Check if User is a Member of a Group – Verifies group membership.
Get-ADUser -Identity <username> -Properties MemberOf | Select-Object -ExpandProperty MemberOf
-
Get Computer Information – Retrieve details of a computer account.
Get-ADComputer -Identity "ComputerName" -Properties * | Select-Object Name, OperatingSystem, LastLogonDate
-
Delete a Computer Account – Removes a computer account from AD.
Remove-ADComputer -Identity "ComputerName" -Confirm:$false
-
Retrieve LAPS Password – Reads the Local Administrator Password Solution (LAPS) password.
Get-ADComputer -Identity "ComputerName" -Properties ms-Mcs-AdmPwd | Select-Object Name, @{Name="LAPSPassword";Expression={$_.“ms-Mcs-AdmPwd”}}
-
Retrieve BitLocker Recovery Key – Gets the BitLocker recovery key for a specific computer.
Get-ADObject -Filter 'objectclass -eq "msFVE-RecoveryInformation"' -SearchBase "CN=ComputerName,OU=Computers,DC=domain,DC=com" -Properties msFVE-RecoveryPassword | Select-Object -ExpandProperty msFVE-RecoveryPassword
-
Search Users by Specific Criteria – Locate users based on attributes.
Get-ADUser -Filter "Title -eq 'Manager'" -Properties DisplayName, Title, Department
-
Find Locked Out Users – Identifies users with locked accounts.
Search-ADAccount -LockedOut | Select-Object Name, LockedOut
-
Find Disabled Accounts – Lists accounts that are disabled.
Search-ADAccount -AccountDisabled | Select-Object Name, Enabled
-
Export User Details to CSV – Saves user information for reporting.
Get-ADUser -Filter * -Properties Name, EmailAddress, Title | Select-Object Name, EmailAddress, Title | Export-Csv -Path "C:\ADUsers.csv" -NoTypeInformation
-
Export Group Membership to CSV – Saves group membership list for reporting.
Get-ADGroupMember -Identity "GroupName" | Select-Object Name, SamAccountName | Export-Csv -Path "C:\GroupMembers.csv" -NoTypeInformation