Link to home
Create AccountLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

How to get list of servers with the SCSI controller model ?

Hi All,

using powershell in Active Directory, can anyone here please share the Powershell script to list all server name and its SCSI card name ?

I wonder if that is possible.
SOLUTION
Avatar of David
David
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Albert Widjaja

ASKER

Ok, so I f I have several hundreds servers in an OU can it shows or export it to csv ?
The script won't care how many systems you have, but it will care that you have a supported client operating system.  You would have to modify the script to create output in csv format.
The script will not care for remote systems at all, and it is overkill for a "simple" task like this.
The difficulty is
  a) to get all AD computers without having the ActiveDirectory cmdlet available (it is W2008 (?))
  b) to run the query on remote machines,
  c) to filter for interesting data,
  d) creating something usable as report.

Mixing different techniques makes it work:
dsquery computer |
  % {
    $pc = $_.Split('=,')[1]
    Write-Host -f yellow $pc
    Get-WmiObject Win32_SCSIController -computer $pc } | select SystemName, Name, Manufacturer, Status
   } | export-CSV -NoType 'C:\Temp\EE\SCSI Report.csv'

Open in new window

There is no way to check for servers only. But if you follow a naming convention making servers stick out of the AD computer names, the dsquery results can be filtered for that.
Hi @QLemo, I've created this simple script using Powershell Quest AD to narrowed down the search:

$ErrorActionPreference = "SilentlyContinue"

$server = Get-QADComputer -SearchRoot 'domain.com/Production Servers' -OSName "Windows*Server*" | Where-Object { Test-Connection $_.Name -Count 1 -Quiet }

foreach($computer in $server) {
	
}

Open in new window


is it possible to use that by merging it with your script above ?
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
many thanks !