• 0

Question

I am looking for a command that when executed will silently (no prompts) uninstall the Lync client on an end user's PC. 

 

Also as an added issue we have 3 versions floating out there.

  • Lync 2010 (x86)
  • Lync 2013 (x86) 
  • Lync 2013 (x64)

At first my plan was to use WMIC, however, some machines state that it is not installed when infact it is. so i need an alternative.

 

/node: PCNAME product where name="Microsoft Lync MUI (English) 2013" call uninstall /nointeractive
/node: PCNAME product where name="Microsoft Lync 2010" call uninstall /nointeractive

7 answers to this question

Recommended Posts

  • 0

Where I work at we are removing Lync 2007 and 2010 to install 2013.  This may help you.

wscript.echo Now() & " - Checking for old versions of Microsoft Communicator or Microsoft Lync to remove"

Dim messagingSoftware,messagingSoftwareItem

messagingSoftware = array("Microsoft Communicator 2007","Microsoft Communicator 2007 R2","Microsoft Lync 2010")
	For Each messagingSoftwareItem In messagingSoftware
		Select Case checkForInstalledApplication(messagingSoftwareItem)
			Case True
				WScript.echo Now() & " - " & messagingSoftwareItem & " is installed.  Beginning uninstall."
				uninstallSoftware(messagingSoftwareItem)
				WScript.echo Now() & " - " & messagingSoftwareItem & " has been uninstalled.  Continuing installation."
			Case False
				WScript.echo Now() & " - Previous install of " & messagingSoftwareItem & " not found... Continuing install..."
			Case Else 
				WScript.echo Now() & " - There was an error trying to determine the status of your " & messagingSoftwareItem & " installation.  Ending script"
				WScript.quit 4999
		End Select
	Next
	
Function checkForInstalledApplication(applicationName)
     Dim objItem, strComputer : strComputer = "." 
     Dim objWMIService : Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
     Dim colItems : Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Product WHERE Name = '" & applicationName & "'",,48) 
     If IsNull(colItems) Then
          checkForInstalledApplication = False
     Else
          For Each objItem in colItems
               If objItem.name = applicationName Then 
                    checkForInstalledApplication = True
               End If
          Next
     End If
End Function

Function uninstallSoftware(applicationName)
	Dim objSoftware, strComputer : strComputer = "."
	Dim objWMIService : Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
	Dim colSoftware : Set colSoftware = objWMIService.ExecQuery("Select * from Win32_Product Where Name = '" & applicationName & "'",,48)
	For Each objSoftware in colSoftware
		objSoftware.Uninstall()
	Next
End Function
  • 0
  On 13/03/2015 at 20:24, Steffan said:

 

Where I work at we are removing Lync 2007 and 2010 to install 2013.  This may help you.

wscript.echo Now() & " - Checking for old versions of Microsoft Communicator or Microsoft Lync to remove"

Dim messagingSoftware,messagingSoftwareItem

messagingSoftware = array("Microsoft Communicator 2007","Microsoft Communicator 2007 R2","Microsoft Lync 2010")
	For Each messagingSoftwareItem In messagingSoftware
		Select Case checkForInstalledApplication(messagingSoftwareItem)
			Case True
				WScript.echo Now() & " - " & messagingSoftwareItem & " is installed.  Beginning uninstall."
				uninstallSoftware(messagingSoftwareItem)
				WScript.echo Now() & " - " & messagingSoftwareItem & " has been uninstalled.  Continuing installation."
			Case False
				WScript.echo Now() & " - Previous install of " & messagingSoftwareItem & " not found... Continuing install..."
			Case Else 
				WScript.echo Now() & " - There was an error trying to determine the status of your " & messagingSoftwareItem & " installation.  Ending script"
				WScript.quit 4999
		End Select
	Next
	
Function checkForInstalledApplication(applicationName)
     Dim objItem, strComputer : strComputer = "." 
     Dim objWMIService : Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
     Dim colItems : Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Product WHERE Name = '" & applicationName & "'",,48) 
     If IsNull(colItems) Then
          checkForInstalledApplication = False
     Else
          For Each objItem in colItems
               If objItem.name = applicationName Then 
                    checkForInstalledApplication = True
               End If
          Next
     End If
End Function

Function uninstallSoftware(applicationName)
	Dim objSoftware, strComputer : strComputer = "."
	Dim objWMIService : Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
	Dim colSoftware : Set colSoftware = objWMIService.ExecQuery("Select * from Win32_Product Where Name = '" & applicationName & "'",,48)
	For Each objSoftware in colSoftware
		objSoftware.Uninstall()
	Next
End Function

 

should that just be copied into a .cmd file or a .ps1 file?

  • 0

