[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 116
  • Last Modified:

need to generate UPN for an OU - dirsync office 365

need to generate a report an OU
0
Jorge Ocampo
Asked:
Jorge Ocampo
  • 3
  • 2
1 Solution
 
Vasil Michev (MVP)Commented:
Some more details on what you are trying to achieve might help...
0
 
Jorge OcampoAuthor Commented:
trying to get the upn of users inside an OU
0
 
Vasil Michev (MVP)Commented:
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
 
Jorge OcampoAuthor Commented:
how do i get the name of an OU for example "OU=Test,DC=domain,DC=com" im in aduc right now
0
 
Vasil Michev (MVP)Commented:
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

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now