12.07.2015 Views

Dell Power Solutions

Dell Power Solutions

Dell Power Solutions

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SYSTEMS MANAGEMENTstrComputer = WScript.Arguments.Item(0)strCommand = WScript.Arguments.Item(1)Wizard on the management station to performthe update during off-peak hours.Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & _"\root\cimv2:Win32_Process")errReturn = objWMIService.Create(strCommand,null,null,intProcessID)if errReturn = 0 ThenWscript.Echo strCommand & " was started with a process ID of " _& intProcessID & "."ElseWscript.Echo strCommand & " could not be started due to error " & _errReturn & "."End IfFigure 4. Sample WMI script for executing a remote processPerforming a remote software update under <strong>Dell</strong> OpenManageAdministrators can perform a remote software update for BIOS,firmware, and drivers by using the omupdate command or by usinga <strong>Dell</strong> Update Package.omupdate CLI command. To execute the omupdate command,an administrator would invoke the following:omupdate biosupdate path="\\network_share\file_name "This sample command refers to thenetwork share where the update file resides.In the absence of a network share, administratorscan copy the file to a temporarydirectory on the local system before performingthe update.<strong>Dell</strong> Update Package. Another optionis to copy the <strong>Dell</strong> Update Package, whichis a self-contained .exe file, onto theremote system. The .exe file can be directlyexecuted on the remote node by passingits command-line arguments for a silentinstallation of the package and rebootingthe system, if necessary. The WMI scriptlisted in Figure 5 illustrates a remote softwareupdate that passes in the computername and the name of the <strong>Dell</strong> UpdatePackage. In the script, note that the <strong>Dell</strong>Update Package is invoked with the /s /roption to perform a silent update andreboot of the system, if necessary.For a scheduled update, administratorscan use the Windows Scheduled TaskSecurity considerationsWMI scripts run in the security context ofthe administrator running the script. To runscripts on a remote computer, a user needsadministrative access on the remote system,thus helping to prevent malicious individualsfrom running destructive scripts on aremote server. Remote WMI scripting leveragesDistributed COM (DCOM) for interactingwith the WMI service running on theremote system.The scripts in this article set the impersonationlevel to “impersonate.” This settingimplies that the WMI service uses theadministrator’s security context to perform the requested operation.If the administrator’s security credentials are not adequate, errorssuch as “Access Denied” will occur when running the script.WMI provides a rich security infrastructure that can be configuredon a per-namespace basis. By default, the administrator’s grouphas full control of WMI on both local and remote computers, andusers in other groups do not have remote access to the computers.To view a computer’s security settings, invoke wmimgmt.msc fromthe command prompt, view the properties of the root node, and lookstrComputer = WScript.Arguments.Item(0)strDupFile = WScript.Arguments.Item(1)'* First copy the <strong>Dell</strong> Update Package to the remote systemSet objFSO=CreateObject("Scripting.FileSystemObject")ObjFSO.CopyFile strDupFile, "\\" & strComputer & "\C$\tmp\" & _strDupFile'* Launch the process on the remote systemSet objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & _"\root\cimv2:Win32_Process")strCommand = "C:\tmp\" & strDupFile & " /s /r"errReturn = objWMIService.Create(strCommand,null,null,intProcessID)if errReturn = 0 ThenWscript.Echo strCommand & " was started with a process ID of " _& intProcessID & "."ElseWscript.Echo strCommand & " could not be started due to error " & _errReturn & "."End IfFigure 5. Sample WMI script for a remote software updatewww.dell.com/powersolutions POWER SOLUTIONS 69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!