Created
August 5, 2016 08:57
-
-
Save chelnak/3aea67312d35a067d12ab6737aac2ed3 to your computer and use it in GitHub Desktop.
Create a vRA tenant with a local user and add a directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- Create the tenant | |
New-vRATenant -Name Tenant01 -Description "This is tenant 01" -URLName tenant01 -ContactEmail tenantadmin@company.com -ID tenant01 | |
# --- Create a local user | |
New-vRAUserPrincipal -PrincipalId tenantadmin@vsphere.local -Tenant Tenant01 -FirstName tenant -LastName admin -EmailAddress tenantadmin@company.com -Description "Tenant admin local user" -Password password123 | |
# --- Add local user as a tenant and iaas admin | |
Add-vRAPrincipalToTenantRole -TenantId Tenant01 -PrincipalId tenantadmin@vsphere.local -RoleId CSP_TENANT_ADMIN | |
Add-vRAPrincipalToTenantRole -TenantId Tenant01 -PrincipalId tenantadmin@vsphere.local -RoleId COM_VMWARE_IAAS_IAAS_ADMINISTRATOR | |
# --- Add a directory to the new tenant | |
$JSON = @" | |
{ | |
"name" : "Tenant01", | |
"description" : "Tenant01", | |
"alias" : "", | |
"type" : "AD", | |
"userNameDn" : "CN=svc_account,OU=Users,OU=Tenant01,OU=Tenants,DC=corp,DC=local", | |
"groupBaseSearchDn" : "OU=Tenant01,OU=Tenants,DC=corp,DC=local", | |
"password" : "P@ssword!", | |
"url" : "ldap://dc01.corp.local:389", | |
"userBaseSearchDn" : "OU=Tenant01,OU=Tenants,DC=corp,DC=local", | |
"domain" : "corp.local", | |
"domainAdminUsername" : "", | |
"domainAdminPassword" : "", | |
"subdomains" : [ "" ], | |
"groupBaseSearchDns" : [ "OU=Tenant01,OU=Tenants,DC=corp,DC=local" ], | |
"userBaseSearchDns" : [ "OU=Tenant01,OU=Tenants,DC=corp,DC=local" ], | |
"certificate" : "", | |
"trustAll" : true, | |
"useGlobalCatalog" : false | |
} | |
"@ | |
$JSON | New-vRATenantDirectory -ID Tenant01 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment