Get-CimInstance -ClassName Win32_Group -filter '"name=administrators"'

This topic contains 2 replies, has 3 voices, and was last updated by  Noam lesnik 2 years, 7 months ago.

  • Author
  • #32433

    Srikanth Byram

    hi all,

    this get-Ciminstance takes longer time to pull the data both from powershell.exe and ISE

    am running this cmdlet from local machine from which i required the data .

    operating system : windows 8.1 pro ;64-bit

    required help on this

  • #32437

    Dave Wyatt

    Is your computer joined to a domain? Win32_Group and similar classes enumerate both local and domain accounts / groups, so they can take a while.

  • #32439

    Noam lesnik

    If you specify that you are looking for a local group it goes much faster, like this:

    Get-CimInstance -Query "select * from win32_group where Domain='$env:COMPUTERNAME' and Name='Administrators'"

You must be logged in to reply to this topic.