FilterScope Parameter (Connect-Salesforce Cmdlet)
Specifies an optional scope to limit the records returned in queries using Salesforce's USING SCOPE keyword.
Syntax
Connect-Salesforce -FilterScope string
Possible Values
None, Delegated, Everything, Mine, MineAndMyGroups, My_Territory, My_Team_Territory, TeamData Type
cstr
Default Value
"None"
Remarks
When executing SOQL queries, this property appends the "USING SCOPE" keyword, restricting query results based on the selected filter scope. This helps refine queries by limiting records to those most relevant to the user's role and visibility settings in Salesforce.
For example, if FilterScope is set to Mine, the query retrieves only records owned by the currently authenticated user: SELECT Id, Name FROM Account USING SCOPE Mine
If FilterScope is set to MineAndMyGroups, the query expands the results to include records owned by both the user and any groups they belong to.
Using FilterScope can improve query performance by reducing the number of records returned, particularly in large datasets. However, you should ensure that you select an appropriate scope, as overly restrictive settings may omit necessary records from query results.
This property is useful when working in multi-user environments, helping users retrieve records relevant to their role, team, or assigned territories.