< Back

Get-GoogleDirectoryUserList

Mon Jan 13, 2020 10:39 pm

NAME Get-GoogleDirectoryUserList



SYNOPSIS

Gets a list of user account details.





SYNTAX

Get-GoogleDirectoryUserList [-MaxResults <UInt32>] -Domain <String> [-ShowDeleted] [-ProfileLocation <String>]

[-Persist] [-UseCompression] [<CommonParameters>]



Get-GoogleDirectoryUserList [-MaxResults <UInt32>] -Domain <String> [-ShowDeleted] -BearerToken <String>

[-UseCompression] [<CommonParameters>]



Get-GoogleDirectoryUserList [-MaxResults <UInt32>] -CustomerId <String> [-OrderBy <String>] [-SortOrder <String>]

[-Query <String>] [-ShowDeleted] [-ProfileLocation <String>] [-Persist] [-UseCompression] [<CommonParameters>]



Get-GoogleDirectoryUserList [-MaxResults <UInt32>] -CustomerId <String> [-OrderBy <String>] [-SortOrder <String>]

[-Query <String>] [-ShowDeleted] -BearerToken <String> [-UseCompression] [<CommonParameters>]



Get-GoogleDirectoryUserList [-MaxResults <UInt32>] [-OrderBy <String>] [-SortOrder <String>] [-Query <String>]

[-ShowDeleted] [-ProfileLocation <String>] [-Persist] [-UseCompression] [<CommonParameters>]



Get-GoogleDirectoryUserList [-MaxResults <UInt32>] [-OrderBy <String>] [-SortOrder <String>] [-Query <String>]

[-ShowDeleted] -BearerToken <String> [-UseCompression] [<CommonParameters>]





DESCRIPTION

This cmdlet retrieves all users in a domain or for a specific customer Id. By default, the customer Id for the

current administrator is used and 100 results are returned per API call in alphabetical order of the user's email

address.



The cmdlet will continue to make API calls on your behalf until all user accounts are retrieved. This can be a lot

of data

and the use of the -UseCompression parameter is highly suggested.





PARAMETERS

-MaxResults <UInt32>

The maximum number of results returned in a single call. Specifying a non-zero value for this parameter will

page

the results so that multiple HTTP calls are made to retrieve all of the results. This defaults to 100.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Domain <String>

Retrieves all users for this sub-domain.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-CustomerId <String>

Retrieves all users in the account for this customer. This is the default and uses the value my_customer, which

represents the customer id of the administrator making the API call.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OrderBy <String>

Specifies the property used to order the results. This defaults to email.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SortOrder <String>

If an OrderBy property is specified, then this specifies the order the results are sorted in. If an OrderBy

property

is not specified, this property is ignored.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Query <String>

The optional query query string allows searching over many fields in a user profile, including both core and

custom fields.

See https://developers.google.com/admin-sdk ... arch-users for examples.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ShowDeleted [<SwitchParameter>]

If this is specified, users deleted within the last 5 days are shown instead of non-deleted users.



Required? false

Position? named

Default value False

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

System.Collections.Hashtable[]





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 2/12/2018



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



PS C:\\>$Users = Get-GoogleDirectoryUserList -ClientId $Id -Persist -UseCompression



Gets all users in the same account as the administrator making the call. The results are compressed in flight.











RELATED LINKS