< Back
New-GoogleDirectoryRoleAssignment
Post
NAME New-GoogleDirectoryRoleAssignment
SYNOPSIS
Creates a new GSuite role assignment.
SYNTAX
New-GoogleDirectoryRoleAssignment [-RoleId] <String> [-UserId] <String> [-ScopeType <String>] [-CustomerId
<String>] -BearerToken <String> [-UseCompression] [-PassThru] [<CommonParameters>]
New-GoogleDirectoryRoleAssignment [-RoleId] <String> [-UserId] <String> [-ScopeType <String>] [-CustomerId
<String>] [-ProfileLocation <String>] [-Persist] [-UseCompression] [-PassThru] [<CommonParameters>]
DESCRIPTION
This cmdlet assigns a role to a user.
PARAMETERS
-RoleId <String>
The id of the role to which the user will be assigned.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UserId <String>
The id of the user who will be assigned to the role.
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ScopeType <String>
The scope of the assignment.
Required? false
Position? named
Default value CUSTOMER
Accept pipeline input? false
Accept wildcard characters? false
-CustomerId <String>
If you are an administrator creating a role assignment in your own domain, use my_customer as the customer ID.
This is the default.
If you are reseller creating a role assignment for one of your customers, use the customer ID returned by the
Retrieve a user operation.
Required? false
Position? named
Default value my_customer
Accept pipeline input? false
Accept wildcard characters? false
-BearerToken <String>
The bearer token to use to authenticate the request.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ProfileLocation <String>
The location where stored credentials are located. If this is not specified, the default location will be used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Persist [<SwitchParameter>]
Indicates that the newly retrieved token(s) or refreshed token and associated client data like client secret
are persisted to disk.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-UseCompression [<SwitchParameter>]
If specified, the returned data is compressed using gzip.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Required? false
Position? named
Default value False
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
None
OUTPUTS
None or System.Collections.Hashtable
This is a JSON representation of the output:
{
"kind": "admin\\#directory\\#roleAssignment",
"etag": "\\"sxH3n22L0-77khHtQ7tiK6I21Yo/VdrrUEz7GyXqlr9I9JL0wGZn8yE\\"",
"roleAssignmentId": "3894208461013211",
"roleId": "3894208461012995",
"assignedTo": "100662996240850794412",
"scopeType": "CUSTOMER"
}
NOTES
AUTHOR: Michael Haken
LAST UPDATE: 2/20/2018
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$RoleAssignment = New-GoogleDirectoryRoleAssignment -RoleId "3894208461012995" -UserId
"100662996240850794412" -ClientId $Id -Persist -UseCompression -PassThru
This examples assigns the specified role to the specified user and returns the response to the pipeline.
RELATED LINKS
SYNOPSIS
Creates a new GSuite role assignment.
SYNTAX
New-GoogleDirectoryRoleAssignment [-RoleId] <String> [-UserId] <String> [-ScopeType <String>] [-CustomerId
<String>] -BearerToken <String> [-UseCompression] [-PassThru] [<CommonParameters>]
New-GoogleDirectoryRoleAssignment [-RoleId] <String> [-UserId] <String> [-ScopeType <String>] [-CustomerId
<String>] [-ProfileLocation <String>] [-Persist] [-UseCompression] [-PassThru] [<CommonParameters>]
DESCRIPTION
This cmdlet assigns a role to a user.
PARAMETERS
-RoleId <String>
The id of the role to which the user will be assigned.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-UserId <String>
The id of the user who will be assigned to the role.
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ScopeType <String>
The scope of the assignment.
Required? false
Position? named
Default value CUSTOMER
Accept pipeline input? false
Accept wildcard characters? false
-CustomerId <String>
If you are an administrator creating a role assignment in your own domain, use my_customer as the customer ID.
This is the default.
If you are reseller creating a role assignment for one of your customers, use the customer ID returned by the
Retrieve a user operation.
Required? false
Position? named
Default value my_customer
Accept pipeline input? false
Accept wildcard characters? false
-BearerToken <String>
The bearer token to use to authenticate the request.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ProfileLocation <String>
The location where stored credentials are located. If this is not specified, the default location will be used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Persist [<SwitchParameter>]
Indicates that the newly retrieved token(s) or refreshed token and associated client data like client secret
are persisted to disk.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-UseCompression [<SwitchParameter>]
If specified, the returned data is compressed using gzip.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PassThru [<SwitchParameter>]
Required? false
Position? named
Default value False
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
None
OUTPUTS
None or System.Collections.Hashtable
This is a JSON representation of the output:
{
"kind": "admin\\#directory\\#roleAssignment",
"etag": "\\"sxH3n22L0-77khHtQ7tiK6I21Yo/VdrrUEz7GyXqlr9I9JL0wGZn8yE\\"",
"roleAssignmentId": "3894208461013211",
"roleId": "3894208461012995",
"assignedTo": "100662996240850794412",
"scopeType": "CUSTOMER"
}
NOTES
AUTHOR: Michael Haken
LAST UPDATE: 2/20/2018
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$RoleAssignment = New-GoogleDirectoryRoleAssignment -RoleId "3894208461012995" -UserId
"100662996240850794412" -ClientId $Id -Persist -UseCompression -PassThru
This examples assigns the specified role to the specified user and returns the response to the pipeline.
RELATED LINKS