Powershell Sync Project Filtering

Hi all, 

I have seen that you can add a filter in the ReadConfiguration of the XML file. Has anybody any information how this works? How does the filter have to look like to only read certain objects. Was unable to find any documentation about it. 

<ReadConfiguration>
<ListingCommand Command="Get-DSNRole">
<SetParameter Param="IncludedProperties" Source="FixedArray" Value="sys_id,name,sys_updated_by,sys_updated_on" />
<SetParameter Param="filter" Source="ConnectionParameter" Value="FilterForRoles" />

other example 

<ReadConfiguration>
<ListingCommand Command="Get-ADGroup">
<SetParameter Param="Filter" Source="FixedValue" Value="*" />
</ListingCommand>

I am reading a list of roles. All the roles I read have a parameter id. So I would like to filter like id="My*". I have tried with the option ConnectionParameter and FixedValue but still the connector reads all roles. 

Any help appreciated.

Best regards, 

Andy

  • I think you get it all wrong. SetParameter defines the parameter name of the CMD-let (custom PS-method you have created) and defines how the connector should fill this parameter (FixedValue., from a ConnectionParamter, ...).

    Hence the Filter parameter, you may have seen in the ADSample.XML, is the filter-parameter of the AD-Cmdlet Get-ADGroup.