Modify Terminal Services Time Limit Policy

Configures Terminal Services to use per-user time limit policies. To apply the serverís time limit policies to all users, set the value of the TimeLimitPolicy property to 0 instead of 1.

VBScript Code

Const PER_USER = 1
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_TSSessionSetting")

For Each objItem in colItems
    objItem.TimeLimitPolicy = PER_USER