Set-SCACUserRole
Set-SCACUserRole
Sets a user role.
構文
Parameter Set: Default
Set-SCACUserRole [-UserRole] <PSObject> [[-AddMembers] <String[]> ] [[-AddScope] <ACUserRoleScope[]> ] [[-RemoveMembers] <String[]> ] [[-RemoveScope] <PSObject[]> ] [-PassThru] [ <CommonParameters>]
詳細説明
The Set-SCACUserRole cmdlet sets a user role. You can add or remove members and scope from the user role. A new user role is not created until you set it with this cmdlet. To create a user role, use the New-SCACUserRole cmdlet.
After you have run Set-SCACuserRole on a user role or user role scope, you cannot run this cmdlet on that user role or user role scope again. To make additional updates, get the property values from the user role or user role scope by using the Get-SCACUserRole cmdlet, and then create a new user role scope with those property values and any additional changes.
パラメーター
-AddMembers<String[]>
Specifies an array of members to add to the user role. You can add a user or group. Use the format domain\name.
エイリアス |
なし |
必須? |
false |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-AddScope<ACUserRoleScope[]>
Specifies a user role scope object. To create a user role scope, use the New-SCACUserRoleScope cmdlet.
エイリアス |
なし |
必須? |
false |
位置は? |
3 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PassThru
Returns a user role object. By default, this cmdlet does not generate output.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-RemoveMembers<String[]>
Specifies an array of members to remove from the user role. You can remove a user or group. Use the format domain\name.
エイリアス |
なし |
必須? |
false |
位置は? |
4 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-RemoveScope<PSObject[]>
Specifies the scope object to remove from the user role.
エイリアス |
なし |
必須? |
false |
位置は? |
5 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-UserRole<PSObject>
Specifies a user role object. To get a user role object, use the Get-SCACUserRole cmdlet.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
Example 1: Add members and a user role scope to a new user role
The first command creates a user role named UserRole01 and stores the user role object in the $UserRole variable.
The second command gets the Windows Azure subscription object named AzureSubscription01 and stores the object in the $AzureSubscription variable
The third command creates a user role scope with the Windows Azure subscription stored in $AzureSubscription and stores the user role scope object in the $UserRoleScope variable.
The last command adds the specified users and the user role scope stored in $UserRoleScope to the user role stored in $UserRole.
PS C:\> $UserRole = New-SCACUserRole -Name "UserRole01" -Description "First user role"
PS C:\> $AzureSubscription = Get-SCACAzureSubscription -Name "AzureSubscription01"
PS C:\> $UserRoleScope = New-SCACUserRoleScope -AzureCloud $AzureSubscription
PS C:\> Set-SCACUserRole -UserRole $UserRole -AddMembers "Contoso\ReneeLo","Contoso\NevenSokec" -AddScope $UserRoleScope
Example 2: Remove a member from an existing user role
The first command gets the user role object named UserRole01 and stores the object in the $UserRole variable.
The second command removes the specified member from the user role stored in $UserRole.
PS C:\> $UserRole = Get-SCACUserRole -Name "UserRole01" -Managed
PS C:\> Set-SCACUserRole -UserRole $UserRole -RemoveMembers "Contoso\ReneeLo"