adsi provider returns too many attributes

I've raised a support case for this, but thought I would also ask here in case someone has a fix.

I've been trying to work out why some queries cause high CPU consumption for the ARS service and sometimes cause it to max out at 100%, it's happening for a fairly simple queries and I've noticed that the ARS adsi provider returns many attributes even though I haven't specified any of them.

The following code returns 20 attributes that haven't been defined in PropertiesToLoad, only userPrincipalName and adspath should be included.

        $searcher = [adsisearcher]"(&(sAMAccountType=805306368)(!userAccountControl:1.2.840.113556.1.4.803:=2))"
        $searcher.SearchRoot = "EDMS://DC=somewhere,DC=local"
        $searcher.PropertyNamesOnly = $true
        $properties = @(
            'userPrincipalName'
        )
        foreach ($prop in $properties) {
            [void]$searcher.PropertiesToLoad.Add($prop)
        }

         $searcher.findall()[0].Properties

If I use LDAP instead of EDMS, I get just the attribute defined in PropertiesToLoad:

        $searcher = [adsisearcher]"(&(sAMAccountType=805306368)(!userAccountControl:1.2.840.113556.1.4.803:=2))"
        $searcher.SearchRoot = "LDAP://DC=somewhere,DC=local"
        $searcher.PropertyNamesOnly = $true
        $properties = @(
            'userPrincipalName'
        )
        foreach ($prop in $properties) {
            [void]$searcher.PropertiesToLoad.Add($prop)
        }

         $searcher.findall()[0].Properties

We are using ARS 8.1.3.

Has anyone else come across this before? Is there a known fix?

Parents Reply
  • Thanks for the suggestion, I just tried it but sadly it didn't help.  I've also tried using $searcher.PropertiesToLoad.Remove() for each property I don't want.

    Interestingly, $searcher.PropertiesToLoad only includes the properties I define, but $searcher.findall()[0].Properties includes many other properties.

Children