Share via

PowerShell Workstation Info

WhillyWonka 21 Reputation points
2021-12-06T20:17:23.68+00:00

Trying to retrieve all workstations within a specific OU and list information exactly like the command below outputs.

$x = read-host -prompt "Please enter the machine name:"
get-wmiobject -computername $x -class win32_bios

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

2 answers

Sort by: Most helpful
  1. Rich Matheisen 48,116 Reputation points
    2021-12-06T22:30:53.603+00:00

    I think I'd change the code @Michael Taylor offered a little bit:

    Get-WmiObject -computername (Get-ADComputer -filter * -SearchBase "DC=<yourdc>,DC=<yourdc>").Name -class win32_bios  
    

    The Get-WmiObject takes an array as the value for its -ComputerName parameter.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Michael Taylor 61,221 Reputation points
    2021-12-06T20:28:52.527+00:00

    If I understand your question then you want to get all the machines in a specific OU. For each machine you then want to run the command to get the BIOS information.

    Get-ADComputer -filter * -SearchBase "DC=<yourdc>,DC=<yourdc>" | Foreach-Object { get-wmiobject -computername $_.Name -class win32_bios }
    

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.