Jump to content

IcemanND

Patron
  • Posts

    3,252
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by IcemanND

  1. the ones using ghost use the VMDK (virtual machine disk file) instead of a GHO file. So they sysprep the VM after making changes and then run ghost and point to the VMDK instead of pointing to a GHO file. Believe this option was added with the ghost solution suite 2, might have been v2.5 though. They don't get the WIM at all I give them a clone of the VM.
  2. If I am using WIMs I create the master image in VMWare, and non boot critical drivers to a sub folder of c:\windows\inf, sysprep and capture a WIM. Then use DISM to inject the boot critical drivers. There are groups in my department that use my master VM and modify it and deploy it to their department machines and some of those still use Ghost, but I don't know that we have any machines that require any boot critical device drivers at boot up. I install the Intel chipset drivers to be on the safe side as all of our machines are Intel based Lenovo laptops or desktops.
  3. This is why I switched from using ghost to using WIMs. Much easier in Vista and Win7 to add the boot critical drivers via DISM to the WIM than to get them installed via Sysprep or any other method. On another note you can ghost from VMWare without any issue as long as the boot critical drivers are there. I build all of my images in VMWare and have deployed those images to physical hardware without any issue using both Ghost and WIM. Ghost makes it easy in that ou can use the VMDK directly instead of having to create the GHO file first.
  4. what virus/malware products do you have installed? Many can protect the home page on your browsers.
  5. you can cahange the name in the answer file in win7 before the machine completes the first boot and still have it join the domain with the changed name. not sure the exact timing, I change it before first boot after dropping the image to the machine.
  6. Really? You couldn't find a solution to this with a single google search? How do you want to do it? Vbscript, EXE, Startup script, remote admin connection, sneaker net? How secure does it need to be? Will it be the same for every machine? Do users on the machines have admin rights so it really doesn't make a difference anyway?
  7. Due to security restrictions I wouldn't have been able to use psexec. It would have been easier to allow standard users to be able to install printers but I couldn't do that either.
  8. I played around with impersonate settings and never found any that got it to work. It amazed me thenumber of posts I found out there of people wanting to do the same kind of thing and the only answer to them was to use startup scripts.
  9. Take away admin rights and just add standard users to the files/folders the users need for one. You could also look at Clean Slate, similar to DeepFreeze. But if the users have admin rights thy could probably disable the write filter just like they could with DeepFreeze. I've been running a couple of student labs for the last seven years or so and lock them down with DeepFreeze and not had a problem with students disabling it but they are standard users whenever possible. I'm looking at switching to Clean Slate next year as it has a litle more flexibility for my needs.
  10. Well after apparently stumping the community here and half a day of digging through Google search results it appears the the System account does not have rights when it come to creating a printer via WMI. Ended up changing the printer install section to use rundll32 printui.dll,PrintUIEntry instead and all is working great.
  11. Ok, further digging. It appears that when run under the System context it does not have permissions to add the printer. My script above returns the same error if I run it manually from a CMD window launched under the System context. The Microsoft provided PRNMNGR.VBS script returns a 80041003 access denied error as does the below vbs script that is the base script for the autoit script and pulled originally from the Scripting Guys. The error is return by the last line. strComputer = "." Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate, (LoadDriver)}!\\" & strComputer & "\root\cimv2") set objNewPort = objWMIService.get("Win32_TCPIPPrinterPort").SpawnInstance_ Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_ objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True Set objDriver = objWMIService.Get("Win32_PrinterDriver") PrinterDriverFriendlyName = "Xerox Global Print Driver PS" PrinterPortName = "Xrx4050.CC.nd.edu" DisplayName = "OIT XRX 4050" '********* Installs Printer Driver ************ objDriver.Name = PrinterDriverFriendlyName objDriver.SupportedPlatform = "Windows NT x86" objDriver.Version = "3" intResult = objDriver.AddPrinterDriver(objDriver) '********* Installs Printer Port ********* objNewPort.Name = PrinterPortName objNewPort.Protocol = 1 objNewPort.HostAddress = PrinterPortName objNewPort.PortNumber = 9100 objNewPort.SNMPEnabled = True objNewPort.Put_ '********* Install Printer ********* objPrinter.DriverName = PrinterDriverFriendlyName objPrinter.PortName = PrinterPortName objPrinter.DeviceID = DisplayName objPrinter.Location = "" objPrinter.Network = True objPrinter.Put_
  12. I have an AutoIt script I wrote so that users can select printers to install from a treeview list. The installer works great if run manually and the user has admin rights and can elevate. However if I advertise it to systems via SCCM it will only install the TCP/IP port and the printer driver, when it reaches the point to install the printer it fails with an WMI access denied error. The script is running under the System account so permissions should not really be an issue. Any SCCM experts out there, or anyone have any ideas? Below is the source code. And before anyone suggests it, I do not have a print server therfore i cannot advertise printers via AD, or any of those other much easier methods of getting printers on machine which are on a shared system such as GPO preferences. They are all direct connected TCP/IP printers. I've not tried running this specific version of the script via a startup script but have used pieces of it in the past so that part works. edit: I forgot to mention, no I will not be able to give standard users rights to install printers. Edit: code replaced with final code, compiled EXE posted. An other information. As I said in my post I found a solution, apparently NT Authority/System apparently does not have Write permissions to Win32_Printer in WMI. So the following piece of code to install the printer had to be change from using WMI to us the printui.dll entry point. Func InstallPrinter($oemDriverName, $strNewPortName, $strPrinterName, $strPrinterLocation ="", $strComment = "", $Default = "False") ConsoleWrite($oemDriverName & " " & $strNewPortName & " " & $strPrinterName & " " & $strPrinterLocation & " " & $strComment & " " & $Default & @CRLF) $OBJPRINTER.DriverName = $oemDriverName $OBJPRINTER.PortName = $strNewPortName $OBJPRINTER.DeviceID = "myprinter";$strPrinterName ;$OBJPRINTER.Location = $strPrinterLocation ;$OBJPRINTER.Comment = $strComment $OBJPRINTER.Network = True ConsoleWrite("Printer Install Result: " & $OBJPRINTER.Put_) ConsoleWrite(@CRLF) If StringUpper($Default) = "TRUE" Then $OBJPRINTER.SetDefaultPrinter() EndIf EndFunc ;==>InstallPrinter Final code: #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=NetPrinter.ico #AutoIt3Wrapper_outfile=PrinterInstaller.exe #AutoIt3Wrapper_Res_Comment=Multiple printer Installer #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=2010 University of Notre Dame #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "_XMLDomWrapper3.0.au3" #include <Process.au3> #include <GUIConstants.au3> #include <GuiConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <GuiMenu.au3> #include <WinAPI.au3> AutoItSetOption("ExpandEnvStrings", 1) #Region Declarations Const $TVM_GETITEM = $TV_FIRST + 12 Global $STRCOMPUTER = "." Global $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Global $colPrinters = $objWMIService.ExecQuery("Select * from Win32_Printer") Global $colTCPPorts = $objWMIService.ExecQuery("Select * from Win32_TCPIPPrinterPort") $objWMIService.Security_.Privileges.AddAsString("SeLoadDriverPrivilege", True) Global $colPrintersDrivers = $objWMIService.ExecQuery("Select * from Win32_PrinterDriver") Global $arrPrinters[$colPrinters.Count][5] If $colTCPPorts.Count > 0 Then Global $arrTCPPorts[$colTCPPorts.Count][5] Else Global $arrTCPPorts[1][4] $arrTCPPorts[0][1] = "None" EndIf Global $arrInstalledDrivers[$colPrintersDrivers.count][4] Global $OBJNEWPORT = $objWMIService.get("Win32_TCPIPPrinterPort" ).SpawnInstance_ Global $OBJPRINTER = $objWMIService.Get("Win32_Printer" ).SpawnInstance_ Global $OBJDRIVER = $objWMIService.Get("Win32_PrinterDriver") Global $arrNewPorts[1][5] Global $arrNewDrivers[1][7] Global $arrNewPrinters[1][4] Global $AutoInstall Global $WindowTitle Global $fDblClk Global $structPrinter Local $STR = "char[256];char[256];char[256];char[256];uint;char[5];char[256];char[256];char[256];uint;char[256];uint;char[5];char[5];char[256];char[256];char[256];char[5];char[5]" Global $Printers[1] Global $Parent[1] Global $Child[1] Global $parentCHK[1] Global $ChildCHK[1] Global $ConfigSettings if $cmdline[0] = 0 then $ConfigSettings = "PrinterInstaller.xml" else $ConfigSettings = $cmdline[1] EndIf LoadSettings($ConfigSettings) $Parent[0] = UBound($Parent) - 1 GetInstalledPrinterInfo() Local $Parent_Split = $Parent Local $btnInstall Local $mnuFile Local $mnuExit Local $mnuPorts Local $mnuAllPorts, $mnuNewPorts Local $mnuDrivers Local $mnuAllDrivers, $mnuNewDrivers Local $mnuPrinters Local $mnuAllPrinters, $mnuNewPrinters Local $mnuHelp Local $mnuAbout #EndRegion Declarations #Region MAIN Global $mainWindow = GUICreate($WindowTitle, 460, 330) $mnuFile = GUICtrlCreateMenu("&File") $mnuExit = GUICtrlCreateMenuItem("Exit", $mnuFile) $mnuPorts = GUICtrlCreateMenu("&Ports") $mnuListPorts = GUICtrlCreateMenuItem("List Installed TCP Ports", $mnuPorts) $mnuNewPorts = GUICtrlCreateMenuItem("List TCP Ports to Install", $mnuPorts) $mnuAllPorts = GUICtrlCreateMenuItem("Install All Ports", $mnuPorts) $mnuDrivers = GUICtrlCreateMenu("&Drivers") $mnuListDrivers = GUICtrlCreateMenuItem("List Installed Drivers", $mnuDrivers) $mnuNewDrivers = GUICtrlCreateMenuItem("List Drivers to Install", $mnuDrivers) $mnuAllDrivers = GUICtrlCreateMenuItem("Install All Drivers", $mnuDrivers) $mnuPrinters = GUICtrlCreateMenu("&Printers") $mnuListPrinters = GUICtrlCreateMenuItem("List Installed Printers", $mnuPrinters) $mnuNewPrinters = GUICtrlCreateMenuItem("List Printers to Install", $mnuPrinters) $mnuAllPrinters = GUICtrlCreateMenuItem("Install All Printers", $mnuPrinters) $mnuHelp = GUICtrlCreateMenu("&Help") $mnuAbout = GUICtrlCreateMenuItem("&About", $mnuHelp) Global $TreeView = GUICtrlCreateTreeView(10, 10, 440, 250, BitOR($GUI_SS_DEFAULT_TREEVIEW, $TVS_CHECKBOXES), $WS_EX_DLGMODALFRAME + $WS_EX_CLIENTEDGE) GUICtrlSetFont(-1, 12) $btnInstall = GUICtrlCreateButton("Install", 10, 270, 440, 30) GUICtrlSetFont(-1, 14, 800) Dim $Tree_Parent_Split[$Parent_Split[0] + 1] $z = 0 For $X = 1 To $Parent_Split[0] $Tree_Parent_Split[$X] = GUICtrlCreateTreeViewItem($Parent_Split[$X], $TreeView) If $parentCHK[$X] Then GUICtrlSetState(-1, $GUI_CHECKED) $Child_Split = StringSplit($Child[$X], "|") Dim $Tree_Child_Split[$Child_Split[0] + 1] For $y = 1 To $Child_Split[0] $z += 1 $Tree_Child_Split[$y] = GUICtrlCreateTreeViewItem($Child_Split[$y], $Tree_Parent_Split[$X]) If $ChildCHK[$z] Or $parentCHK[$X] Then GUICtrlSetState(-1, $GUI_CHECKED) Next Next If StringUpper($AutoInstall) = "TRUE" Then InstallPrinters() Exit (0) EndIf GUISetState() GUIRegisterMsg($WM_NOTIFY, "MY_WM_NOTIFY") frmMainWinProc() GUIRegisterMsg($WM_NOTIFY, "") #EndRegion MAIN Func InstallPrinters() ConsoleWrite("List Count: " & _GUICtrlTreeView_GetCount($TreeView) & @CRLF) ConsoleWrite("list start: " & $TreeView & @CRLF) Local $ListItem = 0 For $X = $TreeView + 2 To $TreeView + _GUICtrlTreeView_GetCount($TreeView) + 1 SplashTextOn ("Installing Selected printers", "Installing printer: " & _GUICtrlTreeView_GetText($TreeView, $X),200,100) ConsoleWrite("Index: " & $X & " Text:" & _GUICtrlTreeView_GetText($TreeView, $X) & " checked: " & _GUICtrlTreeView_GetChecked($TreeView, $X) & " Parent: " & _GUICtrlTreeView_GetParentHandle($TreeView, $X) & " My Handle: " & _GUICtrlTreeView_GetItemHandle($TreeView, $X) & @CRLF) if (_GUICtrlTreeView_GetParentHandle($TreeView, $X) <> 0) And _GUICtrlTreeView_GetChecked($TreeView, $X) Then $ListItem += 1 ConsoleWrite("Install: " & $X & @CRLF) if (Not CheckForDriver(DllStructGetData($Printers[$ListItem], 3))) Or DllStructGetData($Printers[$ListItem], 14) Then InstallDriver(DllStructGetData($Printers[$ListItem], 3), DllStructGetData($Printers[$ListItem], 4), DllStructGetData($Printers[$ListItem], 5), DllStructGetData($Printers[$ListItem], 6), DllStructGetData($Printers[$ListItem], 7), DllStructGetData($Printers[$ListItem], 8), DllStructGetData($Printers[$ListItem], 15)) EndIf InstallNewPort(DllStructGetData($Printers[$ListItem], 9), DllStructGetData($Printers[$ListItem], 10), DllStructGetData($Printers[$ListItem], 11), DllStructGetData($Printers[$ListItem], 12), DllStructGetData($Printers[$ListItem], 13)) InstallPrinter(DllStructGetData($Printers[$ListItem], 3), DllStructGetData($Printers[$ListItem], 9), DllStructGetData($Printers[$ListItem], 2), DllStructGetData($Printers[$ListItem], 16), DllStructGetData($Printers[$ListItem], 17), DllStructGetData($Printers[$ListItem], 18)) ElseIf _GUICtrlTreeView_GetParentHandle($TreeView, $X) <> 0 Then $ListItem += 1 EndIf Next SplashOff() EndFunc ;==>InstallPrinters Func CheckForDriver($FindMe) If _ArraySearch($arrInstalledDrivers, $FindMe, 0, 0, 0, 0, 1, 0) = -1 Then ConsoleWrite("CheckForDriver: False" & @CRLF) Return False Else ConsoleWrite("CheckForDriver: True" & @CRLF) Return True EndIf EndFunc ;==>CheckForDriver Func GetInstalledPrinterInfo() Local $X = -1 ;~ $arrPrinters[$X][0] = "Name" ;~ $arrPrinters[$X][1] = "PortName" ;~ $arrPrinters[$X][2] = "DriverName" ;~ $arrPrinters[$X][3] = "Location" ;- $arrPrinters[$X][4] = "Comment" For $InstPrinter In $colPrinters $X += 1 $arrPrinters[$X][0] = $InstPrinter.Name $arrPrinters[$X][1] = $InstPrinter.PortName $arrPrinters[$X][2] = $InstPrinter.DriverName $arrPrinters[$X][3] = $InstPrinter.Location $arrPrinters[$X][4] = $InstPrinter.Comment Next $X = -1 ;~ $arrTCPPorts[$x][0] = "Caption" ;~ $arrTCPPorts[$x][1] = "Protocol" ;~ $arrTCPPorts[$x][2] = "HostAddress" ;~ $arrTCPPorts[$x][3] = "PortNumber" ;~ $arrTCPPorts[$x][4] = "SNMPEnabled" For $instTCPPorts In $colTCPPorts $X += 1 $arrTCPPorts[$X][0] = $instTCPPorts.Caption $arrTCPPorts[$X][1] = $instTCPPorts.Protocol $arrTCPPorts[$X][2] = $instTCPPorts.HostAddress $arrTCPPorts[$X][3] = $instTCPPorts.PortNumber $arrTCPPorts[$X][4] = $instTCPPorts.SNMPEnabled Next $X = -1 ;~ $arrInstalledDrivers[$x][0] = "Driver Name" ;~ $arrInstalledDrivers[$x][1] = "Type" ;~ $arrInstalledDrivers[$x][2] = "Targetted OS" For $InstalledPrinterDriver In $colPrintersDrivers $X += 1 $arrTemp = StringSplit($InstalledPrinterDriver.name, ",") $arrInstalledDrivers[$X][0] = $arrTemp[1] $arrInstalledDrivers[$X][1] = $arrTemp[2] $arrInstalledDrivers[$X][2] = $arrTemp[3] Next EndFunc ;==>GetInstalledPrinterInfo Func InstallNewPort($strNewPortName, $strProtocol, $strHostAddress, $strPortNumber, $strSNMPEnabled) ConsoleWrite($strNewPortName & " " & $strProtocol & " " & $strHostAddress & " " & $strPortNumber & " " & $strSNMPEnabled & @CRLF) If $strHostAddress = "" Then $strHostAddress = $strNewPortName EndIf $RECONFIGURED = True $OBJNEWPORT.Name = $strNewPortName $OBJNEWPORT.Protocol = $strProtocol $OBJNEWPORT.HostAddress = $strHostAddress $OBJNEWPORT.PortNumber = $strPortNumber $OBJNEWPORT.SNMPEnabled = $strSNMPEnabled ConsoleWrite("Port install result: " & $OBJNEWPORT.Put_) ConsoleWrite(@CRLF) EndFunc ;==>InstallNewPort Func InstallDriver($oemDriverName, $Platform, $Version, $CopyLocal, $Source, $Destination, $INFName) ConsoleWrite($oemDriverName & " " & $Platform & " " & $Version & " " & $CopyLocal & " " & $Source & " " & $Destination & " " & $INFName & @CRLF) If $CopyLocal = True Then ConsoleWrite('xcopy "' & $Source & "\*.*" & '" "' & $Destination & '\" /e /y /g /h /r /z' & @CRLF) _RunDOS('xcopy "' & $Source & "\*.*" & '" "' & $Destination & '\" /e /y /g /h /r /z') EndIf $OBJDRIVER.Name = $oemDriverName $OBJDRIVER.SupportedPlatform = $Platform $OBJDRIVER.Version = $Version If $CopyLocal Then $OBJDRIVER.Filepath = StringReplace($Destination, "\", "\\") Else $OBJDRIVER.Filepath = StringReplace($Source, "\", "\\") EndIf $OBJDRIVER.InfName = $OBJDRIVER.Filepath & "\\" & $INFName ConsoleWrite($OBJDRIVER.Name & " " & $OBJDRIVER.SupportedPlatform & " " & $OBJDRIVER.Version & " " & $OBJDRIVER.Filepath & " " & $OBJDRIVER.InfName & @CRLF) ConsoleWrite("Driver Install result: " & $OBJDRIVER.AddPrinterDriver($OBJDRIVER)) ConsoleWrite(@CRLF) EndFunc ;==>InstallDriver Func InstallPrinter($oemDriverName, $strNewPortName, $strPrinterName, $strPrinterLocation ="", $strComment = "", $Default = "False") ConsoleWrite($oemDriverName & " " & $strNewPortName & " " & $strPrinterName & " " & $strPrinterLocation & " " & $strComment & " " & $Default & @CRLF) local $cmdLine = "rundll32 printui.dll,PrintUIEntry /if /b " & chr(34) & $strPrinterName & chr(34) & " /r " & chr(34) & $strNewPortName & chr(34) & " /m " & chr(34) & $oemDriverName & chr(34) & " /q " If StringUpper($Default) = "TRUE" Then $cmdLine &= " /y " EndIf ConsoleWrite (@crlf & $cmdline & @crlf) _RunDOS ($cmdLine) if $strComment<>"" and $strComment<>0 then $cmdline = "rundll32 printui.dll,PrintUIEntry /Xs /n " & chr(34) & $strPrinterName & chr(34) & " comment " & chr(34) & $strComment & chr(34) ConsoleWrite (@crlf & $cmdline & @crlf) _RunDOS ($cmdLine) EndIf if $strPrinterLocation<>"" and $strPrinterLocation<>0 then $cmdline = "rundll32 printui.dll,PrintUIEntry /Xs /n " & chr(34) & $strPrinterName & chr(34) & " location " & chr(34) & $strPrinterLocation & chr(34) ConsoleWrite (@crlf & $cmdline & @crlf) _RunDOS ($cmdLine) EndIf EndFunc ;==>InstallPrinter Func LoadSettings($XMLFile) ConsoleWrite($XMLFile & " ") Local $sFile = $XMLFile If FileExists($sFile) Then ConsoleWrite("Found ") Local $ret = _XMLFileOpen($sFile) ConsoleWrite($ret & " " & @error & " " & @extended & @CRLF) If $ret = 0 Then MsgBox(1 + 48 + 262144, "File Open Error", "Unable to open selected configuration file") Return 0 EndIf If _XMLNodeExists("/PrinterGroups/Group") Then $WindowTitle = _xmlgetattrib("/PrinterGroups", "Name") ConsoleWrite("PrinterGroups/Group found" & " ") $AutoInstall = _xmlgetattrib("/PrinterGroups", "AUTO") Local $GroupCount = _XMLGetNodeCount("/PrinterGroups/Group[*]") ConsoleWrite($GroupCount & @CRLF) $z = 0 If $GroupCount > 0 Then For $X = 1 To $GroupCount Local $strChild = "" $GroupName = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]", "Name") _ArrayAdd($Parent, $GroupName) $GroupCHK = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]", "Checked") If StringUpper($GroupCHK) = "TRUE" Then _ArrayAdd($parentCHK, True) Else _ArrayAdd($parentCHK, False) EndIf Local $PrinterCount = _XMLGetNodeCount("/PrinterGroups/Group[" & $X & "]/Printer[*]") For $y = 1 To $PrinterCount _ArrayAdd($Printers, DllStructCreate($STR)) $z += 1 ConsoleWrite("structureset: " & DllStructSetData($Printers[$z], 1, $GroupName) & @CRLF) $PrinterName = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]", "DisplayName") ConsoleWrite(" DisplayName: " & DllStructSetData($Printers[$z], 2, $PrinterName) & @CRLF) $DefaultPrinter = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]", "Default") ConsoleWrite($DefaultPrinter & @CRLF) If StringUpper($DefaultPrinter) <> "TRUE" Then $DefaultPrinter = "False" ConsoleWrite(" Default: " & DllStructSetData($Printers[$z], 18, $DefaultPrinter) & @CRLF) $Checked = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]", "Checked") ConsoleWrite(" Checked: " & DllStructSetData($Printers[$z], 19, $Checked) & @CRLF) If StringUpper($Checked) = "TRUE" Then _ArrayAdd($ChildCHK, True) Else _ArrayAdd($ChildCHK, False) EndIf If $strChild = "" Then $strChild = $PrinterName Else $strChild = $strChild & "|" & $PrinterName EndIf $oemDriverName = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver", "OEMName") ConsoleWrite(" OemName: " & DllStructSetData($Printers[$z], 3, $oemDriverName) & @CRLF) $SupportedPlatform = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver/SupportedPlatform") ConsoleWrite(" SupportPlatform: " & DllStructSetData($Printers[$z], 4, $SupportedPlatform) & @CRLF) $Version = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver/Version") ConsoleWrite(" Version: " & DllStructSetData($Printers[$z], 5, $Version) & @CRLF) $CopyFiles = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver/Location", "CopyFiles") ConsoleWrite(" CopyFiles: " & DllStructSetData($Printers[$z], 6, $CopyFiles) & @CRLF) $Source = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver/Location/Source") ConsoleWrite(" Source: " & DllStructSetData($Printers[$z], 7, $Source) & @CRLF) $Destination = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver/Location/Destination") ConsoleWrite(" Destination: " & DllStructSetData($Printers[$z], 8, $Destination) & @CRLF) $PortName = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Port", "Name") ConsoleWrite(" PortName: " & DllStructSetData($Printers[$z], 9, $PortName) & @CRLF) $Protocol = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Port/Protocol") ConsoleWrite(" Protocol: " & DllStructSetData($Printers[$z], 10, $Protocol) & @CRLF) $HostAddress = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Port/HostAddress") ConsoleWrite(" HostAddress: " & DllStructSetData($Printers[$z], 11, $HostAddress) & @CRLF) $PortNumber = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Port/PortNumber") ConsoleWrite(" PortNumber: " & DllStructSetData($Printers[$z], 12, $PortNumber) & @CRLF) $SNMPEnabled = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Port/SNMPEnabled") ConsoleWrite(" SNMPEnabled: " & DllStructSetData($Printers[$z], 13, $SNMPEnabled) & @CRLF) $UpdateDriver = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver/UpdateDriver") ConsoleWrite(" UpdateDriver: " & DllStructSetData($Printers[$z], 14, $UpdateDriver) & @CRLF) $INFName = _xmlgetattrib("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Driver", "INFName") ConsoleWrite(" INF Name: " & DllStructSetData($Printers[$z], 15, $INFName) & @CRLF) $Location = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Location") ConsoleWrite(" Location: " & DllStructSetData($Printers[$z], 16, $Location) & @CRLF) $Comment = _XMLGetFirstValue("/PrinterGroups/Group[" & $X & "]/Printer[" & $y & "]/Comment") ConsoleWrite(" Comment: " & DllStructSetData($Printers[$z], 17, $Comment) & @CRLF) Next ReDim $Child[$X + 1] $Child[$X] = $strChild Next EndIf EndIf EndIf Global $arrNewPorts[UBound($Printers) - 1][5] Global $arrNewDrivers[UBound($Printers) - 1][8] Global $arrNewPrinters[UBound($Printers) - 1][6] For $X = 1 To UBound($Printers) - 1 $arrNewPrinters[$X - 1][0] = DllStructGetData($Printers[$X], 2) ;$PrinterName $arrNewPrinters[$X - 1][1] = DllStructGetData($Printers[$X], 3) ;$oemDriverName $arrNewPrinters[$X - 1][2] = DllStructGetData($Printers[$X], 9) ;$PortName $arrNewPrinters[$X - 1][3] = DllStructGetData($Printers[$X], 16) ;$Location $arrNewPrinters[$X - 1][4] = DllStructGetData($Printers[$X], 17) ;$comment $arrNewPrinters[$X - 1][5] = DllStructGetData($Printers[$X], 18) ;$Default $arrNewDrivers[$X - 1][0] = DllStructGetData($Printers[$X], 3) ;$oemDriverName $arrNewDrivers[$X - 1][1] = DllStructGetData($Printers[$X], 5) ;version $arrNewDrivers[$X - 1][2] = DllStructGetData($Printers[$X], 4) ;$SupportedPlatform $arrNewDrivers[$X - 1][3] = DllStructGetData($Printers[$X], 6) ;$CopyFiles $arrNewDrivers[$X - 1][4] = DllStructGetData($Printers[$X], 7) ;$Source $arrNewDrivers[$X - 1][5] = DllStructGetData($Printers[$X], 8) ;$Destination $arrNewDrivers[$X - 1][6] = DllStructGetData($Printers[$X], 15) ;$INFName $arrNewDrivers[$X - 1][7] = DllStructGetData($Printers[$X], 14) ;$UpdateDriver $arrNewPorts[$X - 1][0] = DllStructGetData($Printers[$X], 9) ;$PortName $arrNewPorts[$X - 1][1] = DllStructGetData($Printers[$X], 10) ;$Protocol $arrNewPorts[$X - 1][2] = DllStructGetData($Printers[$X], 11) ;$HostAddress $arrNewPorts[$X - 1][3] = DllStructGetData($Printers[$X], 12) ;$PortNumber $arrNewPorts[$X - 1][4] = DllStructGetData($Printers[$X], 13) ;$SNMPEnabled ConsoleWrite("readback: " & $X & @CRLF & " " & DllStructGetData($Printers[$X], 1) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 2) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 3) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 4) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 5) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 6) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 7) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 8) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 9) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 10) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 11) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 12) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 13) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 14) & @CRLF) ConsoleWrite(" " & DllStructGetData($Printers[$X], 15) & @CRLF) Next EndFunc ;==>LoadSettings Func CheckChilds($nCtrl, $hItem, $nCheck) While $hItem > 0 $nItem = GetItemID($nCtrl, $hItem) $arr = GUICtrlRead($nItem, 1) GUICtrlSetState($nItem, $nCheck * - 3 + $GUI_UNCHECKED) ; Same like: GUICtrlSetState($nItem, BitOr(BitAnd($nCheck, $GUI_UNCHECKED), BitAnd($nCheck, $GUI_CHECKED))) $hChildItem = GUICtrlSendMsg($nCtrl, $TVM_GETNEXTITEM, $TVGN_CHILD, $hItem) If $hChildItem > 0 Then CheckChilds($nCtrl, $hChildItem, $nCheck) $hItem = GUICtrlSendMsg($nCtrl, $TVM_GETNEXTITEM, $TVGN_NEXT, $hItem) WEnd EndFunc ;==>CheckChilds Func GetParents($nCtrl, $hItem, $nCheck) While $hItem > 0 $hChildItem = GUICtrlSendMsg($nCtrl, $TVM_GETNEXTITEM, $TVGN_CHILD, $hItem) $nState = $nCheck * - 3 + $GUI_UNCHECKED $nCheckState = $nState If $hChildItem > 0 Then GetChilds($nCtrl, $hChildItem, $nCheckState) $nItem = GetItemID($nCtrl, $hItem) $arInfo = GUICtrlRead($nItem, 1) If $nCheckState Then GUICtrlSetState($nItem, $nState) Else GUICtrlSetState($nItem, $GUI_INDETERMINATE) EndIf $hItem = GUICtrlSendMsg($nCtrl, $TVM_GETNEXTITEM, $TVGN_PARENT, $hItem) WEnd EndFunc ;==>GetParents Func GetChilds($nCtrl, $hItem, ByRef $nCheck) While $hItem > 0 $nItem = GetItemID($nCtrl, $hItem) If Not BitAND(GUICtrlRead($nItem), $nCheck) Then $nCheck = 0 ExitLoop EndIf $hChildItem = GUICtrlSendMsg($nCtrl, $TVM_GETNEXTITEM, $TVGN_CHILD, $hItem) If $hChildItem > 0 Then GetChilds($nCtrl, $hChildItem, $nCheck) $hItem = GUICtrlSendMsg($nCtrl, $TVM_GETNEXTITEM, $TVGN_NEXT, $hItem) WEnd EndFunc ;==>GetChilds Func GetItemID($Ctrl, $hItem) $nID = 0 $hTree = ControlGetHandle("", "", $Ctrl) $TVITEM = DllStructCreate("uint;int;uint;uint;ptr;int;int;int;int;int") If @error Then ; DllStructDelete ($TVITEM) $TVITEM = 0 Return $nID EndIf DllStructSetData($TVITEM, 1, $TVIF_PARAM) DllStructSetData($TVITEM, 2, $hItem) $nResult = DllCall("user32.dll", "int", "SendMessage", "hwnd", $hTree, "int", $TVM_GETITEM, "int", 0, "ptr", DllStructGetPtr($TVITEM)) If ($nResult[0]) Then $nID = DllStructGetData($TVITEM, 10) EndIf ;DllStructDelete($TVITEM) Return $nID EndFunc ;==>GetItemID Func _XMLGetFirstValue($node) Local $ret_val = _XMLGetValue($node) If IsArray($ret_val) Then Return ($ret_val[1]) Else Return SetError(1, 3, 0) EndIf EndFunc ;==>_XMLGetFirstValue Func InstallAllPrinters() ConsoleWrite("Install All Printers" & @CRLF) For $X = 0 To UBound($arrNewPorts) - 1 SplashTextOn ("Instaling All ports", "Installing port " & $x +1 & " of " & UBound($arrNewPorts), 200,100) InstallNewPort($arrNewPorts[$X][0], $arrNewPorts[$X][1], $arrNewPorts[$X][2], $arrNewPorts[$X][3], $arrNewPorts[$X][4]) Next For $X = 0 To UBound($Printers) - 1 SplashTextOn ("Instaling All drivers", "Installing driver " & $x +1 & " of " & UBound($Printers), 200,100) if (Not CheckForDriver(DllStructGetData($Printers[$X], 3))) or (StringUpper(DllStructGetData($Printers[$X], 14)) = "TRUE") Then InstallDriver(DllStructGetData($Printers[$X], 3), DllStructGetData($Printers[$X], 4), DllStructGetData($Printers[$X], 5), DllStructGetData($Printers[$X], 6), DllStructGetData($Printers[$X], 7), DllStructGetData($Printers[$X], 8), DllStructGetData($Printers[$X], 15)) EndIf Next For $X = 0 To UBound($arrNewPrinters) - 1 SplashTextOn ("Instaling All printers", "Installing printer " & $x +1 & " of " & UBound($arrNewPrinters), 200,100) InstallPrinter($arrNewPrinters[$X][1], $arrNewPrinters[$X][2], $arrNewPrinters[$X][0], $arrNewPrinters[$X][3], $arrNewPrinters[$X][4], $arrNewPrinters[$X][5]) Next SplashOff() EndFunc ;==>InstallAllPrinters Func frmMainWinProc() While 1 $Msg = GUIGetMsg() If $Msg <> 0 And $Msg <> -11 Then ConsoleWrite($Msg) Select Case $Msg = $GUI_EVENT_CLOSE Or $Msg = $mnuExit ConsoleWrite("Exit" & @CRLF) ExitLoop Case $Msg = $mnuAllPorts ConsoleWrite("Install All Ports" & @CRLF) For $X = 0 To UBound($arrNewPorts) - 1 SplashTextOn ("Instaling All ports", "Installing port " & $x +1 & " of " & UBound($arrNewPorts), 200,100) InstallNewPort($arrNewPorts[$X][0], $arrNewPorts[$X][1], $arrNewPorts[$X][2], $arrNewPorts[$X][3], $arrNewPorts[$X][4]) Next SplashOff() Case $Msg = $mnuAllDrivers ConsoleWrite("Install All Drivers" & @CRLF) For $X = 0 To UBound($Printers) - 1 SplashTextOn ("Instaling All drivers", "Installing driver " & $x +1 & " of " & UBound($Printers), 200,100) if (Not CheckForDriver(DllStructGetData($Printers[$X], 3))) or (StringUpper(DllStructGetData($Printers[$X], 14)) = "TRUE") Then InstallDriver(DllStructGetData($Printers[$X], 3), DllStructGetData($Printers[$X], 4), DllStructGetData($Printers[$X], 5), DllStructGetData($Printers[$X], 6), DllStructGetData($Printers[$X], 7), DllStructGetData($Printers[$X], 8), DllStructGetData($Printers[$X], 15)) EndIf Next SplashOff() Case $Msg = $mnuAllPrinters InstallAllPrinters() Case $Msg = $mnuListPorts ConsoleWrite("List All Ports" & @CRLF) ;_ArrayDisplay ($arrTCPPorts) _ArrayDisplay($arrTCPPorts, "In use TCP Ports List", -1, 0, "|", "|", "Count|Caption|Protocol|Host Address|Port Number|SNMP Enabled") Case $Msg = $mnuListDrivers ConsoleWrite("List All Drivers" & @CRLF) ;_ArrayDisplay ($arrInstalledDrivers) _ArrayDisplay($arrInstalledDrivers, "In use Drivers List", -1, 0, "|", "|", "Count|Driver Name|Type|Targeted OS") Case $Msg = $mnuListPrinters ConsoleWrite("List All Printers" & @CRLF) ;_ArrayDisplay ($arrPrinters) _ArrayDisplay($arrPrinters, "Installed Printers List", -1, 0, "|", "|", "Count|Name|Port Name|Driver Name|Location") Case $Msg = $mnuNewPorts ConsoleWrite("List New Ports" & @CRLF) ;_ArrayDisplay ($arrNewPorts) _ArrayDisplay($arrNewPorts, "Installed TCP Ports List", -1, 0, "|", "|", "Count|Port Name|Protocol|Host Address|Port Number|SNMP Enabled") Case $Msg = $mnuNewDrivers ConsoleWrite("List New Drivers" & @CRLF) ;_ArrayDisplay ($arrNewDrivers) _ArrayDisplay($arrNewDrivers, "Installed Drivers List", -1, 0, "|", "|", "Count|Driver Name|Targeted OS|Version|Copy Files|Source|Destination|INF Name|Update Driver") Case $Msg = $mnuNewPrinters ConsoleWrite("List New Printers" & @CRLF) ;_ArrayDisplay ($arrNewPrinters) _ArrayDisplay($arrNewPrinters, "Installed Printers List", -1, 0, "|", "|", "Count|Name|Driver Name|Port Name|Location|Comment") Case $Msg = $mnuAbout ConsoleWrite("About" & @CRLF) SplashTextOn("About " & $WindowTitle, "Customizable Printer Installer" & @CRLF & @CRLF & "Author: Isaac Holmes" & @CRLF & @CRLF & "Version: 1.0.0" & @CRLF & @CRLF & "©2010 University of Notre Dame", 250, 200) Do $Msg = GUIGetMsg() Until $Msg = -7 SplashOff() Case $Msg >= $Tree_Parent_Split[1] If BitAND(GUICtrlRead($Msg), $GUI_INDETERMINATE) Then ContinueLoop; Do nothing when in indeterminate state $hItem = GUICtrlSendMsg($TreeView, $TVM_GETNEXTITEM, $TVGN_CARET, 0) ConsoleWrite($hItem & @CRLF) If $hItem > 0 Then $hChildItem = GUICtrlSendMsg($TreeView, $TVM_GETNEXTITEM, $TVGN_CHILD, $hItem) If $hChildItem > 0 Then CheckChilds($TreeView, $hChildItem, BitAND(GUICtrlRead($Msg), $GUI_CHECKED)) $hParentItem = GUICtrlSendMsg($TreeView, $TVM_GETNEXTITEM, $TVGN_PARENT, $hItem) If $hParentItem > 0 Then GetParents($TreeView, $hParentItem, BitAND(GUICtrlRead($Msg), $GUI_CHECKED)) EndIf Case $Msg = $btnInstall InstallPrinters() EndSelect If $fDblClk = True And _GUICtrlTreeView_GetParentHandle($TreeView, _GUICtrlTreeView_GetSelection($TreeView)) <> 0 Then $fDblClk = False ConsoleWrite("Double Clicked: " & _GUICtrlTreeView_GetText($TreeView, _GUICtrlTreeView_GetSelection($TreeView)) & " Parent: " & _GUICtrlTreeView_GetParentHandle($TreeView, _GUICtrlTreeView_GetSelection($TreeView)) & _ " My Handle: " & _GUICtrlTreeView_GetItemHandle($TreeView, _GUICtrlTreeView_GetSelection($TreeView)) & " Index: " & $x & @CRLF) for $x = 1 to ubound($Printers)-1 if DllStructGetData($Printers[$X], 2) = _GUICtrlTreeView_GetText($TreeView, _GUICtrlTreeView_GetSelection($TreeView)) then MsgBox(262208, _GUICtrlTreeView_GetText($TreeView, _GUICtrlTreeView_GetSelection($TreeView)) & " Information", _ "Printer:" & @CRLF & _ " Install Group: " & DllStructGetData($Printers[$X], 1) & @CRLF & _ " Friendly Name: " & DllStructGetData($Printers[$X], 2) & @CRLF & _ " Location: " & DllStructGetData($Printers[$X], 16) & @CRLF & _ " Comment: " & DllStructGetData($Printers[$X], 17) & @CRLF & _ @CRLF & "Driver:" & @CRLF & _ " Update Driver: " & DllStructGetData($Printers[$X], 14) & @CRLF & _ " INF Name: " & DllStructGetData($Printers[$X], 15) & @CRLF & _ " Printer Driver: " & DllStructGetData($Printers[$X], 3) & @CRLF & _ " Supported Platform: " & DllStructGetData($Printers[$X], 4) & @CRLF & _ " Version: " & DllStructGetData($Printers[$X], 5) & @CRLF & _ " Copy Files: " & DllStructGetData($Printers[$X], 6) & @CRLF & _ " Source: " & DllStructGetData($Printers[$X], 7) & @CRLF & _ " Destination: " & @CRLF & DllStructGetData($Printers[$X], 8) & @CRLF & _ @CRLF & "Port:" & @CRLF & _ " Name: " & DllStructGetData($Printers[$X], 9) & @CRLF & _ " Protocol: " & DllStructGetData($Printers[$X], 10) & @CRLF & _ " Host Address: " & DllStructGetData($Printers[$X], 11) & @CRLF & _ " Port Number: " & DllStructGetData($Printers[$X], 12) & @CRLF & _ " SNMP Enabled: " & DllStructGetData($Printers[$X], 13) & @CRLF) EndIf Next ElseIf $fDblClk = True Then $fDblClk = False EndIf WEnd EndFunc ;==>frmMainWinProc Func MY_WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return If DllStructGetData($tNMHDR, 3) = $NM_DBLCLK Then $fDblClk = True $tNMHDR = 0 EndFunc ;==>MY_WM_NOTIFY Anyone interested in using it but don't want to compile it or find all the include files here is the comiled script along with a sample configuration XML file. This can be used as a standalone program (admin rights or printer install rights required), an SMS/SCCM advertisement or assigned program, or startup script. Usage: PrinterInstaller.exe <ConfigFile.xml> If no config file is specified it will try to load settings from PrinterInstaller.xml as the defualt. PrinterInstaller.exe PrinterInstaller.xml Some additional documentation: DSS Printer Installer.pdf
  13. here's a list of software title most of which are able to clone a drive or make an image of a drive. Pick your posion and clone away.
  14. what kind of machine? Are you booting form CD or USB? does it work if you plug into a different USB port?
  15. How are you runing your post instal scripts? I run mine from a network share via the runonceex registry keys after an autoadmin login and the UAC never prompts me.
  16. you can get oldcmp to search and create reports of AD machines by your specific query. It also has the ablilty to move, remove, disable and who knows what else, not sure if it has the ability to move between domains or not but it has come in very handy. you can find it here: http://www.joeware.net/freetools/tools/oldcmp/index.htm
  17. Automatically Cc: All Mail You Send in Outlook To send a carbon-copy of all mail you send in Outlook to a particular email address: Select Tools | Rules and Alerts... from the menu.Click New Rule....Highlight Check messages after sending.Click Next >.Click Next > again to copy all mail you send.You can define any combination of criteria to copy only certain messages before clicking Next >. [*]If you specified no filtering criteria, click Yes.[*]Make sure Cc the message to people or distribution list is checked under Step 1: Select action(s).[*]Click people or distribution lists under Step 2: Edit the rule description.[*]Double-click contacts or lists from your address book or type an email address under To ->. Separate multiple addresses with semicolons (. [*]Click OK.[*]Click Next >.[*]Click Next > again.[*]Precede the email address already entered under Step 1: Specify a name for this rule with "Cc: ".[*]Click Finish.[*]Click OK.
  18. Your 32-bit applications install to "program files (x86)", only your native 64-bit applications will install to "program files"
  19. deacon: http://regularbc.org/deacon.htm devcon: http://support.microsoft.com/kb/311272/en-us jaclaz Stupid iPad and autocorrect. Yes devcon. Strange I don't have that driver in my images maybe it makes a difference with version or install method of vnc. I don't install it as a server.
  20. Drop the image to the new machine update as needed, recapture and deploy. There is a limit to the number of times you can sys prep an image so you may have issues depending upon how your image was first done.
  21. Well it is not from VLC, that is in my image but I don't have you mystery devices. You could use deacon from microsft to remove it via the command line.
  22. Place a text file in the same folder as the script, the text file should only contain the numberical portion of the KB article number, one number per line. WARNING: Untested Const ForReading = 1 Set objSearcher = CreateObject("Microsoft.Update.Searcher") Set DeniedUpdates = CreateObject("Scripting.Dictionary") set objFSO = CreateObject("Scripting.FileSystemObject") DeniedUpdates.CompareMode = VBBinaryCompare Wscript.echo "Getting list of approved updates..." & VBCRLF set objFile = objFSO.OpenTextFile("approved.txt", ForReading) do until objFile.AtEndofStream fileLine = objFile.ReadLine if trim(fileLine)<> "" then ApprovedUpdates.add fileLine, fileLine loop objFile.Close Wscript.echo "Getting list of denied updates..." & vbcrlf set objFile = objFSO.OpenTextFile("denied.txt", ForReading) do until objFile.AtEndofStream fileLine = objFile.ReadLine if trim(fileLine)<> "" then DeniedUpdates.add fileLine, fileLine loop objFile.Close WScript.Echo "Searching for updates..." & vbCRLFSet Set objResults = objSearcher.Search("IsInstalled=0 and Type='Software'") Set colUpdates = objResults.Updates if colUpdates.count = 0 then Wscript.echo "No applicable updates to install." wscript.quit end if WScript.Echo vbCRLF & "Creating collection of updates to download:" Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl") For i = 0 to colUpdates.Count - 1 Wscript.Echo "Title: " & colUpdates.Item(i).Title Wscript.Echo "KB article: " & strArticle For Each strArticle in colUpdates.Item(i).KBArticleIDs if not DeniedUpdates.Exists(strArticle) then Wscript.Echo "Added to download list" updatesToDownload.Add(update) else Wscript.Echo "Update not added found on Denied List" end if Next Next WScript.Echo vbCRLF & "Downloading updates..." Set downloader = objSearcher.CreateUpdateDownloader() downloader.Updates = updatesToDownload downloader.Download() WScript.Echo vbCRLF & "List of downloaded updates:" For I = 0 To searchResult.Updates.Count-1 Set update = searchResult.Updates.Item(I) If update.IsDownloaded Then WScript.Echo I + 1 & "> " & update.Title End If Next WScript.Echo "Installing updates..." For I = 0 To searchResult.Updates.Count-1 set update = searchResult.Updates.Item(I) If update.IsDownloaded = true Then WScript.Echo I + 1 & "> adding: " & update.Title Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl") updatesToInstall.Add(update) Set installer = updateSession.CreateUpdateInstaller() installer.Updates = updatesToInstall Set installationResult = installer.Install() 'Output results of install WScript.Echo "Installation Result: " & installationResult.ResultCode WScript.Echo "Reboot Required: " & installationResult.RebootRequired & vbCRLF WScript.Echo "Listing of updates installed and individual installation results:" For I = 0 to updatesToInstall.Count - 1 WScript.Echo I + 1 & "> " & updatesToInstall.Item(i).Title & ": " & installationResult.GetUpdateResult(i).ResultCode Next End If Next
×
×
  • Create New...