new-TestCasConnectivityUser.ps1 fails with Verify that OU ( Users ) exists

When trying to run the new-TestCasConnectivityUser.ps1 script the latter might fail with the following error

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

new-TestCasConnectivityUser.ps1

The first thing you need to do is making sure that the password does meets complexity requirements however if you did and still having the failure you most probably have multiple OUs with name “Users” and that is why the script is failing.

The solution for this is to specify the OU in the command by running the following

get-mailboxServer | .\new-TestCasConnectivityUser.ps1 -OU domain.com/users

I have been working in IT consultancy and solution integration since 1998 and I consider myself lucky to be, one in a few, making a living out of my passion. I am also member of the famous Experts Exchange (profile here) online community where I try my best to share what I have learned along the road.

Posted in Messaging & Collaboration Tagged with: , , , ,
7 comments on “new-TestCasConnectivityUser.ps1 fails with Verify that OU ( Users ) exists
  1. Jay says:

    Thank you. But that backslash in “domain.comusers” alsmost made me pull out my hair…
    Better make that “domain.com/users

  2. Ian Vassallo says:

    I actually got around this issue by adding a line as per below…

    $adSiteGuidLeft13 = $exchangeServer.Site.ObjectGuid.ToString().Replace(“-“,””).Substring(0, 13);
    $UserName = “extest_” + $adSiteGuidLeft13;
    $SamAccountName = “extest_” + $adSiteGuidLeft13;
    $UserPrincipalName =  $SamAccountName + “@” + $exchangeserver.Domain
    > $OrganizationalUnit = $exchangeserver.Domain + “/” + $OrganizationalUnit

  3. Kill says:

    Thanks for finding and sharing, it helps a lot 

  4. Sam says:

    Very, very helpful info. Thanks!!!

Leave a Reply to Ian Vassallo Cancel reply

Your email address will not be published. Required fields are marked *

*