Get-VSTeamUserEntitlement
SYNOPSIS
Get User Entitlement for a user, or a paged list of users matching the specified filter
Please note that Filter, Name, UserType and License parameters only works when MemberEntitlementManagement module version is 6.0 or upper In the same way Top and Skip paramerers only works up to version 5.1
You can setup the specific version for the MemberEntitlementManagement calling Set-VSTeamAPIVersion -Service MemberEntitlementManagement -Version VersionNumberYouNeed.
SYNTAX
List (Default)
Get-VSTeamUserEntitlement [-Top <Int32>] [-Skip <Int32>] [-Select <String[]>] [<CommonParameters>]
PagedParams
Get-VSTeamUserEntitlement [-Select <String[]>] [-MaxPages <Int32>] [-LicenseId <String>] [-UserType <String>]
[-Name <String>] [<CommonParameters>]
PagedFilter
Get-VSTeamUserEntitlement [-Select <String[]>] [-MaxPages <Int32>] [-Filter <String>] [<CommonParameters>]
ByID
Get-VSTeamUserEntitlement [-Id <String[]>] [<CommonParameters>]
DESCRIPTION
Get User Entitlement for a user, or a paged list of users matching the specified filter
EXAMPLES
Example 1: Get user by Id
Get-VSTeamUserEntitlement -Id f1ef22eb-5dd6-4e26-907c-986a0311b106
This command gets the user entitlement of the user identified by id.
Example 2: Get users by name
Get-VSTeamUserEntitlement -Name username
This command gets a list of users which mail or user name contains 'username'. Filtering by Name, License, or UserType is available only when MemberEntitlementManagement service version is 6.0 or upper. See Get-VSTeamAPIVersion and Set-VSTeamAPIVersion commands
Example 3: Filter with some conditions
Get-VSTeamUserEntitlement -Filter "licenseId eq 'Account-Express' and licenseStatus eq 'Disabled'"
This command gets a list of users that match the license status and license type conditions. The -Filter parameter is available only when MemberEntitlementManagement service version is 6.0 or upper. See Get-VSTeamAPIVersion and Set-VSTeamAPIVersion commands
Example 4: List paged users
Get-VSTeamUserEntitlement -Skip 100 -Top 100
This command list the from the user in the 101 position, the next 100 users Filtering using the -Top -Skip parameters only works when MemberEntitlementManagement service version is below 6.0. See Get-VSTeamAPIVersion and Set-VSTeamAPIVersion commands
PARAMETERS
-Skip
The number of items to skip.
Type: Int32
Parameter Sets: List
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Id
The id of the user to retrieve.
Type: String[]
Parameter Sets: ByID
Aliases: UserId
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Top
Specifies the maximum number to return.
Type: Int32
Parameter Sets: List
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Select
Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are:
- Projects
- Extensions
- GroupRules
Type: String[]
Parameter Sets: List, PagedParams, PagedFilter
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MaxPages
User entlitement API returs a paged result. This parameter allows to limit the number of pages to be retrieved. Default is 0 = all pages.
Type: Int32
Parameter Sets: PagedParams, PagedFilter
Aliases:
Required: False
Position: Named
Default value: $null
Accept pipeline input: False
Accept wildcard characters: False
-Filter
Equality operators relating to searching user entitlements seperated by and clauses. Valid filters include: licenseId, licenseStatus, userType, and name.
licenseId: filters based on license assignment using license names. i.e. licenseId eq 'Account-Stakeholder' or licenseId eq 'Account-Express'.
licenseStatus: filters based on license status. currently only supports disabled. i.e. licenseStatus eq 'Disabled'. To get disabled basic licenses, you would pass (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')
userType: filters off identity type. Suppored types are member or guest i.e. userType eq 'member'.
name: filters on if the user's display name or email contians given input. i.e. get all users with "test" in email or displayname is "name eq 'test'".
A valid query could be: (licenseId eq 'Account-Stakeholder' or (licenseId eq 'Account-Express' and licenseStatus eq 'Disabled')) and name eq 'test' and userType eq 'guest'.
Currently, filter names and values must match exactly the case. i.e.: * LicenseID will throw Invalid filter message.
- licenseId eq 'account-stakeholder' will return an empty list
Type: String
Parameter Sets: PagedFilter
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-LicenseId
Filters based on license id.
The acceptable values for this parameter are: - Account-Stakeholder (Stakeholder)
- Account-Express (Basic)
- Account-Advanced (Basic + Test Plans)
Type: String
Parameter Sets: PagedParams
Aliases: License
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-UserType
Filters based on user type
The acceptable values for this parameter are: - member
- guest
Parameter values are case sensitive
Type: String
Parameter Sets: PagedParams
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name
Filters on if the user's display name or email contains given input
Type: String
Parameter Sets: PagedParams
Aliases: Mail, UserName
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Prerequisites:
Set the account and version that all calls will use with Set-VSTeamAccount. Default version sets to API version 3.0 (TFS2017) if not manually set.
tips:
- check called version of the API with Get-VSTeamAPIVersion or Get-VSTeamInfo
- use Set-VSTeamDefaultProject to set default project for every call
- use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls.
- use Profiles to load an account and the correct version