< Back
Add-GoogleDirectoryGroupMember
Post
NAME Add-GoogleDirectoryGroupMember
SYNOPSIS
Adds a member GSuite group.
SYNTAX
Add-GoogleDirectoryGroupMember -GroupKey <String> [-Role <String>] -UserId <String> -BearerToken <String>
[-UseCompression] [<CommonParameters>]
Add-GoogleDirectoryGroupMember -GroupKey <String> [-Role <String>] -UserId <String> [-ProfileLocation <String>]
[-Persist] [-UseCompression] [<CommonParameters>]
DESCRIPTION
This cmdlet adds a member to a GSuite group.
PARAMETERS
-GroupKey <String>
The unique Id of the group.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Role <String>
The role to add the member as, either MEMBER, OWNER, or MANAGER. The default is MEMBER.
Required? false
Position? named
Default value MEMBER
Accept pipeline input? false
Accept wildcard characters? false
-UserId <String>
The Id of the user to add to the group.
Required? true
Position? named
Default value
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
<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 an example of the member's membership information output:
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MEMBER",
"type": "GROUP"
}
NOTES
AUTHOR: Michael Haken
LAST UPDATE: 2/12/2018
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$MembershipInfo = Add-GoogleDirectoryGroupMember -GroupKey NNN -UserId user@google.com -ClientId $Id
-Persist -PassThru
This example adds user@google.com to the group identified by NNN and returns the user's membership info for the
group to
the pipeline. The call is authenticated with an access token stored in a client profile, which is refreshed if
necessary.
Any updated tokens are persisted to disk.
RELATED LINKS
SYNOPSIS
Adds a member GSuite group.
SYNTAX
Add-GoogleDirectoryGroupMember -GroupKey <String> [-Role <String>] -UserId <String> -BearerToken <String>
[-UseCompression] [<CommonParameters>]
Add-GoogleDirectoryGroupMember -GroupKey <String> [-Role <String>] -UserId <String> [-ProfileLocation <String>]
[-Persist] [-UseCompression] [<CommonParameters>]
DESCRIPTION
This cmdlet adds a member to a GSuite group.
PARAMETERS
-GroupKey <String>
The unique Id of the group.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Role <String>
The role to add the member as, either MEMBER, OWNER, or MANAGER. The default is MEMBER.
Required? false
Position? named
Default value MEMBER
Accept pipeline input? false
Accept wildcard characters? false
-UserId <String>
The Id of the user to add to the group.
Required? true
Position? named
Default value
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
<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 an example of the member's membership information output:
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MEMBER",
"type": "GROUP"
}
NOTES
AUTHOR: Michael Haken
LAST UPDATE: 2/12/2018
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$MembershipInfo = Add-GoogleDirectoryGroupMember -GroupKey NNN -UserId user@google.com -ClientId $Id
-Persist -PassThru
This example adds user@google.com to the group identified by NNN and returns the user's membership info for the
group to
the pipeline. The call is authenticated with an access token stored in a client profile, which is refreshed if
necessary.
Any updated tokens are persisted to disk.
RELATED LINKS