Salut a tous J'ai besoin d'un peu d'aide pour corriger se probleme
rien ne marche
la dedans
comment faire pour execute un fonction avec plusieur attribut et des variables
cette reponce je pense me permettrai de corriger tout
merci
'Suppression et Ajout de clé dans le registre'
function ActionPatch
if ping = 0 and AdminCheck = 0 Then
set WshShell = CreateObject ("Wscript.shell" )
'Arret du service Update de Windows'
Act = WshShell.Run ("Patch1\Utilities\psexec.exe \\target -n 10 -u compteadmin -p passadmin net stop wuauserv", 0,TRUE)
'Suppression des cles existantes'
Act = WshShell.Run ("reg DELETE HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /FORCE TARGET", 0,TRUE)
'Ajout des cles necessaires'
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\ElevateNonAdmins=00000000 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUServer="http://crvsapp08.pharma.aventis.com:8530" TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUStatusServer="http://crvsapp08.pharma.aventis.com:8530" TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\TargetGroupEnabled=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\TargetGroup=Wsusgroup TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate=00000000 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions=00000004 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallDay=00000000 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallTime=00000017 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\AutoInstallMinorUpdates=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\RebootWarningTimeoutEnabled=00000000 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTimeEnabled=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTime=0000000a REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\DetectionFrequencyEnabled=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\DetectionFrequency=00000001 REG_DWORD TARGET", 0,TRUE)
Act = WshShell.Run ("reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\RebootWarningTimeout=00000005 REG_DWORD %TARGET%", 0,TRUE)
'modification de statut du service Windows Update de devalide a automatique'
Act = WshShell.Run ("reg update HKLM\SYSTEM\CurrentControlSet\Services\wuauserv\Start=00000002 TARGET", 0,TRUE)
'redemarrage du service Windows Update'
Act = WshShell.Run ("Patch1\Utilities\psexec.exe \\target -n 10 -u compteadmin -p passadmin net start wuauserv", 0,TRUE)
'mise en conformité DNS commun CRV-CPV Vitry'
Act = WshShell.Run ("reg update HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Domain="crv.pharma.aventis.com" TARGET", 0,TRUE)
Act = WshShell.Run ("reg update HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SyncDomainWithMembership=00000000 TARGET", 0,TRUE)
end Function
'Verification des droits sur le poste'
function AdminCheck
if PING = 0 Then
set WshShell = CreateObject ("Wscript.shell" )
Test1 = WshShell.Run ("Patch1\Utilities\psexec.exe \\target -n 10 -u compteadmin -p passadmin ipconfig /all", 0,True)
'Test2 = WshShell.Run ("Patch1\Utilities\psexec.exe \\target -n 10 ipconfig /all", 0,TRUE)
'Test3 = WshShell.Run ("copy dackel3 \\target\loc)
if Test1 = 1 then WriteOpadmins else set Admin = 0
end function