+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, WSUS Client SID in Coding and Web Development; Morning! I want to run this script on all our PC's as a login script. Code: @ echo off Echo ...
  1. #1
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40

    WSUS Client SID

    Morning!

    I want to run this script on all our PC's as a login script.

    Code:
    @echo off 
    Echo Save the batch file "AU_Clean_SID.cmd". This batch file will do the following: 
    Echo 1.    Stops the wuauserv service 
    Echo 2.    Deletes the AccountDomainSid registry key (if it exists) 
    Echo 3.    Deletes the PingID registry key (if it exists) 
    Echo 4.    Deletes the SusClientId registry key (if it exists) 
    Echo 5.    Restarts the wuauserv service 
    Echo 6.    Resets the Authorization Cookie 
    Echo 6.    More information on http://msmvps.com/Athif 
    Pause 
    @echo on 
    net stop wuauserv 
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f 
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f 
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f 
    net start wuauserv 
    wuauclt /resetauthorization /detectnow 
    Pause
    Can some clever fellow modify it so that it checks for a text file called WSUS.txt on the root of c:\. If the file is present, dont run the script, if the file doesnt exist, runs the script.

    I have zero idea how to do this and my earlier attempt failed miserably.

    Or is there a way that I can make these registry changes only once with GP Prefs.?

    Any help much appreciated.

    James

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,697
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Unless it's changed it should be as simple as:

    Code:
    :BEGIN
    IF NOT EXIST C:\wsus.txt GOTO NOTFOUND
    :FOUND
    (put code here)
    :NOTFOUND

  3. Thanks to Steve21 from:

    Admiral208 (6th May 2011)

  4. #3

    Join Date
    Aug 2010
    Location
    West Midlands
    Posts
    3
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    IF EXIST C:\WSUS.txt goto SkipWSUS
    net stop wuauserv
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Wi ndowsUpdate" /v AccountDomainSid /f
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Wi ndowsUpdate" /v PingID /f
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Wi ndowsUpdate" /v SusClientId /f
    net start wuauserv
    wuauclt /resetauthorization /detectnow
    echo done > C:\WSUS.txt
    :SkipWSUS
    This skips the middle section if the file already exists. If it doesnt, it will run your code then create the file.
    Last edited by itguy101; 6th May 2011 at 10:06 AM.

  5. Thanks to itguy101 from:

    Admiral208 (6th May 2011)

  6. #4

    Join Date
    Aug 2010
    Location
    West Midlands
    Posts
    3
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    im not too certain if you need the pause in there though

SHARE:
+ Post New Thread

Similar Threads

  1. WSUS Client won't report
    By cookie_monster in forum Windows
    Replies: 14
    Last Post: 24th November 2009, 10:02 AM
  2. WSUS Client Update Time?
    By TechSupp in forum Windows
    Replies: 2
    Last Post: 20th October 2009, 06:11 PM
  3. WSUS Client Problems
    By sidewinder in forum Windows
    Replies: 12
    Last Post: 20th March 2008, 10:23 AM
  4. WSUS 3 - Client connection problems
    By Aeropars in forum Windows
    Replies: 15
    Last Post: 7th December 2007, 02:57 PM
  5. WSUS + Client Login....
    By techie in forum Wireless Networks
    Replies: 6
    Last Post: 1st February 2006, 09:28 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •