locked
Lync 2013 Uninstall through SCCM 2012 RRS feed

  • Question

  • 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 

     
    Tuesday, May 19, 2015 12:03 PM

Answers

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


    Jason | http://blog.configmgrftw.com | @jasonsandys

    • Proposed as answer by Joyce L Wednesday, June 3, 2015 10:11 AM
    • Marked as answer by Joyce L Thursday, June 4, 2015 9:56 AM
    • Unmarked as answer by richard keel Thursday, June 4, 2015 3:07 PM
    • Marked as answer by richard keel Monday, June 8, 2015 12:18 PM
    Tuesday, May 19, 2015 4:51 PM

All replies


  • 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?

    Torsten Meringer | http://www.mssccmfaq.de

    Tuesday, May 19, 2015 12:12 PM
  • 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,
    Jörgen


    -- My System Center blog ccmexec.com -- Twitter @ccmexec

    Tuesday, May 19, 2015 12:13 PM
  • And why are you creating a batch that calls a batch instead of executing the command line directly?


    Torsten Meringer | http://www.mssccmfaq.de

    Simply because we have UAC enabled and users are not allowed to write to Program Files (x86) via our Group Policy.  I attempted to do that from the get go and it behaves the same so I thought if I moved a bat file to a safe place for all users(c:apps) it would have a better chance of working  :) - apparently not. 
    Tuesday, May 19, 2015 12:24 PM
  • 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.

    Torsten Meringer | http://www.mssccmfaq.de

    Tuesday, May 19, 2015 12:42 PM
  • 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.


    Jason | http://blog.configmgrftw.com | @jasonsandys

    Tuesday, May 19, 2015 1:04 PM
  • 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.


    Jason | http://blog.configmgrftw.com | @jasonsandys


    Yeah I saw that about the XML file and was a little lost, I'm new to this side of things.  But I can do some digging. Thanks for the addition info...
    Tuesday, May 19, 2015 2:16 PM
  • 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.





    Tuesday, May 19, 2015 3:14 PM
  • 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.


    Jason | http://blog.configmgrftw.com | @jasonsandys

    • Proposed as answer by Joyce L Wednesday, June 3, 2015 10:11 AM
    • Marked as answer by Joyce L Thursday, June 4, 2015 9:56 AM
    • Unmarked as answer by richard keel Thursday, June 4, 2015 3:07 PM
    • Marked as answer by richard keel Monday, June 8, 2015 12:18 PM
    Tuesday, May 19, 2015 4:51 PM
  • 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
    Thursday, June 4, 2015 1:58 PM
  • "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?


    Thursday, June 4, 2015 3:04 PM
  • Is your program set to run with admin rights?

    Jason | http://blog.configmgrftw.com | @jasonsandys

    Thursday, June 4, 2015 3:37 PM
  • 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.

    Thursday, June 4, 2015 3:54 PM
  • 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/

    All is well...thanks!

    Thursday, June 4, 2015 7:53 PM