Archive

Archive for the ‘wmi’ Category

how to know my windows operating system installation time?

March 31, 2010 3 comments

Installation of time windows will be saved in Win32_OperatingSystem WMI class. Alternatively it will be available in registry(HKLMSOFTWAREMICROSOFTWINDOWS NTCURRENTVERSIONINSTALLDATE). So, now you need to figure out your own way of querying values from either wmi or from registry. Being a fan of powershell, I want you to help with two line PS code to get the installation date/time.

$osinstalledtime = gwmi win32_operatingSystem
write-host $osinstalledtime.ConvertToDateTime($osinstalledtime.InstallDate)

That’s it. I will give you the details you need.

WMI Code Generator — a easy tool for WMI code generation

February 12, 2010 Leave a comment

I generally use Scriptomatic Tool for samples of WMI queries using VBscripts. It is useful and servers the purpose in many conditions. But I decided to stop using it…because, I am impressed with Microsofts new Tool “WMI Code Generator” — yay.. :-)

It is really a rich version of Scriptomatic tool. Using WMI code generator, you can generate scripts for specific property, work with wmi events, and many more along with wmi code samples.

It helps you to,

  • Get samples codes for all WMI classes
  • Has the capability to generate code for selected properties
  • Supports and WMI methods execution
  • Supports WMI events code generation
  • Browsing WMI made easy
  • More importently, you can run this with normal user account and no installation is required. In case of scriptomatic, you should use administrator account to run it.

So, don’t miss it…

Download:

Download link is here..

Reference :

http://blogs.technet.com/askperf/archive/2010/02/02/two-minute-drill-wmi-code-creator.aspx

Happy Learning..,
Sitaram Pamarthi

Understanding WMI event notification

Many people aren’t aware of this beautiful feature introduced with Windows 2000 and continuing in it’s successors. To get a better sense of what it is, lets a take a example. Your CPU is spiking to 100% at mid nights and you got the task of identifying the root cause. The spike is very  sporadic in nature and lasts for very short time. How will you deal with this situation to see which process is taking high CPU?. Here comes the benefit of WMI event notifications. You can trigger a monitoring in your system using WMI event notifications to monitor the CPU utilization and do a process dump when it touches the monitored value. Task is done and you don’t need to spend time in monitoring manually. This is just a example only and you can adopt this to get alerted when a process starts or ends.

I may not be good at explaining the real use of WMI event notifications but I have found beautiful blog entry which explained this in detailed. Read it to become smart administrator.

Trevor Sullivan’s Tech Room

You can also refer to Microsoft Technet Site Article

Happy Learning..,
Sitaram Pamarthi.

Categories: Tips, wmi