Jump to content

Recommended Posts

Posted
As the title says, after this summers upgrade to W7 and they way its being imaged to each PC I will need to reset the WSUS id etc on each PC(had to do this at the last school last summer but did it manually on each PC). I have a batch file I can run that does all the re-initailisation, stopping and starting services etc but I would like to do it automatically just the once. Would rather do it without having to resorting to creating a check file and checking its existence etc. Anyone got any ideas, via GPO?
Posted
You could always create a batch file that looks at a CSV and pulls the names of each machine and then using psexec run the batch file all from one location just set it going come back later
Posted
Hmmm, not thought of that way!, but that requires them all to be on at the same time and that's unfortunately not always guaranteed, but thanks anyway. All the PC's have yet to be joined to the domain so may get the technician to just run the script after they have done that if I cant get it sorted.
Posted (edited)

What remote control software do you use ie ab tutor / Impero etc ?

 

What about making it write and create a registry key and get it to check that key to see if it exists. If not then run the code if it does then ignore it ?

 

Upon it successfully running the code make it

 

1) create the registry key on the machine that it was run on

2) append to a log file thats located in sysvol or netlogon share any info u want to record ie machine name , date time

 

Once you know all machines have been done by looking at the log file you could adjust it to delete the registry key and to ignore or delete the other code so it only deletes that one reg key

Edited by mac_shinobi
Posted

This is the script I use for this purpose. I set it as a start up script in a GPO. As @mac_shinbobi suggests you could have it logging to a file somewhere and the modification would not take much effort to add.

 

'Action: Fixes a problem where the SusClientId registry entry is the same on several client workstations.
'        If SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SUSClientIdReset = 1. If so then quit
'        Otherwise delete
'        SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SUSClientId
'	 SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\SUSClientIdValidation
'        Stop and restart the wuauserv service
'	 Force wuauclt to check for updates.

Dim objShell, strKeyPath, strValueName,strComputer

set objShell = wscript.createObject("wscript.shell")

const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate"
strValueName = "SUSClientIdReset"


objRegistry.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
IF (dwValue = "5") THEN
           'do nothing
     ELSE 
           'Fixes problem with client machines not showing up on the server due to imaging method
           objRegistry.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,"SusClientId"
           objRegistry.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,"SusClientIdValidation"

  Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service where Name = 'wuauserv'")

  For Each objService in colServiceList
   If objService.State = "Running" Then
   objService.StopService()
   Wscript.Sleep 10000
   objService.StartService()
   End If
  Next
  
           objShell.Run("wuauclt /resetauthorization /detectnow ")
  	    Wscript.Sleep 10000   
           objShell.Run("wuauclt /r /reportnow")

           'Set reg value for SUSClientIdReset for checking against later.
  dwValue = "5"
           objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
End If

  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...