There’s load of ways to access WMI, on top of the methods in this post you can also use WMI via. Class Win32_Process -Name Create -ArgumentList “calc.exe” The computername parameter can be used to specify remove machines. Using the Invoke-WmiMethod cmdlet we can launch a create process method of the WIN32_Process class. Wscript.Echo ProcessName & ” could not be started due to error ” & ReturnCode & “.” Wscript.Echo ProcessName & ” ran with a process ID of ” & intProcessID & “.” ReturnCode = objWMIService.Create(ProcessName, null, null, intProcessID) Set objWMIService = GetObject(“winmgmts:!\\” & strComputer & “\root\cimv2:Win32_Process”) ‘create an object of win management to the local win32_process namespace ‘# Run a process using WMI on the localhost It is executes using either cscript.exe or wscript.exe: ‘# Visual Basic Script is a long-standing technology but still can be useful (depending upon your perspective). Wbemtest is great, it’s on all windows machines so you can get information and execute methods you can also create queries and notifications queries (great for writing WMI event filters/consumers).Įdit the “CommandLine” property and click Save Object then close. This post is going to focus on Win32_Process:Create (there are other methods as well!) Wbemtest The first WMI class is LenovoBiosSetting. This script uses 6 of the Lenovo provided WMI classes. This means that we can use PowerShell to directly view and edit BIOS settings without the need for a vendor specific program. WMI is an awesome technology capability for Windows administration, I’ve been using WMI since the Windows 2000 era, I’ve written WMI based scripts/tools to defeat malware, yay, however with any tool the use can be for good and for evil! Lenovo provides a WMI interface that can be used for querying and modifying BIOS settings on their hardware models.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |