[unisog] Cisco 2950 protected ports in residential halls

Michael Holstein michael.holstein at csuohio.edu
Tue Nov 22 14:30:07 GMT 2005


> If anyone is not sure how to setup a login script to do this, please let
> me know and I will provide a quick guide.

This little .vbs script will do it (interactively). Obviously you can 
remove the Inputbox bits and just pick a random time (do *not* 
universally deploy a script that says a predefined value -- unles you 
want to DOS yourself at that time everytime there's an update).

Regards,

Michael Holstein CISSP GCIA
Cleveland State University

--snip--

'sets up automatic update property

Dim servname, compname, intime, adjust, objserv, objComputer, temp

set objshell=WScript.CreateObject("WScript.Shell")


compname=objshell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\computerName\ComputerName")
servname= "wuauserv"


Set objComputer = GetObject("WinNT://" & compname & ",computer")

' get an object for a service
Set objServ  = objComputer.GetObject("Service", servname)

If (objServ.Status = 4) Then

   ' if the service is started, then stop it
         objServ.stop

end if

         objshell.RegWrite 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto 
Update\AUOptions" ,"4","REG_DWORD"
         objshell.RegWrite 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto 
Update\AUState" ,"2","REG_DWORD"
         objshell.RegWrite 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto 
Update\DetectionStartTime" ,now(),"REG_SZ"
         objshell.RegWrite 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto 
Update\ScheduledInstallDay" ,"0","REG_DWORD"

  intime= Inputbox ("Enter the time in between 1 and 12 suitable to you 
to set Automatic Updates. In form of HH")

  adjust =Inputbox("Enter am/pm :")
  temp = intime


if ((adjust="PM" or adjust="pm") and intime<>12) then

       intime =intime+12

end if

objshell.RegWrite 
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto 
Update\ScheduledInstallTime" ,intime,"REG_DWORD"


if (objServ.Status=1) then

         objServ.start
end if

WScript.echo "The automatic Update property has been set up at: every 
day " & te


More information about the unisog mailing list