< Back

New-vRAUserPrincipal

Sat Jan 18, 2020 10:03 pm

NAME New-vRAUserPrincipal



SYNOPSIS

Create a vRA local user principal





SYNTAX

New-vRAUserPrincipal -PrincipalId <String> [-Tenant <String>] -FirstName <String> -LastName <String> -EmailAddress

<String> [-Description <String>] -Password <SecureString> [-WhatIf] [-Confirm] [<CommonParameters>]



New-vRAUserPrincipal [-Tenant <String>] -FirstName <String> -LastName <String> -EmailAddress <String>

[-Description <String>] -Credential <PSCredential> [-WhatIf] [-Confirm] [<CommonParameters>]



New-vRAUserPrincipal -JSON <String> [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Create a vRA Principal (user)





PARAMETERS

-PrincipalId <String>

Principal id in user@company.com format



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tenant <String>

The tenant of the user



Required? false

Position? named

Default value $Global:vRAConnection.Tenant

Accept pipeline input? false

Accept wildcard characters? false



-FirstName <String>

First Name



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LastName <String>

Last Name



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EmailAddress <String>

Email Address



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

Users text description



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Password <SecureString>

Users password



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

Credential object



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-JSON <String>

Body text to send in JSON format



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String.

System.SecureString

Management.Automation.PSCredential





OUTPUTS

System.Management.Automation.PSObject





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$SecurePassword = ConvertTo-SecureString ???????P@ssword??????? -AsPlainText -Force



New-vRAUserPrincipal -Tenant vsphere.local -FirstName "Test" -LastName "User" -EmailAddress "user@company.com"

-Description "a description" -Password $SecurePassword -PrincipalId "user@vsphere.local"









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-vRAUserPrincipal -Tenant vsphere.local -FirstName "Test" -LastName "User" -EmailAddress

"user@company.com" -Description "a description" -Credential (Get-Credential)













-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$JSON = @"



{

"locked": "false",

"disabled": "false",

"firstName": "Test",

"lastName": "User",

"emailAddress": "user@company.com",

"description": "no",

"password": "password123",

"principalId": {

"domain": "vsphere.local",

"name": "user"

},

"tenantName": "Tenant01",

"name": "Test User"

}

"@



$JSON | New-vRAUserPrincipal











RELATED LINKS