< Back

Remove-CrmSecurityRoleFromTeam

Sat Jan 18, 2020 4:05 pm

NAME Remove-CrmSecurityRoleFromTeam



SYNOPSIS

Removes a security role from a team.





SYNTAX

Remove-CrmSecurityRoleFromTeam [-conn <CrmServiceClient>] [-TeamRecord] <PSObject> [-SecurityRoleRecord]

<PSObject> [<CommonParameters>]



Remove-CrmSecurityRoleFromTeam [-conn <CrmServiceClient>] [-TeamId] <String> [-SecurityRoleId] <String>

[<CommonParameters>]





DESCRIPTION

The Set-CrmSecurityRoleToUser cmdlet lets you remove a security role from 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? true

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? true

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 --------------------------



Remove-CrmSecurityRoleFromTeam -conn $conn -TeamId 00005a70-6317-e511-80da-c4346bc43d94 -SecurityRoleId

66005a70-6317-e511-80da-c4346bc43d94



This example removes a security role to a team by using Id.







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



Remove-CrmSecurityRoleFromTeam 00005a70-6317-e511-80da-c4346bc43d94 66005a70-6317-e511-80da-c4346bc43d94



This example removes a security role to a 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:\\>Remove-CrmSecurityRoleFromTeam $team $role



This example removes a security role to a team by using record objects.









RELATED LINKS