Error Running new-TestCasConnectivityUser.ps1

I ran into a strange problem running the new-TestCasConnectivityUser.ps1 script at a client today. When I ran the script to create the test account on a new Exchange installation, I received the following error:



CreateTestUser : Mailbox could not be created. Verify that OU ( Users ) exists and that password meets complexity requirements.








I verified that I could create a user account in the User container in AD just fine using the same password I supplied in the script. Obviously, I had sufficient rights and the password was complex enough.



After examining the new-TestCasConnectivityUser.ps1 script I noticed that the $OrganizationalUnit variable is looking for a match in AD for “Users”. A quick search using AD Users and Computers found that the client had many OU’s named Users throughout AD. The script was actually bombing out because it didn’t know which “Users” OU to use.



The fix is to add the following line below line 171 in the script to make it look for a better match:



OrganizationalUnit = “CN-Users,DN=domain,DN=com”






Then save the script and run it.