6.3.8. Uninstalling the Agent
To uninstall the Agent application from your machine, follow the simple steps provided below. Whether you no longer require its services or need to troubleshoot any issues, uninstalling the Agent is a straightforward process.
6.3.8.1. Windows
To uninstall the Agent from your Windows system, run the following script:
Important
The download of the script can be done from PowerShell admin or from a normal user but the script has to be run from PowerSehll admin.
iwr -Uri 'https://repo-opennac.opencloudfactory.com/windows-agent/scripts/agent-manager/agent-uninstall-windows.ps1' -OutFile agent-uninstall-windows.ps1 -Headers @{ Authorization = "Basic "+ [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("your_repo_user:your_repo_password")) }
Note
Replace your_repo_user:your_repo_password with your login credentials for the opennac repo.
6.3.8.1.1. Active Directory GPO remote uninstalling
For cases when you need to uninstall the Agent remotely across multiple computers within an Active Directory domain, you can use Active Directory GPO to automate the installation process. This section will guide you through the steps to install the Agent on your network.
6.3.8.1.1.1. Creating a new GPO
To create a new GPO, open the Group Policy Management editor window:

Right-click on the corresponding domain to create a new GPO:

A dialog box will appear. We will name our new GPO Test and click ok OK:

6.3.8.1.1.2. Adding the script to the GPO
Right-click the recently created GPO and click on Edit:

In the Group Policy Management Editor, navigate to:
User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff) > Logon.

Select the PowerShell Scripts tab and click on Show Files:

Copy the the script you have just downloaded from the Administration Portal into this folder:

Close the folder and in the Logon Properties dialog, click on Add and select the recently copied script.

It might take a while for the GPO Policies to be applied. If you need an instant application, run the following command in Powershell:
Invoke-GPUpdate
Once this configuration is complete, the OpenNAC Agent will be uninstalled.
6.3.8.2. MacOS
To uninstall the Agent from your MacOS, run the following script:
/Applications/OpenNACAgent.app/Contents/Resources/uninstall.sh
6.3.8.3. Linux
To uninstall the Agent from your Linux system, run the following script:
sudo apt remove opennacagent