If you want to query Active Directory, using powershell, odds are you’ll end up doing something like this eventually if you don’t have the ActiveDirectory module:
$ad = New-Object system.directoryservices.directorysearcher samaccountname=$id
That’s all fine and dandy, but how many different properties does $ad have and what exactly are they? That’s actually pretty easy to find, but every time I need this I always forget how and end up wasting an hour or more trying to figure it out again, here’s how:
($ad.findall())[0].properties