Hallo,
habe folgendes VBScript ausgeführt das ich im Netz gefunden habe, angepasst habe ich nur die http-Adresse meines eigenen WSUS. Ich kenne mich mit VB überhaupt nicht aus, gibt es denn einen Weg das ganze Rückgängig zu machen??? Bin für jede Antwort dankbar!
strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48) For Each objItem in colItems oslang = objItem.OSLanguage next
'****************** '**Für die dt. OS** '******************
if oslang=1031 then
Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service where Caption = 'Automatische Updates'") stopservice ManipulateRegistry startservice end if
'******************* '**For the eng. OS** '******************* if oslang=1033 then
Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service where Caption = 'Automatic Updates'")
stopservice ManipulateRegistry startservice end if
wscript.echo "WSUS wurde konfiguriert"
'******************************************* '**Benötigte Funktionen ** '*******************************************
function stopservice
'****************************************** '**Stoppt den Dienst Automatische Updates** '******************************************
For Each objService in colServiceList errReturnCode = objService.Change( , , , , "Automatic") errReturn = objService.StopService() Next end function
function startservice
'******************************************* '**Startet den Dienst Automatische Updates** '*******************************************
For Each objService in colServiceList errReturnCode = objService.Change( , , , , "Automatic") errReturn = objService.StartService() Next end function
function ManipulateRegistry
const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
updatePath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate" WUPath = "SOFTWARE\Policies\Microsoft\windows\WindowsUpdate\AU" AutoUpdate = "SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"
oReg.DeleteValue HKEY_LOCAL_MACHINE,AutoUpdate,"DetectionStartTime" oReg.DeleteValue HKEY_LOCAL_MACHINE,AutoUpdate,"LastWaitTimeout"
oReg.CreateKey HKEY_LOCAL_MACHINE,updatePath oReg.CreateKey HKEY_LOCAL_MACHINE,WUPath oReg.CreateKey HKEY_LOCAL_MACHINE,AutoUpdate
oReg.SetStringValue HKEY_LOCAL_MACHINE,updatePath,"WUServer","http://TEST-WSUS" oReg.SetStringValue HKEY_LOCAL_MACHINE,updatePath,"WUStatusServer","http://TEST-WSUS"
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,AutoUpdate ,"AUState","2"
'********************************************** '**Grundeinstellungnen für Externe Nutzer ** '** ** '**automatischer DoWnload ** '**automatische Installation ** '**keine auto Reboot wenn Benutzer eingeloggt** '**********************************************
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"NoAutoUpdate","0" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"AUOptions","4" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"ScheduledInstallDay","0" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"UseWUServer","1" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"RescheduleWaitTime","1" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"NoAutoRebootWithLoggedOnUsers","1" oReg.SetDWORDValue HKEY_LOCAL_MACHINE,WUPath,"ScheduledInstallTime","12"
end function
|