I kept getting the same error message even though my OU designation was 100% correct. I was finally able to set this config in my Exchange 2010.
Turns out my problem wasn't the formatting of my OU information as all the posts suggested. I have a multi-domain forest. My users (as is the OU I wanted to use for my DistributionGroupDefaultOU) are all in a child domain of the root domain. All my email addresses use the root domain structure. I had the OU information 100% correct using either the OU=, DC=...etc. format or the domain/OU format but still got the error. Frustrating!!! Finally I thought to add the "DomainController" switch to the command pointing to a DC in the child domain and the command was processed successfully! On reflection, the earlier error message had been correct,,, the OU could not be found in the domain (or on the DC) the command (or rather Exchange) was using at the time. When I pointed the command to the correct DC (in the correct domain) the command worked.
As example, here's what I have:
- root domain= example.com (DC=Example,DC=com)
- child domain= staff.example.com ("DC=STAFF,DC=Example,DC=com)
- all my user accounts are in staff.example.com
- all email addresses= [email protected]
my desired "DistributionGroupDefaultOU"= Groups (in root of staff.example.com)
(OU=Groups,DC=STAFF,DC=Example,DC=com)
Below is what finally worked for me:
Set-OrganizationConfig -DomainController "DC1.staff.example.com" -DistributionGroupDefaultOU "OU=Groups,DC=STAFF,DC=Example,DC=com"
Possibly my solution might also work for others having the same problem if they have a single domain forest. I suspect my problem was caused by my Exchange 2010 server talking to a DC in a different domain in the forest than the one which contained the OU I was aiming for. Hope this helps someone else out.
BTW - to get the OU format 100% correct for your command, use "Active Directory Users + Computers". On the menu bar: under "view" make sure "Advanced Features" is check marked. Then find the OU you want to use for your default location, on that OU right click and select properties. Go to the "Attribute Editor" tab. scroll down to "distinguishedName" and double click it. Copy the "Value" to your clip board. Use that for your OU switch in the PowerShell command.