The one issue I've found with it is that it gets confused if you have multiple OUs named Users wherever they might reside. Try specifying the OU into which the user is to be created explicitly with the appropriate parameter.
That may not be your problem, however, as this problem results in an error for me.
You do have the source for the script (just open it in Notepad) so you could try executing the commands manually. I've actually modified that script in the past, you almost have to in order to use it as part of an automated build.
Hi Ron,
Agree with Ed, I recommend you refer to the following command to specify the OU:
Get-MailboxServer | .\new-TestCasConnectivityUser.ps1 -OU domain.com/usersBest regards,
Thank you for your help. I think you are correct in that the script needs modification. you are correct, the OU in AD is slightly different. Attempted to alter that and run it. Getting errors that frankly I am not sure how to correct as I am not seeing the error in the code. I am not a scripter so this is a struggle. Here is what I am seeing.
Import-LocalizedData : The following error occurred while Windows PowerShell was loading the 'C:\program
files\Microsoft\Exchange Server\V15\Scripts\en\new-TestCasConnectivityUser.strings.psd1' script data file:
At line:2 char:1
+ ConvertFrom-StringData @'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
Executable script code found in signature block.
.
At C:\program files\Microsoft\Exchange Server\V15\Scripts\new-TestCasConnectivityUser.ps1:166 char:1
+ Import-LocalizedData -BindingVariable new_testcasuser_LocalizedStrings -FileName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-LocalizedData], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.ImportLocalizedData
read-host : name cannot be null or empty.
At C:\program files\Microsoft\Exchange Server\V15\Scripts\new-TestCasConnectivityUser.ps1:238 char:24
+ $securePassword = (read-host -asSecureString $new_testcasuser_LocalizedStrin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Read-Host], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.ReadHostCommand
EX01.domain.local
read-host : name cannot be null or empty.
At C:\program files\Microsoft\Exchange Server\V15\Scripts\new-TestCasConnectivityUser.ps1:46 char:11
+ read-host $new_testcasuser_LocalizedStrings.res_PromptToQuitOrContinue
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Read-Host], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.ReadHostCommand
CreateTestUser : Mailbox could not be created. Verify that OU ( domain.local/users ) exists and that password meets
complexity requirements.
At C:\program files\Microsoft\Exchange Server\V15\Scripts\new-TestCasConnectivityUser.ps1:255 char:13
+ $result = CreateTestUser $exchangeServer $mailboxServer $securePassword $Organ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,CreateTestUser
EX02.domain.local
read-host : name cannot be null or empty.
At C:\program files\Microsoft\Exchange Server\V15\Scripts\new-TestCasConnectivityUser.ps1:46 char:11
+ read-host $new_testcasuser_LocalizedStrings.res_PromptToQuitOrContinue
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Read-Host], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.ReadHostCommand
CreateTestUser : Mailbox could not be created. Verify that OU ( domain.local/users ) exists and that password meets
complexity requirements.
At C:\program files\Microsoft\Exchange Server\V15\Scripts\new-TestCasConnectivityUser.ps1:255 char:13
+ $result = CreateTestUser $exchangeServer $mailboxServer $securePassword $Organ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,CreateTestUser
Not sure if this is too vague. But perhaps I can get a little bit more help with this error. In some ways it seems that Microsoft would have been better off just allowing a test user to be created in the same way as any other user. But what do I know.
Thanks
Thank you for your response. It appears that you and Ed are both on the right track as the script fails. Take a look at my response to Ed for what happened. Perhaps one of you two can help me fix the script.
Thanks
The errors you're seeing don't appear to be the same as what I've suggested.
Have you tried running the script in the Exchange Management Shell run as Administrator? And are the files referenced in the error messages present? You're changing the default directory to C:\Program Files\Microsoft\Exchange Server\V15\Scripts (or wherever you installed Exchange), right?