< Back

Set-iBMCUser

Tue Jan 14, 2020 3:15 am

NAME Set-iBMCUser



SYNOPSIS

Modify an existing iBMC user account's infomation.





SYNTAX

Set-iBMCUser [-Session] <RedfishSession[]> -Username <String[]> [-NewUsername <String[]>] [-NewPassword

<Object[]>] [-NewRole {Administrator | Operator | Commonuser | Noaccess | CustomRole1 | CustomRole2 | CustomRole3

| CustomRole4}] [-Enabled <Boolean[]>] [-Unlocked] [<CommonParameters>]





DESCRIPTION

Modify an existing iBMC user account's infomation. The NewUsername parameter must not exists in all user accounts.



Modify the following properties of a user:

- User name

- Password

- Rights

- Lockout status

- Whether the user is enabled





PARAMETERS

-Session <RedfishSession[]>

iBMC redfish session object which is created by Connect-iBMC cmdlet.

A session object identifies an iBMC server to which this cmdlet will be executed.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Username <String[]>

Username specifies the user to be modified.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NewUsername <String[]>

NewUsername specifies the new username of the modified user.

A string of 1 to 16 characters is allowed. It can contain letters, digits, and special characters (excluding

<>&,'"/\\%), but cannot contain spaces or start with a number sign (#).



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NewPassword <Object[]>

NewPassword specifies the new password of the modified user.



A string of 1 to 20 characters is allowed.

- If password complexity check is enabled for other interfaces, the password must meet password complexity

requirements.

- If password complexity check is not enabled for other interfaces, there is not restriction on the password



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NewRole

NewRole specifies the new role of the modified user.

Available role value set is:

- "Administrator"

- "Operator"

- "Commonuser"

- "Noaccess"

- "CustomRole1"

- "CustomRole2"

- "CustomRole3"

- "CustomRole4"



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Enabled <Boolean[]>

Enabled specifies Whether the user is enabled. A power shell bool($true|$false) value is accept.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Unlocked [<SwitchParameter[]>]

If this switch parameter is $true then the modified user's lockout status is set to false.

If this switch parameter is $false then lockout status will not be modified.



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



OUTPUTS

PSObject[]

Returns the modified User object array if cmdlet executes successfully.

In case of an error or warning, exception will be returned.





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



PS C:\\>Create a user account with name powershell and then modify "username", "password", "role", "Enabled",

"Locked" properties of this user for a single iBMC server



PS C:\\> $credential = Get-Credential

PS C:\\> $session = Connect-iBMC -Address 10.1.1.2 -Credential $credential -TrustCert

PS C:\\> $pwd = ConvertTo-SecureString -String old-user-password -AsPlainText -Force

PS C:\\> Add-iBMCUser $session powershell $pwd 'Administrator'

PS C:\\> $newPwd = ConvertTo-SecureString -String new-user-password -AsPlainText -Force

PS C:\\> $User = Set-iBMCUser -Session $session -Username powershell -NewUsername powershell2 -NewPassword $newPwd

-NewRole Operator -Enabled $true -Unlocked $true

PS C:\\> $User



Host : 10.1.1.2

Id : 12

Name : User Account

UserName : powershell

RoleId : Operator

Locked : True

Enabled : True

Oem : @{Huawei=}









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



PS C:\\>Create a user account with name powershell and then modify the "username", "password", "role" properties of

this user for multiple iBMC servers



PS C:\\> $credential = Get-Credential

PS C:\\> $sessions = Connect-iBMC -Address 10.1.1.2,10.10.10.4 -Credential $credential -TrustCert

PS C:\\> $pwd = ConvertTo-SecureString -String old-user-password -AsPlainText -Force

PS C:\\> Add-iBMCUser -Session $sessions powershell $pwd 'Administrator'

PS C:\\> $newPwd = ConvertTo-SecureString -String new-user-password -AsPlainText -Force

PS C:\\> Set-iBMCUser -Session $sessions -Username powershell -NewUsername powershell2 -NewPassword $newPwd

-NewRole Operator



Host : 10.1.1.2

Id : 12

Name : User Account

UserName : powershell

RoleId : Operator

Locked : True

Enabled : True

Oem : @{Huawei=}









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



PS C:\\>Modify "username", "password", "role" properties of a user with name "username" for multiple iBMC servers



PS C:\\> $credential = Get-Credential

PS C:\\> $sessions = Connect-iBMC -Address 10.1.1.2-3 -Credential $credential -TrustCert

PS C:\\> $newPwd = ConvertTo-SecureString -String new-user-password -AsPlainText -Force

PS C:\\> ,$sessions | Set-iBMCUser -Username username -NewUsername new-user2 -NewPassword $newPwd -NewRole

Administrator



Host : 10.1.1.2

Id : 12

Name : User Account

UserName : powershell

RoleId : Operator

Locked : True

Enabled : True

Oem : @{Huawei=}











RELATED LINKS

https://github.com/Huawei/Huawei-iBMC-Cmdlets



Add-iBMCUser

Get-iBMCUser

Remove-iBMCUser

Connect-iBMC

Disconnect-iBMC