Jump to content

IcemanND

Patron
  • Posts

    3,252
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Posts posted by IcemanND

  1. Put your list of approved updates in an array or dictionary object, then modify the following section to see if the needed update is in array or dictionary object. If it is let it be added to the updatesToDownload object, if it is not then skip it. Only need to maintain a list of updates then don't have to download and maintain a folder somewhere full of updates to install.

    Or you could do the inverse and only have a list of updates you do not want installed.

    WScript.Echo vbCRLF & "Creating collection of updates to download:"
    Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
    For I = 0 to searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    WScript.Echo I + 1 & "> adding: " & update.Title
    updatesToDownload.Add(update)
    Next

  2. Pulls missing updates from Microsoft (or WSUS if configured for it) and installs:

    Set updateSession = CreateObject("Microsoft.Update.Session")
    Set updateSearcher = updateSession.CreateupdateSearcher()

    WScript.Echo "Searching for updates..." & vbCRLF

    Set searchResult = _
    updateSearcher.Search("IsInstalled=0 and Type='Software'")

    WScript.Echo "List of applicable items on the machine:"

    For I = 0 To searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    WScript.Echo I + 1 & "> " & update.Title
    Next

    If searchResult.Updates.Count = 0 Then
    WScript.Echo "There are no applicable updates."
    WScript.Quit
    End If

    WScript.Echo vbCRLF & "Creating collection of updates to download:"

    Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")

    For I = 0 to searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    WScript.Echo I + 1 & "> adding: " & update.Title
    updatesToDownload.Add(update)
    Next

    WScript.Echo vbCRLF & "Downloading updates..."

    Set downloader = updateSession.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

    Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")

    WScript.Echo vbCRLF & _
    "Creating collection of downloaded updates to install:"

    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
    updatesToInstall.Add(update)
    End If
    Next

    WScript.Echo "Installing updates..."
    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

  3. So let me make sure I het what you are trying to do. You install Windows 7 on a machine, customize it as needed and sys prep it with your unattend.XML file then capture a WIM image of it. Then you want to deploy that WIM to another machine and after applying the image modify the unattend.XML file with different values before the mini-setup and oobe run?

    If that sums up what you want to do then the answer is yes you can do that. Some changes to the unattend.XML file may not apply depending upon what phase the change is being made in. You should not have any issues changes settings within the OOBE pass of the answer file.

  4. Tripredacus - thinking I should just add another page to deal specifically with Windwos 7 and the system reserved partition. If you look at the sample script for windows 7 dual partition you see that both partitions are primary partitions. If you make the OS partition the active during sysprep does it modify the reserved partition to hold the boot info or does it place it on the os partition since that is the bootable partition? In my experiences so far i has ignored the reserved parititon altogether which is why I run bcdboot to recreate the BCD records on the appropriate partition.

  5. You will need to check the EULA for the WAIK to make sure you are not in violation of it but that being said you may be able to use Windows Imaging.

    If you use the backup & restore before putting any data on the machine you could accomplish the same thing.

    Guide to using WAIK to make image of system:

  6. Long ago in a land far, far, away....oh wait wrong story, but close, I wrote the tutorial here on MSFN for using Vista PE (PE 2.0) to image XP using WIMs. Well here is the updated document using Windows 7. While originally tailored to imaging Windows XP, the same process applies for imaging Vista and Windows 7.

    As always if you have additions, changes, find errors, etc. let me know and I'll update as appropriate and give credit where due.

    Creating WIM Images for System Deployment Using Windows 7 PE 3.0.pdf

    Link to Vista PE post: http://www.msfn.org/...post__p__674778

  7. Microsoft has made this very easy with Windows 7. I have an 7 image that to date I have deployed to more than 12 different models of machine including desktop and laptop.

    What I did is create my base image with no additional drivers, I build my images in VMWare Workstation. Once I had all the software installed and the OS configured as desired I copied my drivers to a subfolder in c:\windows\inf. Then I captured my WIM image.

    After the image was captured I've installed the necessary mass storage drivers use DISM and the offline driver install method.

    For deployment I create the 100 mb system reserved partition, then the rest of the drive and deploy only the Windows partition to the large partition. Then I run BCDBOOT to update the system reserved partition with the needed BCD information. All of our laptops are encrypted with Bitlocker so this makes that step easier. You can use this same method to deploy to a single partition also.

×
×
  • Create New...