Jump to content


anyweb

How can I forcefully upgrade Windows 7 or Windows 10 to the latest version of Windows 10 using System Center Configuration Manager (Current Branch)?

Recommended Posts

you'd just have to add a delay function on the associated button, either in the wrapper or the HTA itself

Share this post


Link to post
Share on other sites


Hi

I was just about to create a similar script and found this, great work. Just tested and fond that i needed to remove the "" on the boolean on the reboot check: If objSysInfo.RebootRequired = "False" then  and on the ac check: If objItem.Discharging = "False" then

Share this post


Link to post
Share on other sites
I was just about to create a similar script and found this, great work. 

thanks,

 

also, I just checked the script, seems fine, those commands you mention are simply to help 'test' or 'debug' the script they don't change the functionality, look again at it.. so was it indeed this or something else you are referring to ?

debug.png

cheers

niall

Share this post


Link to post
Share on other sites
On 17/10/2017 at 8:44 PM, anyweb said:

you'd just have to add a delay function on the associated button, either in the wrapper or the HTA itself

Hi,
I've tried to add the timer to the HTA file for the 'Upgrade now' button but it failed. Could you please advise?

Sub run_vbscript_button
        Dim oShell, scriptPath, appCmd
        Set oShell  = CreateObject("WScript.Shell")
        UpgradeLog.WriteLine TimeStamp & " " & "Upgrade tonight,New Sub running"
            'window.resizeTo 500,450    
            call ResizeWindow(425,335,500,535)
                Window.moveTo100,100
            ' check if timer value exists 
            str = ReadReg ("HKEY_CURRENT_USER\SOFTWARE\windows-noob\Timer")
                If str = "NotFound"then
                    'msgbox "timer value was not found, setting default value"
                    UpgradeLog.WriteLine TimeStamp & " " & "Timer value not found in registry, setting to default value"
                    pbWaitTime        = 120    ' How many seconds the progress bar lasts (2 mins)
                else
                    'msgbox "Found timer value: " & str
                    UpgradeLog.WriteLine TimeStamp & " " & "Timer value found in registry, converting it to seconds"
                    ' convert it to seconds
                    pbWaitTime = HMStoSec(str) ' How many seconds the progress bar lasts
                    UpgradeLog.WriteLine TimeStamp & " " & "Timer value = " & str
                EndIf
            
                ' Progress Bar Settings 2 mins below
                pbHeight        = 10        ' Progress bar height
                pbWidth            = 380        ' Progress bar width
                pbUnloadedColor    ="white"    ' Color of unloaded area
                pbLoadedColor    ="black"    ' Color of loaded area
                pbBorder        ="grey"        ' Color of Progress bar border
                
                ' Don't edit these things
                pbStartTime = Now
                rProgressbar
                pbTimerID = window.setInterval("rProgressbar", 200)
                ifDateDiff("s",pbStartTime,Now) >= pbWaitTimethen
                UpgradeLog.WriteLine TimeStamp & " " & "The timer has reached 00:00:00 FORCED, passing error code 0 to the Task sequence"
                UpgradeLog.WriteLine TimeStamp & " " & "Either the user accepted the files saving to the H drive check box and clicked Upgrade Now, or the popup ran out of time, see previous line in this log to find out. Starting Task sequence"
                call WriteRegistry("HKCU\Software\windows-noob\UpgradeComputer","Upgrade_Forced")
                call ExitHTA()
                endif

Edited by semoca

Share this post


Link to post
Share on other sites

what do you mean it failed, do you get an error, if so what error and what functions did you add to the hta ?

Share this post


Link to post
Share on other sites
1 hour ago, anyweb said:

what do you mean it failed, do you get an error, if so what error and what functions did you add to the hta ?

Hi,

This is the error I got

 

image.png.8f245275a8661b211eb8a964d68c218d.png

Share this post


Link to post
Share on other sites
14 hours ago, anyweb said:

I was just about to create a similar script and found this, great work. 

thanks,

 

also, I just checked the script, seems fine, those commands you mention are simply to help 'test' or 'debug' the script they don't change the functionality, look again at it.. so was it indeed this or something else you are referring to ?

debug.png

cheers

niall

Hi

Sorry i may have been unclear. I have outlined with red where i needed to remove the quotes. Example a computer testing With: msgbox "Reboot required? " & objSysInfo.RebootRequired i get the output false (computer does not have a pending reboot). On the next line using If objSysInfo.RebootRequired = "False"  if fails to eq "False" to False. The result is a reboot on a computer tha does not have pending reboot.

The same goes for the "False" in the line  If objItem.Discharging = "False" then

false.png

Share this post


Link to post
Share on other sites

please download the scripts again, i can see you are using an older version, and the version i have has improvements/corrections and does not have that issue

Share this post


Link to post
Share on other sites

Good morning!

 

So I´m curious about the check for model support.. I´m trying to run the deployment on a HP Elitebook 9470 but failed with message saying its not a supported model.. However, I can´t seem to find this model being listed in the wrapper.vbs

am I missing something? 

Share this post


Link to post
Share on other sites

you just need to add the model to the model supported check, or rem out that group entirely and move it to the task sequence, it's up to you

Share this post


Link to post
Share on other sites

Naill,

Do you have a sample o the preparation instructions that you have the users click on? The link in the hta goes no where, just curious what you are documenting for your users?

Thanks.

Share this post


Link to post
Share on other sites

hi,

I can't share it sorry, but I can give you an idea of what it contains, via these pointers *below*, you'll have to go and create one yourself for your Company

cheers

Niall <-

  • Known software Incompatibilities
  • Hardware requirements
  • Preparation
  • Required upgrade to the latest Windows 10 version 1709
  • What to do when the upgrade is completed
  • Windows 10 features
  • Incidents and issues

Share this post


Link to post
Share on other sites

No worries, I think i have most of this covered. Just curious what do you mean by:

  • Required upgrade to the latest Windows 10 version 1709
     

Share this post


Link to post
Share on other sites

Another question about the upgrade.hta file. Just modifying the text in the file to meet out needs. When executing the HTA file it loads and I have the option to select the checkbox and upgrade now or defer, if I click defer the registry entries are created which is good, but when I load the file again after making some additional adjustments the number of deferals is still listed as 5, it does not appear to be declining. Any thoughts on where to look or why this might be occurring. I can post the HTA file if needed. 

Share this post


Link to post
Share on other sites

when testing the HTA I copy the package to a virtual machine desktop, then cd to that folder, then start powershell, then start the powershell script from the powershell prompt, that should kick off the wrapper and launch the HTA,  you can then close the hta or defer and the values should be updated in the registry, try multiple times and each time it's launched the value should decrease by 1

Share this post


Link to post
Share on other sites

Hmmm, I've done that a few times but the HTA never loads, I'm assuming the powershell script that you are loading is the Start-Upgrade.ps1. I'll go back and do some more digging. Another question regarding UserIgnoringHTA, for testing purposes I lowered the threshold from 8 hrs to 5 minutes. The window moves as intended but then it closes right away, is this as intended? Would it not be better to move and then close if not touched after 5 minute. 

Share this post


Link to post
Share on other sites

once the threshold completes, it will close the HTA so yes, that is as per design, I initially wanted to move the window to the center of the screen and flash it on top of all other windows but didn't find a reliable way of doing it, and i'm not going to use third party tools to do so

 

if you use teamviewer I can remote in and have a look and see what's wrong with yours...

Share this post


Link to post
Share on other sites

Thanks, I found the problem my system was running 1607 and we are applying this to 1703. Once I changed the Target Build at the top to the correct build it all worked out. Now I'm just fighting  the pending reboot check and battery check as I am testing those functions out. The system does not seem to have a pending reboot and it moves on, but it says its on power when its really on battery and it keeps telling me the drive space is low when I have 100GB free.

I downloaded the scripts again, both have a date of 10/10 but I am noticing some differences when I compare the two, so looking for differences now.

 

Share this post


Link to post
Share on other sites

yeah there were some bug fixes on the scripts, but what is there now should do what it supposed to

Share this post


Link to post
Share on other sites

Yeah, found them but not where I was having problem, but it seems to work now. I could not make the VPN test work with Windows 10 as it was not coming back as 0.0.0.0. Ended up doing this and it seems to work.
        'Check for VPN
        'UpgradeLog.WriteLine TimeStamp & " " & "Checking for VPN connectivity..."    
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
        Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration")
        
        For Each objItem In colItems
            If(InStr(objItem.Description,"Cisco")) Then
                msgBox objItem.Description & " - Enabled: " & objItem.IPEnabled
                IsVPNConnected = objItem.IPEnabled  
            End If
        Next
        
        If(IsVPNConnected) Then
            'UpgradeLog.WriteLine TimeStamp & " " & "VPN found informing user..."    
            msgBox "Cisco VPN connection detected, please do not try to run the Windows 10 upgrade on a VPN connection. Try the upgrade in the office instead."
            AddRunOnce()
            Exit99
        Else
            msgBox "VPN not detected"
            'UpgradeLog.WriteLine TimeStamp & " " & "VPN not found..."
        End If
        
        'For Each objItem In colItems
        '    msgBox objItem.DefaultIPGateway
        '    strDefaultIPGateway = Join(objItem.DefaultIPGateway, ",")
        '    If strDefaultIPGateway = "0.0.0.0" Then
        '    'UpgradeLog.WriteLine TimeStamp & " " & "VPN found informing user..."    
        '        msgBox "Cisco VPN connection detected, please do not try to run the Windows 10 upgrade on a VPN connection. Try the upgrade in the office instead."
        '        AddRunOnce()
        '        Exit99
        '    Else
        '        'msgBox "VPN not detected"
        '        'UpgradeLog.WriteLine TimeStamp & " " & "VPN not found..."
        '    End If
        'Next

Share this post


Link to post
Share on other sites

the 0.0.0.0 is only for the vpn i tested with, you should customize that function to detect your own VPN solution, or just skip it

Share this post


Link to post
Share on other sites

Ok I think I have everything in place now. Starting the task sequence testing. A few quick questions:

  1. One you hit upgrade now you have a 4-hour timer, is that to allow for the files to be transferred to the computer or just to give the user some indication when the update will start?
  2. While not mentioned in your notes is there any advantage to setting the deployment options under Distribution Points?
    1. For example: Download all content locally before the task sequence starts?
  3. In the wrapper.vbs you reference the VPN, if the preface behind this to ensure the content is downloaded, would item 2.1 negate the need for testing for VPN connectivity?

For testing if you defer the update is there a way to force task to kick off again?

Share this post


Link to post
Share on other sites
26 minutes ago, webguy said:

Ok I think I have everything in place now. Starting the task sequence testing. A few quick questions:

  1. One you hit upgrade now you have a 4-hour timer, is that to allow for the files to be transferred to the computer or just to give the user some indication when the update will start?
  2. While not mentioned in your notes is there any advantage to setting the deployment options under Distribution Points?
    1. For example: Download all content locally before the task sequence starts?
  3. In the wrapper.vbs you reference the VPN, if the preface behind this to ensure the content is downloaded, would item 2.1 negate the need for testing for VPN connectivity?

For testing if you defer the update is there a way to force task to kick off again?

1. the 4 hours is to give the user time to finish their PowerPoint or meeting, and then start the upgrade with loads of time to spare, but at the same time to give them a sense of urgency

2. set them whatever way you want

3. VPN's can cause upgrade's to fail (lack of connection), hence the vpn check, it's better to do the upgrade in the office

to force it to run quickly I open a powershell cmd prompt on a vm, and start the powershell start... command to kick off the hta, that's a manual process but it allows you to test the flow so that you are happy with it

cheers

niall

Share this post


Link to post
Share on other sites

Just a note, I was running the CreateDeviceCollectionsWindows10.ps1 script in our lab and it fails to create the OSD collections. With the exception of the OSD Servicing Required Deployment collection. Looked at the script and there are when it tries to create OSD Limiting it is using itself as the limiting collectionbut it hasn't created it yet. Then of course any collection that needs OSD Limiting as the limiting collection also fails to create. 

Are there supposed to be queries or collections used in the OSD collections or are they blank.

Share this post


Link to post
Share on other sites

the script works for me every time in a lab, did you edit it in any way ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...