Skip to main content

Update-LXC1OrgUser

This cmdlet updates a specific user in the Lenovo XClarity One portal.

Two update operations are supported, each with their own parameter set.
  • Replace the roles assigned to the user.
  • Change the account status of the user to active or disabled.
Note
You cannot pipe objects to this cmdlet.

Syntax

Update-LXC1OrgUser  -UserID String
-Roles String[]
[-Connection LXC1Connection>
[CommonParameter]

Update-LXC1OrgUser -UserID String
-Status String
[-Connection LXC1Connection]
[CommonParameter]
Parameters
-UserID String
Specifies the unique ID of the user to update.
-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.
Note
You cannot make the user an organization owner using this cmdlet.
-Status String
Specifies one or more user account statuses, separated by a comma.
  • Active. Enables the user account.
  • Disabled. Grants device administration privileges.
-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

Examples

The following example replaces the roles of an organization user.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)

$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

$result = Update-LXC1OrgUser -UserID "a1b2c3d4-e5f6-7890-abcd-ef1234567890" `
-Roles "hubAdmin","deviceAdmin"

$result | Format-List
The following example disables a user.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)

$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

$result = Update-LXC1OrgUser -UserID "a1b2c3d4-e5f6-7890-abcd-ef1234567890" `
-Status "Disabled"

$result | Format-List
The following example looks up a user by email and re-enables their account.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)

$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

$user = Get-LXC1OrgUser -Email "john.doe@example.com" -EmailSearchType equals
$result = Update-LXC1OrgUser -UserID $user.Response.results[0].id `
-Status "Active"

$result | Format-List