# This code displays the current failure and recovery settings.
# ---------------------------------------------------------------
# Adapted from VBScript code contained in the book:
# "Windows Server Cookbook" by Robbie Allen
# ISBN: 0-596-00633-0
# ---------------------------------------------------------------
use Win32::OLE qw(in);
$Win32::OLE::Warn = 3;
# ------ SCRIPT CONFIGURATION ------
$strComputer = '.'; # e.g. rallen-srv01
# ------ END CONFIGURATION ---------
$objWMI = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\cimv2');
$colRecoveryConfig = $objWMI->InstancesOf('Win32_OSRecoveryConfiguration');
foreach my $objConfig (in $colRecoveryConfig) {
print $objConfig->Name, "\n";
print ' Auto reboot: ' . $objConfig->AutoReboot, "\n";
print ' Debug File Path: ' . $objConfig->DebugFilePath, "\n";
print ' Debug Type: ' . $objConfig->DebugInfoType, "\n";
print ' Expanded Debug File Path: ' . $objConfig->ExpandedDebugFilePath, "\n";
print ' Kernel Dump Only: ' . $objConfig->KernelDumpOnly, "\n";
print ' Overwrite Existing: ' . $objConfig->OverwriteExistingDebugFile, "\n";
print ' Send Admin Alert: ' . $objConfig->SendAdminAlert, "\n";
print ' Write Debug Info: ' . $objConfig->WriteDebugInfo, "\n";
print ' Write to System Log: ' . $objConfig->WriteToSystemLog, "\n";
}
|