OK Figured out how to get it to run (VBS) however, it was unable to find any versions of Microsoft Lync installed on the test computer. I added Lync 2013 using the name provided by WMIC as well as just Microsoft Lync 2013 and it still says it cannot find any copies of lync installed.

  • 0

The VBS will help with removing Lync 2007 and 2010.  With Lync 2013 you will have to make MSP with the installer to remove it.  Lync 2013 is part of the installer for Office 2013 unlike 2007 and 2010 which were standalone products.

  • 0

I found the uninstall GUID to uninstall Lync 2013, but it breaks the Office 2013 installer if you're using Office 2013 Pro Plus.  If you're using Pro Plus, you are better off removing Office and creating a MSP to not to include Lync and then removing and reinstalling Office.

  • 0
  On 16/03/2015 at 18:44, Steffan said:

I found the uninstall GUID to uninstall Lync 2013, but it breaks the Office 2013 installer if you're using Office 2013 Pro Plus.  If you're using Pro Plus, you are better off removing Office and creating a MSP to not to include Lync and then removing and reinstalling Office.

 

ok thanks. sadly that is the case with most of the installed copies of it that they are part of office rather than being addons. there are only 97 users with it installed right now so i will probably just do manual removals for those users and then install Jabber at the same time.

This topic is now closed to further replies.
  • Posts

    • LibreWolf 140.0.2-1 by Razvan Serea LibreWolf is an independent “fork” of Firefox, with the primary goals of privacy security and user freedom. It is the community run successor to LibreFox. LibreWolf is designed to increase protection against tracking and fingerprinting techniques, while also including a few security improvements. This is achieved through our privacy and security oriented settings and patches. LibreWolf also aims to remove all the telemetry, data collection and annoyances, as well as disabling anti-freedom features like DRM. LibreWolf features: Latest Firefox — LibreWolf is compiled directly from the latest build of Firefox Stable. You will have the the latest features, and security updates. Independent Build — LibreWolf uses a build independent of Firefox and has its own settings, profile folder and installation path. As a result, it can be installed alongside Firefox or any other browser. No phoning home — Embedded server links and other calling home functions are removed. In other words, minimal background connections by default. User settings updates Extensions firewall: limit internet access for extensions. Multi-platform (Windows/Linux/Mac/and soon Android) Community-Driven Dark theme (classic and advanced) LibreWolf privacy features: Delete cookies and website data on close. Include only privacy respecting search engines like DuckDuckGo and Searx. Include uBlockOrigin with custom default filter lists, and Tracking Protection in strict mode, to block trackers and ads. Strip tracking elements from URLs, both natively and through uBO. Enable dFPI, also known as Total Cookie Protection. Enable RFP which is part of the Tor Uplift project. RFP is considered the best in class anti-fingerprinting solution, and its goal is to make users look the same and cover as many metrics as possible, in an effort to block fingerprinting techniques. Always display user language as en-US to websites, in order to protect the language used in the browser and in the OS. Disable WebGL, as it is a strong fingerprinting vector. Prevent access to the location services of the OS, and use Mozilla's location API instead of Google's API. Limit ICE candidates generation to a single interface when sharing video or audio during a videoconference. Force DNS and WebRTC inside the proxy, when one is being used. Trim cross-origin referrers, so that they don't include the full URI. Disable link prefetching and speculative connections. Disable disk cache and clear temporary files on close. Disable form autofill. Disable search and form history...and more. Notes: To receive automatic updates, you may refer to the unofficial LibreWolf-WinUpdater that employs a scheduled task to accomplish the same. Download: LibreWolf 64-bit | Portable 64-bit |~100.0 MB (Open Source) Download: LibreWolf 32-bit | Portable 32-bit | Other Operating Systems Links: LibreWolf Home Page | Addons | Screenshot | Reddit Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • At least it doesn't reset your defaults lol. Back to Bing, MSN and Copilot lol. Wait, that's a feature, not a bug?
    • Exactly what I was going to say, lmao. Pro-grade where? I have the S24 Ultra and there are only marginal differences between that series and the S25 series. Hell, even the S23 and S22 series is similar. Samsung stopped trying years ago.
    • Are you asking us or telling us my friend?
    • Performance and bloating is my main concern.
  • Recent Achievements

    • Week One Done
      Hartej earned a badge
      Week One Done
    • One Year In
      TsunadeMama earned a badge
      One Year In
    • Week One Done
      shaheen earned a badge
      Week One Done
    • Dedicated
      Cole Multipass earned a badge
      Dedicated
    • Week One Done
      Alexander 001 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      562
    2. 2
      +FloatingFatMan
      182
    3. 3
      ATLien_0
      170
    4. 4
      Skyfrog
      108
    5. 5
      Som
      106
  • Tell a friend

    Love Neowin? Tell a friend!