silent uninstall for all Lync client versions script

I've created a task sequence in SCCM that will run the officeScrub tool to remove the Office 2010 suite, reboot and then install o365 Pro+. I have it all working, but I realized we need to also remove the versions of the Lync client since MS has moved over to Skype. I need a script to check for either Lync 2010 or 2013 (we use 64 bit versions) exist and to uninstall them without any interaction needed from the client to add to my task sequence in SCCM.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anthony CarterCommented:
We just went through this migration but we didn't uninstall Office 2010 suite, we just ran the Office 2013 version from Office 365.  It updated anything that was required and removed what was not.  Is there a reason you are wanting to make a complete clean install?  This includes Lync being upgraded to Skype for Business.

Also, to answer you question, check out:

This is copied directly from that site:

If you just want to verify if ANY version (Basic, Full, or as part of Office 2013 Pro) of Lync 2013 client is installed, you can use the following registry key:

For 64-bit Windows:


ProductName = "Microsoft Lync 2013"

For 32-bit Windows:


ProductName = "Microsoft Lync 2013"

For 2010:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Communicator   [Lync Client 2010 installation]

Also of help is that 2010 the executable was called communicator.exe.  Finding this file and whether in c:\Program Files or c:\Program Files (x86) will tell you whether 32/64 bit.

You might also find the following of use:

Thats SCCM for install 2010, but the interesting part is the uninstall string: msiexec /uninstall "C:\Program Files (x86)\OCSetup\Lync,msi".  In addition, using the latest version of Lync/Skype for Business and the /uninstall switch for msiexec will remove ANY previous version of Lync (2010/2013 and 32-bit/64-bit).

Hope this helps

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RubinPostaerAuthor Commented:
So I created a batch file with the following:
echo off
taskkill.exe /F /IM iexplore.exe /T
taskkill.exe /F /IM outlook.exe /T
taskkill.exe /F /IM lync.exe /T

"C:\Program Files\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\setup.exe" /UNINSTALL LyncEntry /config  \\path\to\xml_file\SilentLyncUninstall.xml

Open in new window

I ran the batch file on my machine and it worked, but creating a package in SCCM fails. How does one go about running batch files in an SCCM Package?
Anthony CarterCommented:
I'm sorry, we don't use SCCM so can not assist with that question.

Having said that, I found from searching that Office Pro SP1 won't install Lync, you need to use the Office Customization Tool to do so.  Office Pro 2013 non-SP1 will install Lync.

A guide to using OCT can be found here:

Hope this helps.
RubinPostaerAuthor Commented:
created a package and it took a few tries but I got it to work.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.