uninstall Global protect

KurdTech
New Contributor II

Hello Folks,

i am trying to uninstall Global protect from all machines. Does anyone know how to accomplish this task. Any tips or advice appreciate it.

Thank you

8 REPLIES 8

mm2270
Legendary Contributor III

Palo Alto has an article on their site that may help.
https://docs.paloaltonetworks.com/globalprotect/5-0/globalprotect-app-user-guide/globalprotect-app-f...

Glancing over it, it looks like they recommend using the installer to choose the uninstall option when running it. Which means you will need to script an uninstall using the installer command line and a ChoiceChangesXML to specify the uninstall option.

I only have an old copy of GlobalProtect at the moment, from 2019, but running the installer -showChoicesXML option on it shows me the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <dict>
        <key>childItems</key>
        <array>
            <dict>
                <key>childItems</key>
                <array/>
                <key>choiceDescription</key>
                <string>Select this to install GlobalProtect in your computer.</string>
                <key>choiceIdentifier</key>
                <string>globalprotectid</string>
                <key>choiceIsEnabled</key>
                <true/>
                <key>choiceIsSelected</key>
                <integer>1</integer>
                <key>choiceIsVisible</key>
                <true/>
                <key>choiceSizeInKilobytes</key>
                <integer>13652</integer>
                <key>choiceTitle</key>
                <string>GlobalProtect</string>
                <key>pathsOfActivePackagesInChoice</key>
                <array>
                    <string>file://localhost/Users/mikem/Documents/Installers/GlobalProtect.pkg#globalprotect.pkg</string>
                </array>
            </dict>
            <dict>
                <key>childItems</key>
                <array/>
                <key>choiceDescription</key>
                <string>Select this to uninstall NetConnect from your computer.</string>
                <key>choiceIdentifier</key>
                <string>uninstallnetconnectid</string>
                <key>choiceIsEnabled</key>
                <false/>
                <key>choiceIsSelected</key>
                <integer>0</integer>
                <key>choiceIsVisible</key>
                <false/>
                <key>choiceSizeInKilobytes</key>
                <integer>4</integer>
                <key>choiceTitle</key>
                <string>Uninstall NetConnect</string>
                <key>pathsOfActivePackagesInChoice</key>
                <array>
                    <string>file://localhost/Users/mikem/Documents/Installers/GlobalProtect.pkg#uninstallnetconnect.pkg</string>
                </array>
            </dict>
            <dict>
                <key>childItems</key>
                <array/>
                <key>choiceDescription</key>
                <string>Select this to uninstall GlobalProtect from your computer.</string>
                <key>choiceIdentifier</key>
                <string>uninstallglobalprotectid</string>
                <key>choiceIsEnabled</key>
                <true/>
                <key>choiceIsSelected</key>
                <integer>0</integer>
                <key>choiceIsVisible</key>
                <true/>
                <key>choiceSizeInKilobytes</key>
                <integer>4</integer>
                <key>choiceTitle</key>
                <string>Uninstall GlobalProtect</string>
                <key>pathsOfActivePackagesInChoice</key>
                <array>
                    <string>file://localhost/Users/mikem/Documents/Installers/GlobalProtect.pkg#dummy.pkg</string>
                </array>
            </dict>
        </array>
        <key>choiceIdentifier</key>
        <string>__ROOT_CHOICE_IDENT_GlobalProtect</string>
        <key>choiceIsEnabled</key>
        <true/>
        <key>choiceIsSelected</key>
        <integer>-1</integer>
        <key>choiceIsVisible</key>
        <true/>
        <key>choiceSizeInKilobytes</key>
        <integer>0</integer>
        <key>choiceTitle</key>
        <string>GlobalProtect</string>
        <key>pathsOfActivePackagesInChoice</key>
        <array/>
    </dict>
</array>
</plist>

I see a few 'uninstall' options listed, so theoretically you should be able to put together a choice changes xml file to direct it to that will run the uninstall options.

I can't give you the options right here, but if you have trouble getting it together, post back and I'll try to help with building the proper xml.

KurdTech
New Contributor II

Thank you mm2270, i will look into it and see how it go, also can i simply create a policy>File and process>execute command sudo /Applications/GlobalProtect.app/Contents/Resources/uninstall_gp.sh. will that work?

mm2270
Legendary Contributor III

Ah, yeah, if there's an existing uninstall script in the app Resources folder, then that's probably the way to go. Test of course, but if that works, then that's probably easier than crafting the ChoiceChangesXML file and pushing that along with the package and running it.

sdagley
Esteemed Contributor II

The /Applications/GlobalProtect.app/Contents/Resources/uninstall_gp.sh script is identical to the postinstall script which runs when you use the gp_uninstall.pkg option for the Globalprotect installer, so definitely seems like the best option.

Note: If you have the GlobalProtect System Extension installed, running the removal script will display an authentication prompt asking the user to authorize its removal.

KurdTech
New Contributor II

Thank you Sdagley/mm2270. i appreciate your input. i will give it a try today.

nberanger
Contributor
Posted: 10/26/2020 at 2:46 PM CDT by Kavanmavati Thank you Sdagley/mm2270. i appreciate your input. i will give it a try today.

Did you get this to work? I need to update the client on our fleet, and it looks like I may have to remove the old one first.

jamesdurler
Contributor

I'm having similar issues and have found the gp_uninstall.sh in the GlobalProtect.app is identical to the uninstall script used in the GlobalProtect.pkg

@sdagley Is there a way to get the system extension uninstalled silently without the authentication prompt popping up - our users are standard users

sdagley
Esteemed Contributor II

@jamesdurler The prompt on uninstalling a System Extension is imposed by Apple, and at this time there's no workaround I've heard of. Probably worth opening a support case with Apple given that for MDM managed Macs one can eliminate the prompt for installation, so logically one should be able silently remove as well.