I'm trying to write a script that will display users specific properties, Name, Mail Address, OU respectively. the output is as intended however I can't find any solution to extract and display only the user's OU detail. when I select "DistinguishedName" the response is the following pattern: {CN = X, OU = Y, DC = Z}, I want to display only the OU. iv'e tried to find a method to split the DN String however no joy so far.

Thanks in advance

```
Set-ExecutionPolicy Unrestricted 
$filepath = "C:\Users\Administrator\Desktop\ADusers.Csv"
$searchDomain = "DC = GSDOM, DC=internal"
$adminCredential = Get-Credential
$adSrv = 'GSDC'
$session = New-PSSession -ComputerName "$adSrv" -Credential ($adminCredential)
Invoke-Command $session -Scriptblock { Import-Module ActiveDirectory }
Import-PSSession -Session $session -module ActiveDirectory
Get-ADUser -Filter * -Properties * | Select-Object "Name", "EmailAddress", "distinguishedName"

```

---