How to utilize filters and or wildcards with Get-WMIObject

Home Forums Scripting PowerShell How to utilize filters and or wildcards with Get-WMIObject

This topic contains 1 reply, has 1 voice, and was last updated by  12man 1 week, 2 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • 12man
    Participant
    #610022

    Group,

    I have been trying to utilize wildcards or filters in conjunction with Get-WMIObject.

    The goal is to run a one liner against multiple clients without providing a list or file to run against.

    As a single target it works with this type of  syntax

    Get-WMIObject -computername ‘pcname’

    I have yet to google the appropriate way to format.

    examples of directions I have tried (multiple changes on each)

    (Get-WmiObject -computername $_.name [pc_name%] -Filter Win32_UserProfile)

    (Get-WMIObject {$_.computername -Like “*PC_name*”})

     

    Is what I am trying to do possible?

     

    Thanks in advance

     

     

     

     

     

     


    12man
    Participant
    #610025

    Disregard the ask–

    Due to restrictions in the environment- I cannot run Get-ADComputer   / Get-WMIObject the way that is required

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.