You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$d=$dn.Split(',') ## Split the dn string up into it's constituent parts
$arr= (@(($d|Where-Object { $_-notmatch'DC=' }) |ForEach-Object { $_.Substring(3) })) ## get parts excluding the parts relevant to the FQDN and trim off the dn syntax
[array]::Reverse($arr) ## Flip the order of the array.
## Create and return the string representation in canonical name format of the supplied DN