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

hi Christian, it should send error code 0, but what this probably means is you've run the wrapper again after having succeeded and haven't fallen out of the collection yet (which you should do when on the right build)

you could add a step at the end of the task sequence to delete the computer from the collection, or update the collection membership rules/update frequency to exclude the desired build, that way you'll get the right exit code reported.

Share this post


Link to post
Share on other sites


Hi Niall!

I think the wrapper launched by itself very quickly after the upgrade (I thought this was only occuring at the scheduled time once a day?), so it reported code 99 before the computer had falled out of the collection. I have excluded the collection with the desired build with a frequency of every hour. So I'm not sure why the wrapper auto-launched so quick after the upgrade?

 

//Christian

Share this post


Link to post
Share on other sites

zip up and attach the logs in C:\ProgramData and i'll take a look at why it launched again,

did you use the same frequency in the deployment as i recommend (once a day @ 11am ?) ?

Share this post


Link to post
Share on other sites

so then it's doing what it should, exiting with code 99 as it sees that you are already at the desired build, if it exited with exit code 0 in this case then the task sequence would run again and you don't want that,

so in an ideal scenario, if the build is less than what it should be, it will exit code 0, and then run the task sequence, and drop from the collection before running the wrapper again the next day, you ran it manually and it correctly exited with exit code 99 as the build was already sufficient, if you look at the previous deployment history it would have been exit code 0

the reason it exit's with code 99 is because this program (the wrapper) is chained to the task sequence and must always run before the task sequence, therefore if you don't want the task sequence to run unnecessarily it exits with exit code 99

Share this post


Link to post
Share on other sites

I understand where you are going. The thing is that I started the wrapper manually at 12:42 and the upgrade was finished at 14:11 and it returned Exit code 0 to config mgr as successfully completed.  Here comes the strange behavior: then I logged on the computer to check things. Shortly after logging in , the wrapper seemed to launch automatically in the background at 14:13 without me knowing it and returned Exit code 99 to config mgr. I understand that this wrapper launch should not be happening until 11 AM next day (If it's still in the collection)

I will have to run some more tests to see if this behavior is consistent :)

 

 

Share this post


Link to post
Share on other sites

did you use the same username each time ? and if you remove the computer from the collection and update machine policy it should not occur as you experienced,. but it's good feedback :)

 

 

Share this post


Link to post
Share on other sites

no problem I want this to work as well as it possibly can so any feedback and ideas are welcome, I think i'll put together another blog post with the remove computer from collection and update machine policy steps added (time willing)

  • Like 1

Share this post


Link to post
Share on other sites

Hi, I first want to say thank you, for all of your articles they are wonderful and spot on.  

Is there a reason to run this as "run another program first" versus the 1st thing in the task sequence?

The reason I asked is I just opened a ticket with Microsoft and found out why my "pre-download content for this task sequence" stopped working, it use to download everything ahead of time until I added the script to run first.  They said that by design if you run a program first it will pre-download that program but will not do anything inside the task sequence since it does not know what the first program is supposed to do.

Wanted to touch base before I started to rework the script and the task sequence.

Thank you, 

Share this post


Link to post
Share on other sites
Hi, I first want to say thank you, for all of your articles they are wonderful and spot on.   

thanks i appreciate it !

Is there a reason to run this as "run another program first" versus the 1st thing in the task sequence? 

yes the reason we run another program first is because we don't want to 'start' the task sequence unless we are ready to do so, and therefore it's chained to the wrapper, i.e. the wrapper must exit with a code of 0 (no error) in order for the task sequence to start,

also task sequences run as SYSTEM (not user) account, and this requires that the user is logged on and interacts (to defer)

Share this post


Link to post
Share on other sites

do you want to replace the current VPN gateway address with a new one or check for both ? are you using multiple VPNs ?

If multiple then you'll need to edit line 300 to include nested If statements as described here

Share this post


Link to post
Share on other sites

This is a fantastic tool and really adds to the capability of SCCM. One issue I have encountered is on shared computers. Once one user has had the hta run if another user is exposed to it the routine exits with error 99 because it cannot write to the logfiles. They are created with the original user as owner and other users only have read permission. What would be the best way around this? I realise that the number of deferrals will jump up with each user as this is stored in the CU registry area.

Cheers

 

Bevan

Share this post


Link to post
Share on other sites
On 4/25/2018 at 9:46 PM, anyweb said:

do you want to replace the current VPN gateway address with a new one or check for both ? are you using multiple VPNs ?

