Get-QADUser vs Get-ADUser

I'm just wondering why there seems to be such a massive performance difference between the Get-QADuser and Get-ADuser.  I know the QAD commands return a lot more data and I have to use them when I need access to the virtual attributes defined in my environment but the speed difference is a millennium apart.  

This takes 6 seconds - measure-command { Get-ADUser    -LdapFilter '(&(sAMAccountType=805306368)(!(|(userAccountControl:1.2.840.113556.1.4.803:=2)(employeeID=*)(employeeNumber=*))))' }  
This takes 2 minutes  - measure-command { Get-QADUser -LdapFilter '(&(sAMAccountType=805306368)(!(|(userAccountControl:1.2.840.113556.1.4.803:=2)(employeeID=*)(employeeNumber=*))))'     -proxy -SizeLimit 0 }  

2 minutes seems like a lifetime when debugging :-) 

I've taken to loading the AD commandlets more and more despite feeling that they are somewhat inferior to the Quest commandlets but convincing others that they shoul dbe using them is pretty hard when the first script they write using them runs so sloooooooly.


Parents
  • This code returns a similar base property set to Get-ADUser (you can see the list) and takes 9 MILLISECONDS:

    Measure-Command {

    # Set the searcher query

    $searcher=[adsisearcher]'(&(sAMAccountType=805306368)(!(|(userAccountControl:1.2.840.113556.1.4.803:=2))))'

    # Add the properties we want to return

    $colProplist = "samaccountname","distinguishedname","objectguid","Name"

    foreach ($i in $colPropList) { $searcher.PropertiesToLoad.Add($i) | out-null }

    # Execute the query

    $Users = $searcher.findall()

    }

     

Reply
  • This code returns a similar base property set to Get-ADUser (you can see the list) and takes 9 MILLISECONDS:

    Measure-Command {

    # Set the searcher query

    $searcher=[adsisearcher]'(&(sAMAccountType=805306368)(!(|(userAccountControl:1.2.840.113556.1.4.803:=2))))'

    # Add the properties we want to return

    $colProplist = "samaccountname","distinguishedname","objectguid","Name"

    foreach ($i in $colPropList) { $searcher.PropertiesToLoad.Add($i) | out-null }

    # Execute the query

    $Users = $searcher.findall()

    }

     

Children
No Data