< Back

Add-OneLoginUserRole

Sat Jan 18, 2020 6:05 pm

NAME Add-OneLoginUserRole



SYNOPSIS

Adds a role to a OneLogin user





SYNTAX

Add-OneLoginUserRole [<CommonParameters>]





DESCRIPTION

Use Add-OneLoginUserRole to add one or more roles to a OneLogin user. To discover roles to add, use the

Get-OneLoginRole command, and to find roles that the user already belongs to, use Get-OneLoginUserRole.





PARAMETERS

-Identity <>

Specifies the OneLogin user that you'd like to add a role to.



Required? false

Position? named

Default value None

Accept pipeline input? false

Accept wildcard characters? false



-RoleId <>

Specifies the Id of the role you'd like to add.



Required? false

Position? named

Default value None

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

OneLoginUser







OUTPUTS



NOTES









---------- -------------- Example 1 -------------- ----------



PS C:\\> $Role = Get-OneLoginRole -Filter @{name = "Sales"}

PS C:\\> Get-OneLoginUser -Identity 12345678 | Add-OneLoginUserRole -RoleId $Role.id



This example demonstrates how to add a role to a user via the pipeline. Get-OneLoginUser returns a user by Id, and

Add-OneLoginUserRole adds the role "Sales" to that user.



RELATED LINKS

OneLogin roles https://developers.onelogin.com/api-doc ... /get-roles

OneLogin users https://developers.onelogin.com/api-doc ... r-resource