I am trying to update the WSUS AUOption on a list of computers by IP. I have the code for this that functions but it requires me to have already made a connection through regedit to this computer and that isn't helping much since I might as well import the changes there if I have to do that. I'm wondering if anyone has any ideas for validating a local admin credentials via another method. Posted my code below.
#RequireAdmin
#include <File.au3>
#include <MsgBoxConstants.au3>
Local $aArray = FileReadToArray("C:\Users\Desktop\IPlist.txt")
Local $iLineCount = @extended
If @error Then
MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file.
Else
For $i = 0 To $iLineCount - 1 ; Loop through the array. UBound($aArray) can also be used.
MsgBox($MB_SYSTEMMODAL, "", $aArray[$i]) ; Display the contents of the array.
RegWrite("\\" & $$aArray[$i] & "\" & "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", "AUOptions", "REG_DWORD", "00000004")
Next
EndIf