Link to home
Start Free TrialLog in
Avatar of Venkatesan T
Venkatesan T

asked on

script to pull Os version on multiple computers need for meltdown

hi all

i am looking for a power shell script to pull the os version on our 5000 servers in our environment. i need to call the servers list from a text file. and require output on csv file.

script should say access denied in case of credentials does not work. also if server is down should say "Not online".

please help. needed this urgently for meltdown vul. fix.
Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

There's a way that came out yesterday afternoon to install a module to check if this vulnerability is affected a system. I have created this article:
https://www.experts-exchange.com/articles/31438/Intel-Bug-Spectre-and-MeltDown.html

$computers = Get-Content "computers.txt"
$sb={
    Install-Module SpeculationControl
    Get-SpeculationControlSettings
}
foreach($computer in $computers){
   $comp= Invoke-Command -ComputerName computer -ScriptBlock $sb
  add-content -path "C:\log.txt" -value "$computer,$comp" 
}

Open in new window

Avatar of Venkatesan T
Venkatesan T

ASKER

but now I need to know the running os version and need a result in csv file for multiple computers.pls help.
ASKER CERTIFIED SOLUTION
Avatar of MilesLogan
MilesLogan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've just posted PS code to do the complete check for the domain at https://www.experts-exchange.com/questions/29076942/Meltdown-patch-Checker-script-for-remote-PCs.html?anchorAnswerId=42426331#a42426331. This would also work with a text file with a few simple changes.
no... i really don't want at this point meltdown patch os installed or mot.

my environment has mix of windows 2003, 2008, 2008 R2, 2012 and 2012 R2. microsoft has released patch for only 2008 R2 and 2012 R2. for the rest , registry fix can be applied. so i need get installed os of all my servers.  i preference the server names passe from text file because we have many desktop like windows 10 also connected to domain.
Miles script should work for you. It just asks AD for the details, and so machines do not need to be online, and no credentials issues can arise.
many thanks it worked perfectly.