< Back

Get-PRoles

Sat Jan 18, 2020 7:28 pm

NAME Get-PRoles



SYNOPSIS

Returns all active roles for a particular person (or the current users if no person_id is specified).





SYNTAX

Get-PRoles [-PopuliUri] <String> [-PopuliAuthkey] <String> [-PersonId <Int32>] [<CommonParameters>]





DESCRIPTION

To get a list of all possible roles (not just those attached to this person), see Get-PAvailableRoles





PARAMETERS

-PopuliUri <String>

Set to the correct URL for your college (i.e. https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/).

This parameter is required.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PopuliAuthkey <String>

The authentication key with necessary permissions for the data you are requesting.

This parameter is required.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PersonId <Int32>

The numeric ID of the person whose roles you wish to retrieve. If not specified, the roles for the logged-in

user will be returned.



Required? false

Position? named

Default value 0

Accept pipeline input? true (ByValue, ByPropertyName)

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



OUTPUTS

Returns PowerShell objects:

RoleId

RoleName

Inactive (1=Yes / 0=No)





NOTES





Author: Matthew Rehm

Creation Date: 02/14/2019



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



Get-PRoles -PopuliUri 'https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/ -PopuliAuthkey '1234567890' -PersonId

'7856690'













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Search-PPeople @PopuliCredentials -SearchTerm "Test User" -Limit 1 | Get-PRoles @PopuliCredentials













-------------------------- EXAMPLE 3 --------------------------



PS C:\\>#Store your Populi Credentials in a hash table:



$PopuliCredentials = @{

PopuliURI = https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/

PopuliAuthkey = '1ReallyLongAlphaNumericSequence'

}

Get-PRoles @PopuliCredentials











RELATED LINKS