01-07-2021 05:54 PM - edited 01-07-2021 06:17 PM
Hello,
Description of problem
Trying to upgrade my organization to version 4.9.01095 of the Cisco AnyConnect client. I am currently facing a 50% failure rate during all piloting. The failure occurs when the previous version is removed, it errors out. Then the "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Help" folder has all it's permissions removed and the new version fails due to lacking permissions. A restart seems to fix the issue but not ideal for over 10,000 machines.
Our version expires January 13th and was hoping to have piloting finished this week. Have a very difficult time with it and hopefully someone can shed some light on why I am experiencing so many problems.
Details
Current Version: 4.7.0.1076
Components installed: NAM, DART, Mobility Client, Umbrella on laptops
New version being deployed: 4.9.01095 with the same components
TargetOS: Windows 10 1709 & 1909
Device types: Physical workstations and laptops
Current deployment method (as detailed from Cisco's site)
Prior deployment method (which still failed at 50%)
Errors
What I am/am not doing
Solved! Go to Solution.
01-08-2021 10:14 AM
01-08-2021 04:20 PM - edited 01-10-2021 04:37 PM
Another test this evening to ~140 devices. Only half online but I can report much, much higher success. Currently 50 success and two failures. Both failures are a very similar error, but reference the "Plugins" folder instead of the "Help" folder:
Product: Cisco AnyConnect Secure Mobility Client -- Error 1303. The installer has insufficient privileges to access this directory: C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\Plugins.
1/10/20 Update: the solution provided has taken me from a 50% success rate to 97%. This final pilot has went well enough to roll into production. It appears any device that fails with the error in this post or the one in my OP resolve after a reboot. Here is a brief summary of the steps I took for a successful deployment. Hopefully this helps others who may find this as I had a lot of difficulties with deployment. Also to note, I really do not know much about AnyConnect - we do not use the VPN portion of the client and may be using the solution differently than others.
Deployment
Code Snippets
Pre-Install\NAM BACKUP
## Backup NAM profiles
If (Test-Path -Path "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\system") {
New-Folder -Path "C:\Windows\Temp\ACBackup"
$Destination = "C:\Windows\Temp\ACBackup"
$Source = "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\system"
Get-ChildItem $Source -Recurse | ForEach {
Copy-File -Path $_.FullName -Destination $Destination
}
}
Else {
# No backup files exist
}
Pre-Install\Copy AnyConnect.html
## Add the "AnyConnect.html" file to the help folder. I do not understand what this means at all. A Cisco employee replied to my post on their forums
# and provided me with this solution
# Post: https://community.cisco.com/t5/vpn/cisco-anyconnect-upgrade-failure/td-p/4268747
# Cisco documentation: https://www.cisco.com/c/en/us/td/docs/security/vpn_client/anyconnect/anyconnect40/administration/guide/b_AnyConnect_Administrator_Guide_4-0/customize-localize-anyconnect.html#ID-1408-00000291
# Copy AnyConnect.html only if it does not exist and process can be restarted
$ExistingInstall = Test-Path "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\system"
If ($ExistingInstall) {
$HtmlFile = Test-Path "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Help\AnyConnect.html" -ErrorAction SilentlyContinue
If (!($HtmlFile)) {
While (Get-Process -Name "VPNUI" -ErrorAction SilentlyContinue) {
If ($CheckProcessRunning -le '10') {
$CheckProcessRunning++
Start-Sleep -Seconds 5
Stop-Process -Name "VPNUI" -Force -ErrorAction SilentlyContinue
}
Else {
Exit-Script -ExitCode 6175
}
}
Copy-Item -Path "$dirSupportFiles\AnyConnect.html" -Destination "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Help"
While (!(Get-Process -Name "VPNUI" -ErrorAction SilentlyContinue)) {
If ($CheckProcessStopped -le '10') {
$CheckProcessStopped++
Start-Sleep -Seconds 5
Start-Process "${ENV:ProgramFiles(x86)}\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe"
}
Else {
Exit-Script -ExitCode 6176
}
}
}
Else {
# Html file already exists
}
}
Else {
# New Install
}
# Start a sleep to allow VPNUI to register the html file
Start-Sleep -Seconds 30
Pre-Install\Remove prior versions
## Removal of prior instances of each module, if exists
# During install multiple errors were encountered. Loss of rights to ProgramData\Cisco, installers completing before they're finished, etc.
# https://www.cisco.com/c/en/us/td/docs/security/vpn_client/anyconnect/anyconnect49/administration/guide/b_AnyConnect_Administrator_Guide_4-9/deploy-anyconnect.html
# Remove prior versions, in this specific order
Remove-MSIApplications -Exact "Cisco AnyConnect Umbrella Roaming Security Module"
Start-Sleep -Seconds 30
Remove-MSIApplications -Exact "Cisco AnyConnect Network Access Manager"
Start-Sleep -Seconds 30
Remove-MSIApplications -Exact "Cisco AnyConnect Secure Mobility Client"
Start-Sleep -Seconds 30
Remove-MSIApplications -Exact "Cisco AnyConnect Diagnostics and Reporting Tool"
Start-Sleep -Seconds 30
Installation
## Cisco AnyConnect Installers
# https://www.cisco.com/c/en/us/td/docs/security/vpn_client/anyconnect/anyconnect49/administration/guide/b_AnyConnect_Administrator_Guide_4-9/deploy-anyconnect.html
# These installers must be done in this specific order
# AnyConnect Core Client with VPN disabled
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-core-vpn-predeploy-k9.msi" -Parameters "/QN /NoRestart PRE_DEPLOY_DISABLE_VPN=1"
Start-Sleep -Seconds 30
# AnyConnect Diagnostics and Reporting Tool
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-dart-predeploy-k9.msi" -Parameters "/QN /NoRestart"
Start-Sleep -Seconds 30
# AnyConnect Network Access Manager client which will not work without a config file
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-nam-predeploy-k9.msi" -Parameters "/QN /NoRestart"
Start-Sleep -Seconds 30
# Required config file
Copy-File -Path "$dirSupportFiles\configuration.xml" -Destination "$ENV:ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\newConfigFiles"
## Cisco Umbrella Installer
# This should only install on laptops but does not appear to cause issues if installed on VDI/Desktop
$Battery = (Get-WmiObject -Class Win32_Battery)
If ($Battery.BatteryStatus -gt 0) {
# Laptops
# This location should exist already, will create if not
New-Folder -Path "$ENV:ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Umbrella"
# Umbrella requires a .json file in order to function
Copy-File -Path "$dirSupportFiles\OrgInfo.json" -Destination "$ENV:ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Umbrella"
# AnyConnect Umbrella client
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-umbrella-predeploy-k9.msi" -Parameters "/QN /NoRestart"
# Umbrella apparently requires a reboot. Stopping and starting the Umbrella service
# mitigated the need for reboot. This step was missing during initial testing
Get-Service "acumbrellaagent" | Stop-Service -ErrorAction SilentlyContinue
Start-Sleep -Seconds 5
Get-Service "acumbrellaagent" | Start-Service -ErrorAction SilentlyContinue
}
Else {
# Desktop, do not install
}
Post-Install/Restoring backed up files
## Restore NAM profiles
If (Test-Path -Path "C:\Windows\Temp\ACBackup") {
$Destination = "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\newConfigFiles"
$Source = "C:\Windows\Temp\ACBackup"
Get-ChildItem $Source -Recurse | ForEach {
Copy-File -Path $_.FullName -Destination $Destination
}
Remove-Folder -Path "C:\Windows\Temp\ACBackup"
}
Else {
# No backup files exist
}
01-08-2021 07:37 AM
I now believe the "...\Help\" folder is a "Ghost folder" in the sense that once a reboot is performed, the folder is deleted. I have added an additional 25 seconds of sleep between the uninstall methods for a total of 30 seconds. I am hoping this is enough time to let the uninstaller finish before the next step starts.
I currently do not know of a way to remove this Help folder. All permissions are gone and I cannot take ownership again, though I have only had the opportunity to test on one device. I am sure there is a way to script that portion, but my total install code is approaching 200 lines of code now...
01-08-2021 08:21 AM
01-08-2021 09:18 AM
Thanks for the reply, this looks promising.
To reiterate:
I can 100% confirm the moment the device reboots the "Help" folder is removed. I just want to verify if I need the html file in there before uninstalling or just after.
Thanks!
01-08-2021 10:14 AM
01-08-2021 10:36 AM
Thank you for the clarification. I will be testing another pilot this evening to ~100 devices. If successful I will post a code snippet of my entire method as I am installing via ConfigMgr. May be helpful to others who find this post as well.
01-08-2021 04:20 PM - edited 01-10-2021 04:37 PM
Another test this evening to ~140 devices. Only half online but I can report much, much higher success. Currently 50 success and two failures. Both failures are a very similar error, but reference the "Plugins" folder instead of the "Help" folder:
Product: Cisco AnyConnect Secure Mobility Client -- Error 1303. The installer has insufficient privileges to access this directory: C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\Plugins.
1/10/20 Update: the solution provided has taken me from a 50% success rate to 97%. This final pilot has went well enough to roll into production. It appears any device that fails with the error in this post or the one in my OP resolve after a reboot. Here is a brief summary of the steps I took for a successful deployment. Hopefully this helps others who may find this as I had a lot of difficulties with deployment. Also to note, I really do not know much about AnyConnect - we do not use the VPN portion of the client and may be using the solution differently than others.
Deployment
Code Snippets
Pre-Install\NAM BACKUP
## Backup NAM profiles
If (Test-Path -Path "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\system") {
New-Folder -Path "C:\Windows\Temp\ACBackup"
$Destination = "C:\Windows\Temp\ACBackup"
$Source = "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\system"
Get-ChildItem $Source -Recurse | ForEach {
Copy-File -Path $_.FullName -Destination $Destination
}
}
Else {
# No backup files exist
}
Pre-Install\Copy AnyConnect.html
## Add the "AnyConnect.html" file to the help folder. I do not understand what this means at all. A Cisco employee replied to my post on their forums
# and provided me with this solution
# Post: https://community.cisco.com/t5/vpn/cisco-anyconnect-upgrade-failure/td-p/4268747
# Cisco documentation: https://www.cisco.com/c/en/us/td/docs/security/vpn_client/anyconnect/anyconnect40/administration/guide/b_AnyConnect_Administrator_Guide_4-0/customize-localize-anyconnect.html#ID-1408-00000291
# Copy AnyConnect.html only if it does not exist and process can be restarted
$ExistingInstall = Test-Path "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\system"
If ($ExistingInstall) {
$HtmlFile = Test-Path "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Help\AnyConnect.html" -ErrorAction SilentlyContinue
If (!($HtmlFile)) {
While (Get-Process -Name "VPNUI" -ErrorAction SilentlyContinue) {
If ($CheckProcessRunning -le '10') {
$CheckProcessRunning++
Start-Sleep -Seconds 5
Stop-Process -Name "VPNUI" -Force -ErrorAction SilentlyContinue
}
Else {
Exit-Script -ExitCode 6175
}
}
Copy-Item -Path "$dirSupportFiles\AnyConnect.html" -Destination "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Help"
While (!(Get-Process -Name "VPNUI" -ErrorAction SilentlyContinue)) {
If ($CheckProcessStopped -le '10') {
$CheckProcessStopped++
Start-Sleep -Seconds 5
Start-Process "${ENV:ProgramFiles(x86)}\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe"
}
Else {
Exit-Script -ExitCode 6176
}
}
}
Else {
# Html file already exists
}
}
Else {
# New Install
}
# Start a sleep to allow VPNUI to register the html file
Start-Sleep -Seconds 30
Pre-Install\Remove prior versions
## Removal of prior instances of each module, if exists
# During install multiple errors were encountered. Loss of rights to ProgramData\Cisco, installers completing before they're finished, etc.
# https://www.cisco.com/c/en/us/td/docs/security/vpn_client/anyconnect/anyconnect49/administration/guide/b_AnyConnect_Administrator_Guide_4-9/deploy-anyconnect.html
# Remove prior versions, in this specific order
Remove-MSIApplications -Exact "Cisco AnyConnect Umbrella Roaming Security Module"
Start-Sleep -Seconds 30
Remove-MSIApplications -Exact "Cisco AnyConnect Network Access Manager"
Start-Sleep -Seconds 30
Remove-MSIApplications -Exact "Cisco AnyConnect Secure Mobility Client"
Start-Sleep -Seconds 30
Remove-MSIApplications -Exact "Cisco AnyConnect Diagnostics and Reporting Tool"
Start-Sleep -Seconds 30
Installation
## Cisco AnyConnect Installers
# https://www.cisco.com/c/en/us/td/docs/security/vpn_client/anyconnect/anyconnect49/administration/guide/b_AnyConnect_Administrator_Guide_4-9/deploy-anyconnect.html
# These installers must be done in this specific order
# AnyConnect Core Client with VPN disabled
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-core-vpn-predeploy-k9.msi" -Parameters "/QN /NoRestart PRE_DEPLOY_DISABLE_VPN=1"
Start-Sleep -Seconds 30
# AnyConnect Diagnostics and Reporting Tool
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-dart-predeploy-k9.msi" -Parameters "/QN /NoRestart"
Start-Sleep -Seconds 30
# AnyConnect Network Access Manager client which will not work without a config file
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-nam-predeploy-k9.msi" -Parameters "/QN /NoRestart"
Start-Sleep -Seconds 30
# Required config file
Copy-File -Path "$dirSupportFiles\configuration.xml" -Destination "$ENV:ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\newConfigFiles"
## Cisco Umbrella Installer
# This should only install on laptops but does not appear to cause issues if installed on VDI/Desktop
$Battery = (Get-WmiObject -Class Win32_Battery)
If ($Battery.BatteryStatus -gt 0) {
# Laptops
# This location should exist already, will create if not
New-Folder -Path "$ENV:ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Umbrella"
# Umbrella requires a .json file in order to function
Copy-File -Path "$dirSupportFiles\OrgInfo.json" -Destination "$ENV:ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Umbrella"
# AnyConnect Umbrella client
Execute-MSI -Action Install -Path "$dirFiles\anyconnect-win-4.9.01095-umbrella-predeploy-k9.msi" -Parameters "/QN /NoRestart"
# Umbrella apparently requires a reboot. Stopping and starting the Umbrella service
# mitigated the need for reboot. This step was missing during initial testing
Get-Service "acumbrellaagent" | Stop-Service -ErrorAction SilentlyContinue
Start-Sleep -Seconds 5
Get-Service "acumbrellaagent" | Start-Service -ErrorAction SilentlyContinue
}
Else {
# Desktop, do not install
}
Post-Install/Restoring backed up files
## Restore NAM profiles
If (Test-Path -Path "C:\Windows\Temp\ACBackup") {
$Destination = "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\newConfigFiles"
$Source = "C:\Windows\Temp\ACBackup"
Get-ChildItem $Source -Recurse | ForEach {
Copy-File -Path $_.FullName -Destination $Destination
}
Remove-Folder -Path "C:\Windows\Temp\ACBackup"
}
Else {
# No backup files exist
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide