Posts Tagged ‘wmi’
This month's PowerShell one-liner queries the WMI Win32_Product class for a specified computer and builds a formatted report of all installed applications sorted by vendor. You'll be able to tell at a glance what is installed, when it was installed, where it was installed from and the product version. Be warned that querying this WMI class may take several minutes or longer.
This one line expression defaults to the local computer, but you can substitute any computername you want. You can also add support for alternate credentials. I've broken the expression into several lines for publication purposes but this is in fact a oneline expression.   More »
Inventory Report to XML
Thursday, June 18th, 2009 by Jeffery Hicks
Lately I seem to be answering a number of PowerShell XML related questions. When that happens I figure its time for an example. I have a script that I think originally was posted in a forum. I apologize that I didn't note where it came from. But I've enhanced it (as I am likely to do). The script reads a bare bones XML file of computernames and builds a new XML file with inventory information such as operating system, computer system, logical disks and more retrieved from WMI. My script will hopefully serve as examples for working with XML files. I also use Write-Progress so that you can track what the script is doing.   More »
Status Indicators with PowerShell and PolyMonRT
Friday, March 20th, 2009 by Jeffery Hicks
In my last Mr. Roboto column, I wrote about the open source project, PolyMonRT. I recently suggested it to someone as a solution, especially because PolyMonRT supports PowerShell as a provider. My friend wanted to use the status light indicator to show when a particular service was running or not. Basically Green is good and Red is not. It tool a little fiddling on my part but I came up with the process.   More »
Get Network Connections
Thursday, March 19th, 2009 by Jeffery Hicks
I love that part of my job is helping people out in the forums as ScriptingAnswers.com. A recent post asked about finding out what network drives were mapped on a remote computer using PowerShell. The task sounded familiar so I poked around my script pile and found an old VBScript that used WMI and the Win32_NetworkConnection class. Great. Get-WMIObject to the rescue:
Get-WMIObject win32_networkconnection -computername Desk23
You even get a nicely formatted summary. But you me, I can't resist tinkering so I wrote a function that enhances this basic command I call Get-NetConnection   More »
Create A Remote File Share
Thursday, March 12th, 2009 by Jeffery Hicks
This topic came up recently in the PowerShell forum at ScriptingAnswers.com and I thought you might find it helpful. The issue was creating a file share remotely. In the "olden days", this would have meant using a command line tool like RMTSHARE, which is really just fine. But if you have a larger workflow, doing it natively in PowerShell may be more desirable.
Let me show you how easy it is to create a file share using Windows Management Instrumentation (WMI). I wrote a function called New-FileShare.   More »
February PowerShell One-Liner
Tuesday, February 3rd, 2009 by Jeffery Hicks
If you subscribe to the SAPIEN newsletter you should have seen this already. If not, why don't you take a moment to subscribe? Each month you'll get all the latest product and training news from SAPIEN Technologies as well as useful tips like this Powershell one-liner that produces a report on event log sizes for multiple computers.   More »
Editing PrimalForms
Thursday, January 22nd, 2009 by Jeffery Hicks
I continue to play with PrimalForms and I know many of you are as well. I thought I'd share a few other techniques for creating scripts and moving between the code generated by PrimalForms and the script you create in PrimalScript. One technique that I've started using is to leverage PrimalScript's snippet feature.   More »