Q: What IT Pro does if he has too much work and too little time to do something interesting?
A: He does something interesting that will save him some time doing his work. 😉
Two good examples of that today. First – we were asked by user to help him with installing citrix stuff for remote app. We could use OCS, VNC or other technique but hey, why not use PowerShell for that? I’ve read about Invoke-WMIMethod a while ago but never tried to use it. So I tried today, twice. First it was msi package to be installed: so we used Win32_Product:
Invoke–WmiMethod -ComputerName MyInvocation -Class Win32_Product -Name Install -ArgumentList @($true, $null, ‘c:tempPowerGUI.msi’)
Of course line used was different (PC, package) but worked as smooth as new PowerGUI. 😉
Next thing we tried was to install soft we needed on another remote machine. But because it reboots the machine once installed we have tested it on machine standing on our desk, just to see if it works. And because it’s .exe installation we used Win32_Process this time:
Invoke–WmiMethod -ComputerName MyInvocation -Class Win32_Process -Name Create -ArgumentList @(‘c:windowsnotepad2.exe’)
OK, but one thing I could not find: description of methods in PowerShell directly. Fortunately I had WMIExplorer that helped me get proper syntax, especially for Win32_Product – this method’s call is not intuitive at all…