On GameSpot: Wii Fit tells 10-year-old she's fat

Unblock Windows XP updates with this member-submitted admin script

Tags: Workstations, Patches, NETWORKING, Guest Contributor, Tina Shields

  • Save
  • Print
  • Digg This
  • 1

Takeaway: In 2005, TechRepublic asked members to submit their favorite Network Administration scripts and this is one of the responses. You can use this script to automate the cleanup of old BITS jobs that may have stuck in the queue during a previous Windows update.

In 2005, TechRepublic asked members to submit their favorite Network Administration scripts for possible publication. One of the first to make a submission was Tina Shields.


Tina Shields' script in her own words

I am a network admin, and have been using SUS and then WSUS to keep my 50+ servers up to date on Windows patches for the past few years. The desktop group used Service Pack Manager for workstations, but it required too much management. So, I assumed responsibility of updating 600+ workstations. I ran into some issues with XP machines not having correct security identifiers for the Automatic Updates and Background Intelligent Transfer Services (BITS), and old BITS jobs from the previous version stuck in the queue. I wrote this script to "clean up AU." It works like a charm.

Table A


'================================================================
' SCRIPT NAME:  cleanau.vbs
' AUTHOR:   TDShields,
' DATE:     8/18/2005
' COMMENT: To remove old BITS jobs
'================================================================

Option Explicit

on error resume next
dim oAU, oBITS, oComputer
dim oCommand, oFSO, oShell

do while lcase(oComputer) <> "quit"

   ' gather input
   oComputer = InputBox("Enter the workstation's name, or type quit to exit")

   ' stop services
   set oFSO = CreateObject("Scripting.FileSystemObject")
   set oBITS = GetObject("WinNT://" & oComputer & "/BITS")
   oBITS.stop
  
   set oAU = GetObject("WinNT://" & oComputer & "/wuauserv")
   oAU.stop

   ' delete old jobs
   set oFSO = CreateObject("Scripting,Filesystemobject")
   oFso.DeleteFile("\\" & oComputer & "\c$\Documents and Settings\All Users\application data\microsoft\network\downloader\*.*" & chr(34)), DeleteReadOnly

   ' set security descriptors on services
   Set oShell = CreateObject("WScript.shell")
   oCommand = "sc \\" & oComputer & " sdset bits " & chr(34) &"D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)
(A;;CCLCSWLOCRRC;;;AU)
(A;;CCLCSWRPWPDTLOCRRC;;;PU)" & chr(34)
   oShell.RunoCommand

   oCommand = "sc \\" & oComputer & " sdsetwuauserv " & chr(34) & "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)
(A;;CCLCSWLOCRRC;;;AU)
(A;;CCLCSWRPWPDTLOCRRC;;;PU)" & chr(34)
   oShell.RunoCommand

   ' start services
   oBITS.start
   oAU.start
loop
  • Save
  • Print
  • Digg This
  • 1

Print/View all Posts Comments on this article

Admin scripts: Automate BITS cleanupMark W. Kaelin Techrepublic | 10/26/05
Admin scripts.. Great ideas..tsiskin@...  | 11/10/05
Good suggestionMark W. Kaelin Techrepublic | 11/11/05
Script logricnavarro@...  | 11/22/05
Good ideaTinaShields  | 11/25/05
WSUS ScriptJoanne Lowery  | 01/18/07
newbe on scriptingcuretgabriel@...  | 01/18/07
I get a errordmurdock@...  | 01/18/07
Error fixtturbide@...  | 01/18/07
Thank Youdmurdock@...  | 01/18/07

What do you think?

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET
advertisement
Click Here