< Back
Grant-CrmRecordAccess
Post
NAME Grant-CrmRecordAccess
SYNOPSIS
Grant access privilege to a crm record.
SYNTAX
Grant-CrmRecordAccess [[-conn] <CrmServiceClient>] [-CrmRecord] <PSObject[]> [-Principal] <EntityReference>
[-AccessMask] <AccessRights> [<CommonParameters>]
Grant-CrmRecordAccess [[-conn] <CrmServiceClient>] [-EntityLogicalName] <String> [-Id] <Guid> [-Principal]
<EntityReference> [-AccessMask] <AccessRights> [<CommonParameters>]
DESCRIPTION
The Grant-CrmRecordAccess cmdlet lets you grant a security principal (user or team) access to the specified
record. The operation will create access rights if none already exist, or be additive to any existing access
rights already granted. That is, if a principal has pre-existing access rights to a record, any new access rights
specified in executing this cmdlet are granted and no existing rights are removed. Note that the append right
requires both AppendAccess and AppendToAccess to be specified.
PARAMETERS
-conn <CrmServiceClient>
A connection to your CRM organization. Use $conn = Get-CrmConnection <Parameters> to generate it.
Required? false
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-CrmRecord <PSObject[]>
The record object to grant access to, obtained via Get-CrmRecord/Get-CrmRecords. When you pass CrmRecord, then
you don't use EntityLogicalName/Id.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Principal <EntityReference>
The principal (user or team) being granted access rights to the record. Use New-CrmEntityReference
<Parameters> to generate it.
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AccessMask <AccessRights>
The access rights to grant the principal over the record. Assign multiple values to generate the full value,
e.g. AppendAccess,ReadAccess,WriteAccess.
Required? true
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EntityLogicalName <String>
The logical name of an entity to grant access to, i.e. account, contact, lead, etc.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Id <Guid>
The Id of a record to grant access to.
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 --------------------------
Grant-CrmRecordAccess -conn $conn -CrmRecord $contact -Principal $team -AccessMask
AppendAccess,AppendToAccess,ReadAccess,WriteAccess
This example grants a team append, read, and write access to a contact record.
-------------------------- Example 2 --------------------------
$contact | Grant-CrmRecordAccess -conn $conn -Principal $team -AccessMask ReadAccess,WriteAccess,DeleteAccess
This example pipes a contact to Grant-CrmRecordAccess and grants a team read, write, and delete access to it.
RELATED LINKS
SYNOPSIS
Grant access privilege to a crm record.
SYNTAX
Grant-CrmRecordAccess [[-conn] <CrmServiceClient>] [-CrmRecord] <PSObject[]> [-Principal] <EntityReference>
[-AccessMask] <AccessRights> [<CommonParameters>]
Grant-CrmRecordAccess [[-conn] <CrmServiceClient>] [-EntityLogicalName] <String> [-Id] <Guid> [-Principal]
<EntityReference> [-AccessMask] <AccessRights> [<CommonParameters>]
DESCRIPTION
The Grant-CrmRecordAccess cmdlet lets you grant a security principal (user or team) access to the specified
record. The operation will create access rights if none already exist, or be additive to any existing access
rights already granted. That is, if a principal has pre-existing access rights to a record, any new access rights
specified in executing this cmdlet are granted and no existing rights are removed. Note that the append right
requires both AppendAccess and AppendToAccess to be specified.
PARAMETERS
-conn <CrmServiceClient>
A connection to your CRM organization. Use $conn = Get-CrmConnection <Parameters> to generate it.
Required? false
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? false
-CrmRecord <PSObject[]>
The record object to grant access to, obtained via Get-CrmRecord/Get-CrmRecords. When you pass CrmRecord, then
you don't use EntityLogicalName/Id.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Principal <EntityReference>
The principal (user or team) being granted access rights to the record. Use New-CrmEntityReference
<Parameters> to generate it.
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AccessMask <AccessRights>
The access rights to grant the principal over the record. Assign multiple values to generate the full value,
e.g. AppendAccess,ReadAccess,WriteAccess.
Required? true
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EntityLogicalName <String>
The logical name of an entity to grant access to, i.e. account, contact, lead, etc.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Id <Guid>
The Id of a record to grant access to.
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 --------------------------
Grant-CrmRecordAccess -conn $conn -CrmRecord $contact -Principal $team -AccessMask
AppendAccess,AppendToAccess,ReadAccess,WriteAccess
This example grants a team append, read, and write access to a contact record.
-------------------------- Example 2 --------------------------
$contact | Grant-CrmRecordAccess -conn $conn -Principal $team -AccessMask ReadAccess,WriteAccess,DeleteAccess
This example pipes a contact to Grant-CrmRecordAccess and grants a team read, write, and delete access to it.
RELATED LINKS