Helpforsure

Microsoft Windows Experts

Retrieve Terminal Services Licensing Grace Period Days info via WMI January 25, 2011


Script to retrieve the number of days left in your TS Licensing Grace Period:
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2\TerminalServices”)
‘ Obtain an instance of the the class
‘ using a key property value. (more…)

Advertisements
 

Set Relative Weight in a Terminal Services Session Directory/Broker based Farm via WMI


Script to set a Relative weight value of 100 in a Terminal Services Session Directory/Broker based Farm via a Script:

=========================

Set Relative Weight to a TS Farm

=========================
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2\TerminalServices”)
‘ Obtain an instance of the the class
‘ using a key property value.
Set objShare = objWMIService.Get(“Win32_TSSessionDirectory”) (more…)

 

Howto: Backup Application/System Event logs via WMI Queries

Filed under: Scripts — helpforsure @ 5:38 am
Tags: , , , , , , , , ,

The following Visual Basic scripts(WMI) will allow you to take a backup of your Event Viewer .evtx log files by running WMI Queries:

=================================

Backup Application Event Log

=================================

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2”)
‘ Obtain an instance of the the class
‘ using a key property value.
Set objShare = objWMIService.Get(“Win32_NTEventlogFile.Name=’C:\Windows\System32\Winevt\Logs\Application.evtx'”) (more…)