How to search for AD objects?

How to search for AD objects?

In large organizations usually most accesses, mailing groups and applications are managed through Active Directory groups. User details are also stored in AD and searching for them can be complicated via AD’s GUI, yet doing it through Powershell opens a sea of possibilities.

Get-ADObject -Filter ‘Name -like “*Value*” -and ObjectClass -eq “Group”‘

Replace Value with the key word such as application name, group, folder or mailing list name.

Get-ADObject -Filter ‘Name -like “*Value*” -and ObjectClass -eq “User”‘

Replace Value with the user’s name or surname.

Get-ADObject -Filter ‘Samaccountname -like “*Value*” -and ObjectClass -eq “User”‘

Replace Value with the username or partial username.

Get-ADObject -Filter ‘whenchanged -gt DateTime(Year, Month, Day, 0, 0, 0) -and objectclass -eq “User”‘

This will display all the user profiles recently modified.