daknetworks.com

You are here: Blog Find User's OU

Find User's OU

You know Joel in Sales. But you don't remember Joel's last name (because you've been staring at names all week) and you don't know Joel's OU.

Here's how to find Joel:

get-aduser -filter * |select samaccountname |findstr /i joel

This will bring up all the Joel's in the domain. Hopefully you can narrow it down from here.

Now to find Joel's OU in the details of his record:

get-aduser joel.user

This will show the "distinguishedname" and allow you to narrow down the OU.

If you really want to see this properly in one line, we need to use the "canonicalname" and it would be like this:

get-aduser -filter * -Properties Canonicalname |select samaccountname,canonicalname |fl |findstr /i joel

Contact Dak Networks

We are not taking on new clients at this time.