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

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

Commented:
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: http://blogs.technet.com/b/messaging_with_communications/archive/2013/09/05/determining-lync-2013-client-installed-using-the-registry.aspx

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:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Registration\{0EA305CE-B708-4D79-8087-D636AB0F1A4D}

ProductName = "Microsoft Lync 2013"

For 32-bit Windows:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Registration\{0EA305CE-B708-4D79-8087-D636AB0F1A4D}

ProductName = "Microsoft Lync 2013"

For 2010:

64-bit:
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: http://prajwaldesai.com/how-to-deploy-lync-2010-client-using-sccm-2012-r2/

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

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

Author Commented:
So I created a batch file with the following:
echo off

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


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?
Commented:
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: http://prajwaldesai.com/how-to-deploy-microsoft-office-2013-using-sccm-2012-r2/

Hope this helps.
Author 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
Powershell

From novice to tech pro — start learning today.