• Print
  • Share
  • Dark
    Light

How Do I Remove a Server?

  • Updated on 15 Jun 2018
  • 1 minute to read
  • Contributors

Servers that are offline for more than a certain amount of time will be automatically deleted unless you disable that setting.

There may be times when you want to remove a server or add back a server that you removed previously. Here are the steps:

Click on the Settings Icon for the server you want to remove

Find "Remove Server"

Confirm the Removal

Once the button is pressed a remote command is sent to the agent to uninstall. In order to re-add the server after this process you will need to reinstall the agent again.

How to Remove Servers Programmatically

This article is intended to help you leverage Stackify's API by making a REST service call to programmatically remove Retrace instances from the Servers page of Retrace. To see how to remove servers from the Retrace portal, see the "How Do I Remove a Server" article.

Below are the REST calls to the API for both Windows and Linux machines that can be added to shutdown scripts of your server.

Remove a Server with PowerShell

Plug in your API key found in the Settings page of your account and run the call as a PowerShell script:

Invoke-RestMethod -Method POST -Header @{ "X-Stackify-Key" = "license_key_here" } -uri https://api.stackify.com/API/Device/RemoveServerByName/?name=$env:computername 

Note: The $env:computername variable makes an assumption of what your computer name is. There may be cases where you may need to manually set the computer name: /?name=your_server_name

Remove a Server with PowerShell

curl -X POST -i -H "X-Stackify-Key: license_key_here" -H "Content-Length: 0" https://api.stackify.com/API/Device/RemoveServerByName/?name=hostname

Using hostname makes an assumption of what your computer name is. There may be cases where you may need to manually set the computer name: /?name=your_server_name

After making the REST call, you should see your instances removed from the Servers page in your Retrace account almost immediately.