AlfeG
AlfeG

Reputation: 1473

InvalidUserName error when try to add new namespace to ServiceBus using powershell remoting

We have local installation of AzurePack: ServiceBus 1.1 (wpi alias ServiceBus_1_1)

We need to add new namespace to ServiceBus on application deployment.

Here is code that I try to execute from one server:

Invoke-Command -ComputerName some-remote-server -Verbose -ScriptBlock { New-SBNamespace -Name new-sb-namespace -ManageUsers {domain}\{user} }

Here is a response that I receive:

The user name '{domain}\{user}' is invalid.
+ CategoryInfo          : NotSpecified: (vgl:String) [New-SBNamespace], ArgumentException
+ FullyQualifiedErrorId : InvalidUserName,Microsoft.ServiceBus.Commands.NewSBNamespaceCommand
+ PSComputerName        : some-remote-server

I can execute New-SBNamespace -Name new-sb-namespace -ManageUsers {domain}\{user} locally on remote server without any problems

I have tried different combinations of domain/user, different accounts. I can't find any information about why I receive this error.

Same error I'm getting when use Enter-PSSession command and execute New-SBNamespace

Upvotes: 1

Views: 471

Answers (2)

AlfeG
AlfeG

Reputation: 1473

I have found a solution. Using -Authentication Credssp -Credential $credentials have solved issue, but caused a need to supply those credentials in script.

Upvotes: 1

Sam Vanhoutte
Sam Vanhoutte

Reputation: 3451

Can you try

Invoke-Command -ComputerName some-remote-server -Verbose -ScriptBlock { New-SBNamespace -Name new-sb-namespace -ManageUsers {user}@{domain}

So the notation of users/groups should be user@domain

Hope this helps

Upvotes: 0

Related Questions