Solved

need to generate UPN for an OU - dirsync office 365

Posted on 2014-11-10
5
112 Views
Last Modified: 2014-11-21
need to generate a report an OU
0
Comment
Question by:Jorge Ocampo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 42

Expert Comment

by:Vasil Michev (MVP)
ID: 40433234
Some more details on what you are trying to achieve might help...
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40440697
trying to get the upn of users inside an OU
0
 
LVL 42

Expert Comment

by:Vasil Michev (MVP)
ID: 40440733
Get-ADUser -Filter * -SearchBase "OU=Test,DC=domain,DC=com" | select UserPrincipalName

Open in new window


If you want to export the list to CSV:

Get-ADUser -Filter * -SearchBase "OU=Test,DC=domain,DC=com" | select UserPrincipalName | Export-CSV -nti C:\users.csv

Open in new window

0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40440783
how do i get the name of an OU for example "OU=Test,DC=domain,DC=com" im in aduc right now
0
 
LVL 42

Accepted Solution

by:
Vasil Michev (MVP) earned 500 total points
ID: 40440813
Make sure advanced options are selected under View. Right-click on the OU object in ADUC, select properties. Go to the Attribute editor tab and look for the distinguishedName attribute.

Or do it with PowerShell:
Get-ADOrganizationalUnit -Filter {Name -like "Test"} | ft *Name

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
This Experts Exchange lesson shows how to use VBA to loop through rows in Excel.  In order to sort, filter, and use database features, there needs to be a value in each column for every row. When data arrives with values missing, code to copy values…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question