If multiple then you'll need to edit line 300 to include nested If statements as described here

I looked at the vb-script page from the link above. However it wasn't very clear. I need to add 2 more gateways IP's after line 300 for a total of 3. Thanks

Share this post


Link to post
Share on other sites
6 hours ago, bevok said:

This is a fantastic tool and really adds to the capability of SCCM. One issue I have encountered is on shared computers. Once one user has had the hta run if another user is exposed to it the routine exits with error 99 because it cannot write to the logfiles. They are created with the original user as owner and other users only have read permission. What would be the best way around this? I realise that the number of deferrals will jump up with each user as this is stored in the CU registry area.

Cheers

 

Bevan

good point, you could change the logging location to the users home folder eg: C:\Users\JoeBlogs that way it would be dynamic for each user...

Share this post


Link to post
Share on other sites

When checking for free space, after clicking and confirming there's not enough disk space, it keeps popping message about not enough disk space and gets stuck in infinite loop:

2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
 

Share this post


Link to post
Share on other sites
On 3/05/2018 at 4:45 PM, anyweb said:

good point, you could change the logging location to the users home folder eg: C:\Users\JoeBlogs that way it would be dynamic for each user...

For the benefit of others, in the start-upgrade.ps1 I modified the logfile variable to:

$Logfile = "C:\ProgramData\Windows10RequiredUpgradeStart-Upgrade-$env:USERNAME.log"

In the wrapper.vbs I added strUserName to the first 'Dim', then

Set oWsh = WScript.Createobject("WScript.Shell")
strUserName = oWsh.ExpandEnvironmentStrings("%username%")

under strComputer

And just a bit further down where the path for the logfile is declared:

path="C:\ProgramData\Windows10RequiredUgradeWrapper" & strUserName & ".log"

 

Putting the logfile in the user profile would be a good approach too but I like having one place to check.

 

Thanks again for your great work.

  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, Batman said:

When checking for free space, after clicking and confirming there's not enough disk space, it keeps popping message about not enough disk space and gets stuck in infinite loop:

2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
2018-05-07 16:13:45 Checking for free disc space...
2018-05-07 16:13:45 Not enough disc space found....25
 

yup that's the current design, the idea is that the user should free up some space, after which it will continue....

 

do you think it should do something else, if so what ?

Share this post


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

For the benefit of others, in the start-upgrade.ps1 I modified the logfile variable to:

$Logfile = "C:\ProgramData\Windows10RequiredUpgradeStart-Upgrade-$env:USERNAME.log"

In the wrapper.vbs I added strUserName to the first 'Dim', then

Set oWsh = WScript.Createobject("WScript.Shell")
strUserName = oWsh.ExpandEnvironmentStrings("%username%")

under strComputer

And just a bit further down where the path for the logfile is declared:

path="C:\ProgramData\Windows10RequiredUgradeWrapper" & strUserName & ".log"

 

Putting the logfile in the user profile would be a good approach too but I like having one place to check.

 

Thanks again for your great work.

thanks for this addition, great idea and i'll try and incorporate it into a later version

Share this post


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

yup that's the current design, the idea is that the user should free up some space, after which it will continue....

 

do you think it should do something else, if so what ?

Hi, I can't dismiss it once, it keeps coming back with same prompt, so we are not able to free up space on C drive, because the prompt will not disappear. Thanks

Share this post


Link to post
Share on other sites

it's just a popup, you can move it anywhere on the screen and use Windows File Explorer to free up space on C:\, have you tried that ?

Share this post


Link to post
Share on other sites

Hi,

 

Where is the wripper.vbs downloaded locally? 

 

I have a issue with a specific laptop that have some battery issues, so it returns always that i need to plug it to AC power. 

 

I want to modify the wrapper locally in order to remove this line and upgrade this laptop. I see that is copied to %temp% folder but when i edit it and run again the TS, a new wrapper.vbs is copied to this folder.

 

thanks

 

Share this post


Link to post
Share on other sites

it's copied from the package source in the CCMCache or direct from the dp, what issues does this particular computer have ? bad battery ? can't you replace it with a new battery

Share this post


Link to post
Share on other sites

it doesn't exists in ccmcache, i searched there before ask here :)  i only find it in %temp%

i usually use the SCCM application model instead of the package one. Maybe is running directly from the DP and i forgot to configure it 

This laptop is  outside from our HomeOffice but finally we can changed the battery and now the upgrade works

 

Thanks Niall

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...