OfficeDev / Office-IT-Pro-Deployment-Scripts

A collection of useful PowerShell scripts to make deploying Office 2016 and Office 365 ProPlus easier for IT Pros and administrators. If you have any feature requests or ideas for future scripts please add the idea to the issues list in this repository
http://officedev.github.io/Office-IT-Pro-Deployment-Scripts
MIT License
882 stars 838 forks source link

Microsoft Lync 2010 not removed #316

Open SMSAgentSoftware opened 6 years ago

SMSAgentSoftware commented 6 years ago

The Offscrub10.vbs script does not remove Microsoft Lync 2010. The logic in the Remove-PreviousOfficeInstalls.ps1 script tries to use that vbs to remove Lync 2010.

The following code from line 563 can be removed...

` switch($LyncProduct.Version){

                        "1" {

                            $ActionFile = "$scriptPath\$03VBS"

                        }

                        "2" {

                            $ActionFile = "$scriptPath\$07VBS"

                        }

                        "4" {

                            $ActionFile = "$scriptPath\$10VBS"

                        }

                    }

                    if($ActionFile -And (Test-Path -Path $ActionFile)){

                        $cmdLine = """$ActionFile"" $LyncProductName $argList"

                        $cmd = "cmd /c cscript //Nologo $cmdLine"

                        Invoke-Expression $cmd

                    }`

...and replaced with:

Start-Process -FilePath msiexec.exe -ArgumentList "/X$LyncProductName /qn REBOOT=ReallySuppress" -NoNewWindow -Wait

This will remove what Lync version code is detected.