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

Welcome Forums General PowerShell Q&A Get-CimInstance -ClassName Win32_Group -filter '"name=administrators"'

This topic contains 2 replies, has 3 voices, and was last updated by

 
Participant
2 years, 10 months ago.

  • Author
    Posts
  • #32433

    Participant
    Points: 0
    Rank: Member

    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

    Member
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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'"

The topic ‘Get-CimInstance -ClassName Win32_Group -filter '"name=administrators"'’ is closed to new replies.