cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

IT Agent is a lightweight agent you install on Windows, macOS, or Linux devices to scan them and send discovery data directly to Lansweeper Sites in the cloud. You can use the steps below to re-link an existing IT Agent installation to a new Lansweeper Site using a new linking code.

Prerequisites

Before you start, make sure:

  • You can sign in to your Lansweeper Site (cloud) with permissions to manage Discovery systems.
  • You have local administrator rights on the computer where Lansweeper IT Agent Discovery is installed.
  • You can open and edit text files on that computer.
  • You know that the default IT Agent folder on Windows is: Program Files\Lansweeper IT Agent Discovery\itagent

If you need installation details for IT Agent, see the official guide:

Step-by-step instructions

1. Generate a new cloud token in Lansweeper Sites

  1. Sign in to your Lansweeper Site in the browser.
  2. Go to Discovery in the left menu.
  3. Click Link Discovery system.
  4. Generate a new token.
  5. Copy the token and keep it somewhere safe (you will paste it into a file in a later step).

2. Stop the IT Agent Windows service

On the computer where IT Agent is installed:

  1. Open Services (for example, press Win + R, type services.msc, and press Enter).
  2. Find the service named IT Agent Discovery Service.
  3. Right-click it and select Stop.

3. Create the cloudtoken.txt file with the new token

  1. In File Explorer, browse to:
    C:\Program Files\Lansweeper IT Agent Discovery\itagent
  2. In this folder, create a new text file named exactly:
    cloudtoken.txt
  3. Open cloudtoken.txt in a text editor (for example, Notepad).
  4. Paste the new cloud token into the file.
  5. Make sure there are no extra spaces or lines before or after the token.
  6. Save the file and close the editor.

4. Remove the old local hub database file

In the same folder:

  1. Still in C:\Program Files\Lansweeper IT Agent Discovery\itagent, find the file:
    hub.db
    (this is the local database file the agent uses to store its link/configuration).
  2. Delete the file hub.db.
    • This forces the agent to rebuild its local database and use the new token when it starts again.

5. Restart the IT Agent Windows service

  1. Go back to Services on the same computer.
  2. Find IT Agent Discovery Service again.
  3. Right-click it and select Start.

What happens now:

  • The service reads the cloudtoken.txt file.
  • It uses the new token to link to your Lansweeper Site.
  • It recreates hub.db with fresh connection data.
  • Once the link is successful, IT Agent automatically deletes cloudtoken.txt for security.

This may take a short while (usually a few minutes).

6. Clean up duplicate Discovery systems in Lansweeper Sites

After the relink, Lansweeper Sites will see this as a new Discovery system with the same name as the old one:

  1. In Lansweeper Sites, go to:
    Discovery  Discovery Systems  Agent based.
  2. You should now see two entries with the same name:
    • One is the new, active IT Agent installation.
    • The other is the old entry you no longer use.
  1. Click the old Discovery system entry.
  2. In the top-right corner of that page, click Delete.
  3. Confirm the deletion.

This keeps your Discovery Systems list clean and avoids confusion.

How to verify the relink worked

On the IT Agent machine:

  • Check that the file hub.db has been recreated in Program Files\Lansweeper IT Agent Discovery\itagent.
  • Confirm that cloudtoken.txt has disappeared from the same folder.
  • Make sure IT Agent Discovery Service is Running in Services.

In Lansweeper Sites:

  1. Go to Discovery  Discovery Systems  Agent based.
  2. Verify that:
    • The new Discovery system shows as online/healthy (status indicator).
    • The Last seen or Last activity time updates after a short while.
  • Optionally, check that assets scanned by this IT Agent appear in your Lansweeper Site as expected (for example, check last scan times on a known device).

If all these checks pass, your IT Agent installation is successfully linked to the new cloud token.

Related knowledge base articles

These articles provide additional background and installation details (they are not required for the relink steps above but can be useful):

Install IT Agent Discovery
Requirements and installation instructions for IT Agent Discovery on Windows, Linux, and macOS.
https://community.lansweeper.com/t5/cloud/install-it-agent-discovery/ta-p/67029

Set up and run Lansweeper IT Agent Discovery Portable
How to use the portable version of IT Agent for on-demand discovery.
https://community.lansweeper.com/t5/cloud/set-up-and-run-lansweeper-it-agent-discovery-portable/ta-p...

Was this article helpful? Yes No
No ratings

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now
Version history
Last update:
‎12-09-2025 09:07 AM
Updated by: