welcome System Center 2007!

System Center Operations manager 2007 in Egypt

قُل لّوْ كَانَ الْبَحْرُ مِدَاداً لّكَلِمَاتِ رَبّي لَنَفِدَ الْبَحْرُ قَبْلَ أَن تَنفَدَ كَلِمَاتُ رَبّي وَلَوْ جِئْنَا بِمِثْلِهِ مَدَداً

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----------------------"