Obtain users DN via PowerShell

Note to self… ┬áThis is how you can get the correct DN, and other information, for a user in AD.

From PowerShell

import-module activedirectory

get-aduser -filter {EmailAddress -like “rick@virtualrick.*”}

or

get-aduser -filter {samAccountName -like “rick*”}