< Back

Get-CrmRecords

Sat Jan 18, 2020 4:00 pm

NAME Get-CrmRecords



SYNOPSIS

Retrieves CRM records by using single filter condition.





SYNTAX

Get-CrmRecords [-conn <CrmServiceClient>] [-EntityLogicalName] <String> [[-FilterAttribute] <String>]

[[-FilterOperator] <String>] [[-FilterValue] <String>] [[-Fields] <String[]>] [[-AllRows] <SwitchParameter>]

[[-TopCount] <Int32>] [<CommonParameters>]





DESCRIPTION

The Get-CrmRecords cmdlet lets you retrieve CRM records by using single filter condition. It my return more than a

record.

You can specify condition operator by using PowerShell operator like "eq", "ne", "lt", "like", etc.



You can specify desired fields as fieldname1,fieldname2,fieldname3 syntax or * to retrieve all fields (not

recommended for performance reason.)

You can use Get-CrmEntityAttributes cmdlet to see all fields logicalname. The retrieved data can be passed to

several cmdlets like Set-CrmRecord, Removed-CrmRecord to further process it.





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



-EntityLogicalName <String>

A logicalname for an Entity to retrieve. i.e.)account, contact, lead, etc..



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FilterAttribute <String>

A field logical name for filtering.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FilterOperator <String>

An condition operator like "eq", "ne", "lt", "like", etc.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FilterValue <String>

A field value for filtering



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Fields <String[]>

A List of field logicalnames. Use "fieldname1, fieldname2, fieldname3" syntax to speficy Fields, or ues "*" to

retrieve all fields (not recommended for performance reason.)



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AllRows [<SwitchParameter>]

By default the first 5000 rows are returned, this switch will bring back all results regardless of how many



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TopCount <Int32>





Required? false

Position? 7

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



Get-CrmRecords -conn $conn -EntityLogicalName account -FilterAttribute name -FilterOperator "eq" -FilterValue

"Adventure Works (sample)" -Fields name,accountnumber



This example retrieves account(s) which name is "Adventure Works (sample)", with specified fields.







Key Value

--- -----

CrmRecords {@{name_Property=[name, Adventure Works (sample)]; name=A...

Count 5

PagingCookie <cookie page="1"><accountid last="{1FF8D93D-1F18-E511-80D...

NextPage False



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



Get-CrmRecords account name "like" "%(sample)%" name,accountnumber -AllRows



This example retrieves account(s) which name includes "sample", with specified fields by omitting parameter names.

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







Key Value

--- -----

CrmRecords {@{name_Property=[name, Adventure Works (sample)]; name=A...

Count 5

PagingCookie <cookie page="1"><accountid last="{1FF8D93D-1F18-E511-80D...

NextPage False





RELATED LINKS