none
Query AD for Surface and get which version RRS feed

  • Question

  • I am having trouble finding out how to query a remote machine for WMIC info

    wmic computersystem get model,name,manufacturer,systemtype -computername BobLaptop

    Locally I can get my info with just 

    wmic computersystem get model,name,manufacturer,systemtype

    can I be pointed on how to query AD for remote machines and further, query for surface model?

    Wednesday, March 28, 2018 3:34 PM

All replies

  • First, I would export a list of computers from AD that you want to query.  You may not want to run this against Servers, IDK.

    I would then use something like this in a ForEach in PS, reading the list of computers exported into the $CN.  I used "localhost" to check the script.

    $CN="localhost"
    gwmi -Namespace root\cimv2 -Class Win32_ComputerSystem -ComputerName $CN | ? {$_.Model -Like "Surface*"} | Format-List Model

    LawsonT


    • Edited by LawsonT Wednesday, March 28, 2018 6:07 PM
    Wednesday, March 28, 2018 6:07 PM
  • I am having trouble finding out how to query a remote machine for WMIC info

    wmic computersystem get model,name,manufacturer,systemtype -computername BobLaptop

    Locally I can get my info with just 

    wmic computersystem get model,name,manufacturer,systemtype

    can I be pointed on how to query AD for remote machines and further, query for surface model?

    wmic /node:computername computersystem get model,name,manufacturer,systemtype

    or

    wmic /node:@file_with_compnames.csv computersystem get model,name,manufacturer,systemtype

    <computername> is the hostname of the target computer..

    You can open wmic and then type in: /node /?
    That will show you the help and examples for usage.


    Don [doesn't work for MSFT, and they're probably glad about that ;]

    Wednesday, March 28, 2018 8:31 PM