Schedule Discovery Agents for uninstall from your helpdesk

The Discovery Agents installed in your organization can be uninstalled directly from your Freshservice Portal. To uninstall the Discovery Agents,

  1. Go to Admin -> Discovery
  2. Select the machines where the Discovery Agent has to be uninstalled
  3. Click Uninstall. 

The Agent will be uninstalled from the selected machines the next time when the Freshservice Agent communicates with Freshservice 


Uninstall directly from the device


Windows

  1. Click Start and then click Control Panel.
  2. Go to Programs and Features and from the list of installed applications, click Freshservice Discovery Agent.
  3. Click on Uninstall and follow the wizard to remove it.


Mac

  1. Open terminal and navigate to directory /Library/Freshservice-Agent/Freshservice-Discovery-Agent/bin/
  2. Run the command: 
    • "sudo /usr/local/share/dotnet/dotnet FSAgentService.dll -uninstall"
  3. If the device cannot connect to Freshservice to uninstall the agent, then use this command 
    • "sudo /usr/local/share/dotnet/dotnet FSAgentService.dll -uninstall_force"
  4. If the Access Key is present, run this command to remove the access_key: 
    • "sudo rm /etc/Freshdesk/Freshservice/accesskey"
  5. If the agent blocked status is present, run this command to remove the agent blocked status 
    • "sudo rm /tmp/freshservice_agent_status"
  6. Now the agent is completely uninstalled from the machine.


Linux

  1. Open terminal and navigate to directory /usr/local/sbin/Freshservice/Discovery-Agent/bin/
  2. Run command: sudo /usr/local/share/dotnet/dotnet FSAgentService.dll -uninstall
  3. If the device cannot connect to Freshservice to uninstall the agent, then use this command
    "sudo /usr/local/share/dotnet/dotnet FSAgentService.dll -uninstall_force"


Uninstall from all devices in a domain


Note - The steps in this solution are applicable for Windows Server 2012 only and it may differ for other versions of active directory.


  1. In the Domain Controller, click StartRun → type gpmc.msc and hit Enter. This will open the Group Policy Management Console (GPMC).
    1. In GPMC, right-click on the Domain from which you want to uninstall Agent and select "Create and Link a GPO here".
    2. If you want to uninstall the Agent on computers only in a particular Organizational Unit (OU), right-click that OU and select "Create a GPO in this domain, and link it here".
  2. Give a name to the new GPO (like "UninstallFreshserviceAgent") then click OK.
  3. Right-click the newly created GPO and select Edit from the context menu. This will open the Group Policy Management Editor (GPME).
  4. In the GPME window, navigate to Computer ConfigurationPoliciesWindows SettingsScripts → double click Startup. This will open the Startup Properties window.
  5. Click the Show Files button, and it will open a folder. Copy the fs_win_agent_uninstall.vbs [attached below] to that folder.
  6. In the Startup Properties window, click on Add. Then click Browse and select fs_win_agent_uninstall.vbs from the folder mentioned in the previous step.
  7. Click OK to close the “Add a script” form.
  8. Click OK to close “Startup Properties” window.
  9. Close the GPME window.
  10. In order to enforce the current Group Policy immediately, run the command gpupdate /force.
  11. From then on, Windows machines on that particular domain or OU will uninstall agent on restart.