Add-LXC1OrgUser
This cmdlet creates a user account in the Lenovo XClarity One portal.
Note
You cannot pipe objects to this cmdlet.
Syntax
Add-LXC1OrgUser -Email String
-Roles String[]
-InitialPassword SecureString
[-Connection LXC1Connection]
[CommonParameter]
Add-LXC1OrgUser -Email String
-Roles String[]
-IsFederated
[-Connection LXC1Connection]
[CommonParameter]
Parameters
- -Email String
- Specifies the email address of the new user. This must be a valid email address format.
- -Role String[]
- Specifies one or more user roles, separated by a comma.
- userAdmin. Grants user administration privileges.
- hubAdmin. Grants hub administration privileges.
- deviceAdmin. Grants device administration privileges.
NoteYou cannot create an organization owner using this cmdlet. - -InitialPassword SecureString
- Specifies the initial password for the user as a SecureString.
- -IsFederated
- Creates a user account that is federated and authenticated using a federated identity provider; otherwise, the user is authenticated using a local account.
- -Connection LXC1Connection
- Specifies the connection to the XClarity One server. If no connection is specified, the result from the last Connect-LXC1 cmdlet is used.
- CommonParameters
- This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.
Results
Lenovo.XC1.PowerShell.Automation.Data.StatusMessage
This cmdlet returns a StatusMessage object that contains the result of the operation.
Examples
The following example adds a local user account with a single role.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $InitialPassword
)
$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword)
$hostOnprem = "192.0.2.0"
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType onPremises `
-SkipCertificateCheck
$secureInitialPassword = ConvertTo-SecureString $InitialPassword -AsPlainText -Force
$result = Add-LXC1OrgUser -Email "john.doe@example.com" `
-Roles "userAdmin" `
-InitialPassword $secureInitialPassword
$result | Format-List
The following example adds a new federated user account with multiple roles.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $InitialPassword
)
$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword)
$hostOnprem = "192.0.2.0"
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType onPremises `
-SkipCertificateCheck
$secureInitialPassword = ConvertTo-SecureString $InitialPassword -AsPlainText -Force
$result = Add-LXC1OrgUser -Email "jane.smith@example.com" `
-Roles "hubAdmin","deviceAdmin" `
-IsFederated
$result | Format-List
Give documentation feedback