You can connect to vCenter Server using the OAuth2 security context.
Procedure
- To generate an API token in VMware Cloud on AWS GovCloud, navigate to https:// console.cloud-us-gov.vmware.com /csp/gateway/portal/#/user/tokens and click Generate Token URL.
- Connect to VMware Cloud on AWS GovCloud vCenter Server using PowerCLI, create variables:
$govCloudVCenter = "vcenter.sddc-a-b-c-d.vmwarevmcgov.com"
- Create a SAML Security Context from the OAuth2 Security Context from the previous step.
$samlSecurityContext = New-VISamlSecurityContext -OAuthSecurityContext $oauthSecurityContext -VCenterServer $govCloudVCenter
- Connect to VMware Cloud on AWS GovCloud vCenter Server.
Connect-VIServer -Server $govCloudVCenter -SamlSecurityContext $samlSecurityContext
- After a successful connection, run any vSphere PowerCLI cmdlets.