Error Running New-TestCasConnectivityUser.ps1

Wednesday, May 25, 2011
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 (more specific) match:
OrganizationalUnit = "CN=Users,DC=domain,DC=com"
Be sure to edit this to match your domain naming context.



Then save the script and run it.

5 comments:

  1. Did you send bugreport to MS to improve the script in the next version?

    ReplyDelete
  2. Great find Jeff. I have not used that script yet

    ReplyDelete
  3. DON'T copy and paste the line into your file. Refer to the screenshot instead.

    A: DN=Domain,DN=com should match YOUR default naming context.
    B: It's DC=, not DN=
    C: It's CN=Users, not CN-Users (equal not dash)

    ReplyDelete
  4. Thanks, I've updated the article with the corrections.

    ReplyDelete
  5. In fact, you don't need to modify the script. Just use parameter: new-TestCasConnectivityUser.ps1 -OU "MyOU" or -OU "CN=Users,DC=mydomain,DC=com". Don't forget to use "".

    ReplyDelete

Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.