Lync 2013 Uninstall through SCCM 2012

I am having a lot of problems getting my Lync 2013 uninstall automated through SCCM 2012.  We currently have the KMS version installed with Office 2010.  I am working on implementing Office 2k13 that includes Lync 2013 but we need to remove Lync 2913 before installing Office 2013 because of known issues in our environment..  I thought I could setup a package within SCCM 2012 (applications are not an option at this time with superseedence) and just keep running into where the uninstall never completes.

In short I am trying to use C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /dll OSETUP.DLL in a batch file to remove Lync 2013.

If I run this as an Admin it uninstalls Lync 2013 just fine on the PC.  But if I try and run this as a .bat with a SCCM package it never completes.  It ends up timing out.

I am using 2 scripts inside of the package.  One to move the 2nd script into a location that SCCM will run from.  I found if I were just to leave the LyncRemoval.bat file in the windows\ccmcache folder the bat would never run, even if manually clicking on the .bat file, it needed to be local on the PC...at least from the way I created the script.

Script 1

MD "C:\apps\Lync2013 Uninstall"
xcopy /s /e /i "\\cosccm2012pss\package_source\Microsoft\Lync\Lync 2013\Uninstall\LyncRemoval.bat" "c:\apps\Lync2013 Uninstall"

"c:\apps\Lync2013 Uninstall\LyncRemoval.bat"

Script 2

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /dll OSETUP.DLL

In short the package runs, makes directory, copied files and then eventually times out.  I set it up to Run Hidden and with Admin Rights inside of the SCCM 2012 Deployment.  If I run the LyncRemoval.bat from c:\apps\Lync2013 Uninstall it always says I need admin creds.  If I run as admin creds on the PC itself it works fine.  So what am I doing wrong that the admin creds are not passing from SCCM to the push?

Thanks,

Rich 

 
May 19th, 2015 8:04am


xcopy /s /e /i "\\cosccm2012pss\package_source\Microsoft\Lync\Lync 2013\Uninstall\LyncRemoval.bat" "c:\apps\Lync2013 Uninstall"


I have no idea why it is failing, but using an UNC path to copy files is not the best idea as you are bypassing any DP(s).
Can you add a command line parameter to setup.exe in order to add logging? And why are you creating a batch that calls a batch instead of executing the command line directly?
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 8:13am

Hi,

When you run it using SCCM you will be running the command in System Context, not a lokal adminstrator context so you could test running it as system using psexec. It could also be the search path in the second skript, depending on how you run it and if you have selected " disable 64bit redirection" or not.

If it starts but never finishes it sounds like a prompt with some kind of information that you do not see. You could also try to use the option "allow user to interact with the program" to see any message that it tries to display..

Regards,
Jrgen

May 19th, 2015 8:13am

And why are you creating a batch that calls a batch instead of executing the command line dir

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 8:24am

Simply because we have UAC enabled and users are not allowed to write to Program Files (x86) via our Group Policy

That does not matter at all as the installation will run in system context which is not subject to UAC.
May 19th, 2015 8:42am

Concur with all previous comments. Just create an empty package with a program that has the proper command-line. Calling a batch from a batch makes no sense even if the System account were subject to UAC and copying the batch from a share is also pointless: as mentioned, just call the command-line directly in the program.

Also, just calling setup /uninstall for an Office application won't initiate a silent unattended uninstall. For that, you must specify an xml file to tell Office setup that it should be silent. There are lots of guides on this on the web and the process is more or less identical for all Office versions since 2007.

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 9:04am

Concur with all previous comments. Just create an empty package with a program that has the proper command-line. Calling a batch from a batch makes no sense even if the System account were subject to UAC and copying the batch from a share is also pointless: as mentioned, just call the command-line directly in the program.

Also, just calling setup /uninstall for an Office application won't initiate a silent unattended uninstall. For that, you must specify an xml file to tell Office setup that it should be silent. There are lots of guides on this on the web and the process is more or less identical for all Office versions since

May 19th, 2015 10:17am

Modified script to run(I will get rid of the script when I create the package, just using a script to test.)

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /config \\cosccm2012pss\package_source\microsoft\Lync\2013\Uninstall\SilentUninstall.xml  /dll OSETUP.DLL 

