r/SCCM•
HugheJass

What am I doing wrong? - Office 2010 to Office 365 Task Sequence error capturing

I need to learn more about error handling in Task Sequences.

I have this TS set up (not part of OSD) to remove Office 2010/Visio 2013/Project 2013 and install Office 365, but it only works if the older versions of Office aren't installed/removed on my client machines during this process. That's great in testing to prove that my application installation works, but 100% of my productions clients will have Office and it will be removed. I can get as far as installing Office 365 in my TS, but the installation fails on the workstation and the deployment status under Monitoring (and in software center) reports that it was successful. OffScrub will run, but O365 C2R fails to actually install if there was a product removed first.

It looks like there's a lot happening in my sequence between the reboots and OffScrub, but we're going from 64-bit 2010 to 32-bit O365 and a full removal is a must (OffScrub is set to run if the old .exe's are found and will continue on error). The reboots are just to make sure there are no pending changes and they ensure that I don't get any loose ends with file associations when everything is done. Some users will have Visio or Project 2013 as well, so multiple versions of OffScrub will be used on each pass. Does it need to be a package? I figured the application's error code would have sent it back, but that's apparently not the case?

Here's what I've resorted to when it comes to testing if my installation status reported properly, but this doesn't work either.

http://imgur.com/a/jPrIx

My real question is...What am I missing in terms of error handling in a Task Sequence? The parts work independently, so I think that my lack of TS knowledge is keeping me back.

I tried TS variables like _SMSTSLastActionRetCode and _SMSTSLastActionSucceeded...but something didn't work. Do I need to use them every time? Does anyone have a link to something that helped them click on this subject? The books have a lot of instructions that I can follow, but I can't find the info that takes me one step deeper with good examples and I have nobody here to talk shop with.

The logs for Office365 in C:\Windows\Temp don't even have an entry with today's time stamp on it and I've already tried the installation a few times. I don't think the Task Sequence is making it that far, which is why I'm assuming my task sequence is incorrectly configured. Running setup.exe with my config file immediately generates a log file. Disabling all of the other steps in my task sequence (all reboot and OffScrub) results in the same false positive.

I can also add that this same process works very well in PDQ Deploy. OffScrub, reboot, rinse, repeat, Install O365.

Posted Oct 12, 2016, 6:44 PM UTC · edited

213
hamsterhabitat•

I might be wrong here but I don't think a task sequence survives a reboot. That might explain why, if nothing is found, it completes successfully.

2
ristophet•

It survives if the task sequence controls the reboot.

2
hamsterhabitat•

Good to know. Thank you.

1
HugheJassOP•

It looks like it does. My clients reboot, run OffScrub, then reboot again, then OffScrub again...

I can see that the stages of my TS on the splash screen are showing the later steps as I've labeled them. Thanks for your suggestion.

1
Woodstriker•

I've also heard that task sequences don't survive reboots. I think the only step that does is the one to install and configure the client and that's only because that step is designed to reboot and launch the task sequence again.

1
Wind_Freak•

Here have my script. Put this into PS App Deploy Toolkit

http://pastebin.com/gKQYQkJ1

oops you might need the post steps too.

	##*===============================================
	##* POST-INSTALLATION
	##*===============================================
	[string]$installPhase = 'Post-Installation'
	
	## <Perform Post-Installation tasks here>
	If ($repair2010) {
		Write-Log -Message 'Microsoft Office 2010 was detected. Will be Repaired.' -Source $deployAppScriptFriendlyName
		Execute-MSI -Action Repair -Path '{90140000-0011-0000-0000-0000000FF1CE}' -Parameters 'REBOOT=ReallySuppress REINSTALL=ALL /qb!' -ContinueOnError $true
	}
			

	Unblock-AppExecution
	## Display a message at the end of the install
	If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'If you had Office 2013 or 2016 it has been replaced with Office 365' -ButtonRightText 'OK' -Icon Information -NoWait }
}
2
mikeh361•

Do you have Office/Project/Visio 2010 as applications already? Does the uninstall work (or could you change it to run offscrub)? If so you can force a restart on the deployment. Then with your Office 365 application set supersedence to the 2010 versions and set them to uninstall. The uninstall will happen, force a restart, then complete the 365 install.

2
ristophet•

We basically did this to over 3k machines last week and it worked well. Then 3k people opened Outlook the next day and started downloading their mailboxes.

If you move from 2010 to any flavor of 2016 en mass be prepared to bury your circuits for a while.

1
Woodstriker•

I have had a very similar problem and tried to do the same thing with a task sequence. I was never able to get it to work. What I did get to work was a PowerShell script that performed the uninstalling, made a scheduled task, then rebooted. The scheduled task ran on startup and would launch a second script that would install the new product.

If you're not sure how to do that I can try and dig up that script.

1
HugheJassOP•

You know what...the thought had crossed my mind about using a schedule task like that. I also thought about setting up some compliance rules where is Winword.exe for 2010 wasn't found, then deploy Office 365. That way I can just uninstall Office 2010 and the compliance baseline will do the rest.

1
Wind_Freak•
  1. Why are you using a task sequence?
  2. Do you have O365 already on the device maybe in the form of Skype for business?

If you already have O365 installed you must uininstall that first then scrub then install O365. You can do all this in one powershell script no reboots required except at the end.

1
HugheJassOP•

The task sequence is the only option to allow me to reboot. Going from the 2010 to 2016 requires the reboot(s) or it didn't associate any file formats with Word. They defaulted to Wordpad instead. The reboots in between take care of that.

1
Wind_Freak•

Try my script I posted.

1