< Back

Add-CrmSecurityRoleToTeam

Sat Jan 18, 2020 3:57 pm

NAME Add-CrmSecurityRoleToTeam



SYNOPSIS

Assigns a security role to a team.





SYNTAX

Add-CrmSecurityRoleToTeam [-conn <CrmServiceClient>] [-TeamRecord] <PSObject> [[-SecurityRoleRecord] <PSObject>]

[[-SecurityRoleName] <String>] [<CommonParameters>]



Add-CrmSecurityRoleToTeam [-conn <CrmServiceClient>] [-TeamId] <String> [[-SecurityRoleId] <String>]

[[-SecurityRoleName] <String>] [<CommonParameters>]





DESCRIPTION

The Add-CrmSecurityRoleToTeam cmdlet lets you assign a security role to a team.



There are two ways to specify records.



1. Pass record's Id for both records.

2. Get a record object by using Get-CrmRecord/Get-CrmRecords cmdlets, and pass it for both records.





PARAMETERS

-conn <CrmServiceClient>

A connection to your CRM organization. Use $conn = Get-CrmConnection <Parameters> to generate it.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TeamRecord <PSObject>

A team record object which is obtained via Get-CrmRecord/Get-CrmRecords. When you pass CrmRecord, then you

don't use UserId.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SecurityRoleRecord <PSObject>

A security role record object which is obtained via Get-CrmRecord/Get-CrmRecords. When you pass CrmRecord,

then you don't use SecurityRoleId.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SecurityRoleName <String>

A name of security role record



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TeamId <String>

An Id (guid) of team record



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SecurityRoleId <String>

An Id (guid) of security role record



Required? false

Position? 2

Default value

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









OUTPUTS









NOTES









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



Add-CrmSecurityRoleToTeam -conn $conn -TeamId 00005a70-6317-e511-80da-c4346bc43d94 -SecurityRoleId

66005a70-6317-e511-80da-c4346bc43d94



This example assigns the security role to the team by using Id.







-------------------------- Example 2 --------------------------



Add-CrmSecurityRoleToTeam 00005a70-6317-e511-80da-c4346bc43d94 66005a70-6317-e511-80da-c4346bc43d94



This example assigns the security role to the team by using Id by omitting parameters names.

When omitting parameter names, you do not provide $conn, cmdlets automatically finds it.







-------------------------- Example 3 --------------------------



PS C:\\>$team = Get-CrmRecord team 00005a70-6317-e511-80da-c4346bc43d94 name

PS C:\\>$role = Get-CrmRecord role 66005a70-6317-e511-80da-c4346bc43d94 name

PS C:\\>Add-CrmSecurityRoleToTeam $team $role



This example assigns the security role to the team by using record objects.







-------------------------- Example 4 --------------------------



Add-CrmSecurityRoleToUser -conn $conn -TeamId 00005a70-6317-e511-80da-c4346bc43d94 -SecurityRoleName "salesperson"



This example assigns the salesperson role to the team by using Id and role name.









RELATED LINKS