Need LDAP/DN of OU using Name

Hello, I'm in the process of cleaning up a massive amount of OUs but the file I have received are in "NAME" format. I tried dsquery ou - name "OU name" and it did not work. Can someone please help??? Thanks!!
IT_Admin XXXXAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will SzymkowskiSenior Solution ArchitectCommented:
What did you want the full DN of the OU?

If so, you can do this via powersgvtF hell.

Get-ADOrganizationalUnit -Filter * | select name, DN | export-csv c:\filename.csv -nti 

Open in new window

This will then give you the full path of all of the OU's in your domain
IT_Admin XXXXAuthor Commented:
Hi Will, Thank you for the info...

How do I import the list of group policy names and turn it into canonical name format or distinguished name format?

Thanks again!
Will SzymkowskiSenior Solution ArchitectCommented:
You can import GPO's using the Import-GPO cmdlet.

C:\PS>import-gpo -BackupId A491D730-F3ED-464C-B8C9-F50562C536AA -TargetName TestGPO -path c:\backups

Open in new window

Example is from Get-Help command.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.