Open nthaler-mit opened 6 years ago
Did you try single quotes?
Hi Alan,
No luck. Also, the error message is a bit confusing.
> Connect-NSXTProxy -RefreshToken XXXXX -OrgName 'M5 EA - ORG(Free!)' -SDDCName ORG-VMC-VA-EA-M5
A server error occurred: 'com.vmware.vapi.std.errors.unauthorized': . Check $Error[0].Exception.ServerError for more details.
At /Users/USER/Powershell/VMware.VMC.NSXT.psm1:31 char:9
+ $sddc = $sddcService.get($orgId,$sddcId)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], CisServerException
+ FullyQualifiedErrorId : VMware.VimAutomation.Cis.Core.Types.V1.CisServerException
This is not an NSX-T based SDDC](url)
And your using the refresh token from that Org right? The error is unauthorized.
Hi Alan,
That's correct, I have a Refresh Token for the proper org, and the error doesn't show up, within the same powercli session, if I repeat the command but with the open and close parens and bang escaped in the SDDC name.
It appears that the unauthorized error is spurious in this case.
Here's an example, in the same session, using the Get-VMCSDDC commandlet directly...
PS /Users/USER> Connect-VmcServer -RefreshToken XXXX
Server User
------ ----
vmc.vmware.com USER@example.com
PS /Users/USER> Get-VMCSDDC
cmdlet Get-VMCSDDC at command pipeline position 1
Supply values for the following parameters:
Org: M5 EA - ORG \(Free\!\)
Help : @{Documentation=; updated=; user_id=;
updated_by_user_id=; created=; version=;
updated_by_user_name=; user_name=; id=; name=;
sddc_state=; expiration_date=; org_id=; sddc_type=;
provider=; account_link_state=; resource_config=}
user_id : XXXXX
user_name : XXXXX
created : 9/11/18 6:10:28 PM
version : 44
id : XXXXX
updated_by_user_id : XXXXX
updated_by_user_name : vmc-fm@csp.local
updated : 9/19/18 7:30:45 PM
name : ORG-VMC-VA-EA-M5
provider : AWS
... Compared to not being able to find the SDDC name at all if I use single or double quotes (no escaped characters)
PS /Users/USER> Get-VMCSDDC
cmdlet Get-VMCSDDC at command pipeline position 1
Supply values for the following parameters:
Org: 'M5 EA - ORG(Free!)'
// No return data
PS /Users/USER> Get-VMCSDDC
cmdlet Get-VMCSDDC at command pipeline position 1
Supply values for the following parameters:
Org: "M5 EA - ORG(Free!)"
// No return data
Thanks Nathan, will check it out
Quoted SDDC Name w/o character escape:
==
Quoted SDDC Name with character escape: