you can list all local groups on your server using a simple task in operations manager
use the script below to create your task
On Error Resume Next
strComputer = "."Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Group Where LocalAccount = True")
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "SID: " & objItem.SID
Wscript.Echo "-------------------Tarek-----------------------"
Next
Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts
Friday, November 16, 2007
Enable TS using OPsMgr 2007 Task
you can enable Terminal service using a Task for your operations manager console
the script is below :
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."Set oReg=GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" &
_ strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\"
strValueName = "fDenyTSConnections"
oReg.SetDWORDValue _
HKEY_LOCAL_MACHINE, strKeyPath, strValueName,0
oReg.GetDWORDValue _ HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
if dwValue = 0 then
Wscript.Echo "Terminal service is now enabled"
else
Wscript.Echo "Terminal service could not be enabled"
end If
Wscript.Echo "-------------------Tarek----------------------"
the script is below :
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."Set oReg=GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" &
_ strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\"
strValueName = "fDenyTSConnections"
oReg.SetDWORDValue _
HKEY_LOCAL_MACHINE, strKeyPath, strValueName,0
oReg.GetDWORDValue _ HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
if dwValue = 0 then
Wscript.Echo "Terminal service is now enabled"
else
Wscript.Echo "Terminal service could not be enabled"
end If
Wscript.Echo "-------------------Tarek----------------------"
Subscribe to:
Posts (Atom)
