Winscripter
  WSH
  Forums
  Downloads
  Books
  Links
  Amazon





© winscripter.com
1998-2004







Script: Get BIOS Information

Posted by on Friday, January 30, 2004 (PST)

Script: Prints out BIOS information about a local or remote computer that you have rights to. Manufacturer, Name, Serial Number, Version, and Status

 


GetBIOSInfo( "xp" ); // Query Computer Named XP
GetBIOSInfo( "win2k" ); // Query Computer Named Win2K
function GetBIOSInfo( computer )
{
  print( "Checking BIOS on " + computer );
  var cstr = "winmgmts:{impersonationLevel=impersonate}!\\\\" + computer + "\\root\\cimv2";
  var wmi = GetObject( cstr );
  var ebios = new Enumerator( wmi.ExecQuery( "SELECT * FROM Win32_BIOS" ) );
  for( ; !ebios.atEnd(); ebios.moveNext() )
  {
   var bios = ebios.item();
   print( "Manufacturer  : " + bios.Manufacturer );
   print( "BIOS Name     : " + bios.Name );
   print( "Release Date  : " + ConvertDate( bios.ReleaseDate ) );
   print( "Serial Num    : " + bios.SerialNumber );
   print( "SMBIOS Info" );
   print( " -> Version   : " + bios.SMBIOSBIOSVersion );
   print( " -> Major Ver : " + bios.SMBIOSMajorVersion );
   print( " -> Minor Ver : " + bios.SMBIOSMinorVersion );  
   print( "Status        : " + bios.Status );
   print( "Version       : " + bios.Version );
  }
  print( "------------------------------" );
}
function print( msg )
{
  WScript.Echo( msg );
}
function ConvertDate( datetime )
{
  var sdate = String( datetime );
  if( sdate.match( /(\d{4})(\d{2})(\d{2})\*/ ) )
   return( RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3 );
  else
   return( sdate );
}
 

Add Your Comment



WSH and ADSI Administrative Scripting

New Articles
  • List installed COM objects and associated ProgIDs
    Script: Lists all COM Objects and their associated ProgIDs (If available). Win32_ClassicCOMClassSetting

  • Script: File Rotator
    Script: Rotate files where the most current file has the lowest number in the archive. When files exceed the retention period, they are deleted. Typically used for log files, backups, etc..

  • Script: Create IIS Website and DNS record
    Script: Dan Casier sent me this script that will create a website and appropriate DNS record. The script is intended for Windows 2000 Server with local DNS and necessary DNS mof installed.


  • Winscripter   |  WSH   |  Forums   |  Downloads   |  Books   |  Links   |  Amazon