Remove-LXC1OrgUser
This cmdlet deletes a specific user from the Lenovo XClarity One portal.
Note
You cannot pipe objects to this cmdlet.
Syntax
Remove-LXC1OrgUser -UserID String
[-Connection LXC1Connection>
[CommonParameter]
Parameters
- -UserID String
- Specifies the ID of the user to update.
- -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 removes an organization user by ID.
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 = Remove-LXC1OrgUser -UserID "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
$result | Format-List
The following example retrieves an organization user by email and then removes them.
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 = Remove-LXC1OrgUser -UserID $user.Response.results[0].id
$result | Format-List
Give documentation feedback