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

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of Noam lesnik Noam lesnik 10 months, 4 weeks ago.

  • Author
  • #32433
    Profile photo of Srikanth Byram
    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
    Profile photo of Dave Wyatt
    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
    Profile photo of Noam lesnik
    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.