2
Vote

Group membership extremely slow

description

The group membership command in the Network menu is extremely slow on the servers in my domain. The problem is with the Get-WmiObject Win32_Group | Where-Object filtering mechanism used to get group names. If you switch it to:
Get-WmiObject Win32_Group -filter "LocalAccount=1"
it returns instantaneously. It turns out that Win32_Group will enumerate all the groups it can see in the domain, and the where-object has to filter through all of that. Adding the -filter at the get-wmiobject level performs the filtering within WMI which is much quicker.

comments

AlxD wrote Oct 16, 2010 at 8:19 PM

BTW in the same function SID of the "Administrators"'s group must be checked. Not the name.

wrote Feb 22, 2013 at 12:07 AM