It references SilentUninstall.xml which is stored in the specified server.  Data below.

<Configuration Product="Microsoft Lync 2013">

<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />

</Configuration>

Ends up showing CMD for a brief period and goes away.  Lync 2013 does not appear to remove.  I added a pause to the script and no errors show up.  I referenced the Program name in the registry "Microsoft Lync 2013" Getting closer or am I way off?

EDIT:  I did a setup.exe /admin and see the Product is showing "Microsoft Lync 2013 (32-bit)" - editing my SilentUninstall.xml and testing soon

EDIT 2:  New Product name did not help.





Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 11:14am

When using a config like that, you should just place it in the package and then you can reference it using a relative path (slightly different than what I said above about using an empty package):

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /config  SilentUninstall.xml  /dll OSETUP.DLL 

Make sure you test this manually first though by running it from a command-line with the XML in the current working directory. That way, if there are any errors, you'll see them and the command prompt won't go away.

May 19th, 2015 12:52pm

Modified script to run(I will get rid of the script when I create the package, just using a script to test.)

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /config \\cosccm2012pss\package_source\microsoft\Lync\2013\Uninstall\SilentUninstall.xml  /dll OSETUP.DLL 

It references SilentUninstall.xml which is stored in the specified server.  Data below.

<Configuration Product="Microsoft Lync 2013">

<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />

</Configuration>

Ends up showing CMD for a brief period and goes away.  Lync 2013 does not appear to remove.  I added a pause to the script and no errors show up.  I referenced the Program name in the registry "Microsoft Lync 2013" Getting closer or am I way off?

EDIT:  I did a setup.exe /admin and see the Product is showing "Microsoft Lync 2013 (32-bit)" - editing my SilentUninstall.xml and testing soon

EDIT 2:  New Product name did not help.





Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 3:14pm

The problem I have with copying the XML file in C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller is that (x86) is locked down and normal users cannot write to it.  That option does not work in our environment
June 4th, 2015 9:58am

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /config  SilentUninstall.xml  /dll OSETUP.DLL 

When I do the above and do everything hidden setup32.exe starts and quits in Task Manager.  If I show everything it says I need Admin rights to run.  How do I achieve tried this in SCCM as a package and a task and it just hangs for 60 minutes.

What am I missing?


Free Windows Admin Tool Kit Click here and download it now
June 4th, 2015 11:04am

Is your program set to run with admin rights?
June 4th, 2015 11:37am

I have tried doing a package and a task, both hidden and they hang.  I have not tried an application due to the fact we have so many packages for the past that I inherited earlier this year when I took this job.  There is nothing out of the ordinary that I am doing with the setup.exe but we have UAC enabled and .exe require admin rights to run in our environment, which I am sure is not uncommon.

Most of the time when I create a package if I set it to be hidden and use elevated rights that does the trick...but not with this Lync 2013 uninstall.

Free Windows Admin Tool Kit Click here and download it now
June 4th, 2015 11:54am

The problem I have with copying the XML file in C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller is that (x86) is locked down and normal users cannot write to it.  That option does not work in our environment
June 4th, 2015 1:58pm

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /uninstall LYNC /config  SilentUninstall.xml  /dll OSETUP.DLL 

When I do the above and do everything hidden setup32.exe starts and quits in Task Manager.  If I show everything it says I need Admin rights to run.  How do I achieve tried this in SCCM as a package and a task and it just hangs for 60 minutes.

What am I missing?


Free Windows Admin Tool Kit Click here and download it now
June 4th, 2015 3:04pm

I have tried doing a package and a task, both hidden and they hang.  I have not tried an application due to the fact we have so many packages for the past that I inherited earlier this year when I took this job.  There is nothing out of the ordinary that I am doing with the setup.exe but we have UAC enabled and .exe require admin rights to run in our environment, which I am sure is not uncommon.

Most of the time when I create a package if I set it to be hidden and use elevated rights that does the trick...but not with this Lync 2013 uninstall.

June 4th, 2015 3:54pm

I think I got it...I repackaged and it worked with the tips Jason gave me.  I think I avoided the package after I could not trace the steps easily. Doing another test but I think I am good.  I'll post again in the morning.  thanks for the help/
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2015 3:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics