Hello,
I need to split a string (a Distinguished Name) in 2 parts: CN and OUs
Here is an example of the string:
$DNString = "CN=MyGroup,OU=OU3,OU=OU2,OU=OU1,DC=mydomain,DC=local"
With this command, I can get CN part:
$CN = $DNString.Split(",") | select -first 1
But I fail to get OU part: OU=OU3,OU=OU2,OU=OU1
What would be your advice ? Using regular expressions, a Select-String or something else ?Thanks for your help !