Resident agent scan

This type of scan uses TNI's Windows agent to automatically scan any Windows computer without the main unit's direct participation. It can be arranged by installing the resident agent as a service on the remote computer. The service then performs scheduled scans and can send the data file  generated after each scan  via e-mail or FTP, or save it to a network share. The data files can then be imported to the TNI Storage either manually or automatically. The advantage of this scanning type is in the ability to collect information from computers that the main TNI unit has no or limited access to.

Setting up the resident agent

Go to the Scanner tab and click the Set up resident agent button on the Sidebar (or open the Options window and go to the Resident agent page).

Resident agent settings

  • Show resident agent deployment controls in the Scanner: allows to make the buttons Deploy and Remove resident agent on the Sidebar in the Scanner tab visible or hide them. See Automatic resident agent deployment and uninstallation.
  • Auto-update the agent or settings from a network resource (HTTP or SMB): allows to set the path to the folder on a web or file server that the resident agent can self-update or obtain new settings from. See Updating the resident agent.
  • Data transfer method: allows to select one of the 3 available protocols using which the scan results are to be sent. If the Do not sent data option is set, the files will be saved to the current folder where the agent is installed (for the automatically deployed agent, it's C:\Windows\TNIRESIDENTAGENT\).
  • Keep sent data in the 'Sent' folder: allows to disable automatic deletion of inventory files after they're sent. Files can be found in subfolder Sent inside the current folder where the agent is installed (for the automatically deployed agent, it's C:\Windows\TNIRESIDENTAGENT\Sent\).
  • Use the Export resident agent… button to place the agent's files into the folder of your choice for further manual deployment on remote computers. The files exported include a copy of the Windows agent (tniwinagent.exe), the settings file (tniwinagent.ini) and  if required by the agent according to the settings (see below)  2 libraries (libeay32.dll and ssleay32.dll).

The two libraries will be exported along with the agent and necessary for its correct operation when any of the following combinations of settings are used:

  • Data transfer method is set to SMTP, Send to MX server is disabled, and either STARTTLS or TLS/SSL is selected as the Security level;
  • Data transfer method is set to FTPFTP proxy is disabled, and an FTPS address is specified as the URL;
  • Auto-updates from a network resource are enabled via HTTPS.

If FTP proxy is enabled, encryption will not be used even if an FTPS address is specified in the URL field.

When using FTPS, the agent will attempt to encrypt both the command channel and the data channel. If the server does not support this (and some servers won't), only the command channel will be encrypted during further transfers.

For both the SMTP and FTP transfer methods, TLS is not enforced. If the server does not support TLS, the transfer will be performed over an unencrypted connection.

Agent activity schedule

Configured similarly to the Scan scheduler.

Scheduling the agent launch is essential. If the schedule is not created, no scans or data transfers will be performed.


Automatic resident agent deployment and uninstallation

Automatic deployment is initiated from the Sidebar in the Scanner tab.

Before deployment, set up the Resident agent. Then add computers to the task list, select logins and click Deploy resident agent on the Sidebar.

Buttons Deploy and Remove resident agent will be displayed only if enabled in Resident agent options, and if tasks have been added to the task list.

  • Deploy resident agent. The main TNI unit uploads tniwinagent.exe, tniwinagent.ini and, depending on the data transfer and auto-update settings, 2 .dll files to remote computer folder C:\Windows\TNIRESIDENTAGENT and then connects to the Service Control Manager to install and start the agent as a service.
  • Remove resident agent. The main TNI unit connects to the Service Control Manager to stop and uninstall the resident agent service. Folder TNIRESIDENTAGENT is deleted.

    When the resident agent is removed, all content from TNIRESIDENTAGENT, including inventory files and logs, is deleted permanently.

Manual resident agent installation and uninstallation

Manual deployment can be used when the computer that needs to be inventoried is not connected to your network or cannot for whatever reason be deployed to automatically.

For manual deployment, the following steps have to be taken:

  1. Set up the resident agent and use the Export resident agent… button to place tniwinagent.exetniwinagent.ini and, if required by the settings, 2 .dll files into an empty folder.
  2. Copy or move these files to an empty directory on the remote computer where the agent has to be installed. Make sure that the directory will not be deleted from the remote computer by accident.
  3. Install the resident agent service from the resident agent folder using the following command:
    tniwinagent.exe /install
    The following switches can also be used during installation:
    /start will start the service right after the installation;
    /testrun will run a test scan when the service is started for the first time, and the resulting data will afterwards be transferred via the selected protocol.
    If you haven't used the /start switch, you can start the service manually using the services.msc applet, or from the command window using the net start TNIResidentAgent or sc start TNIResidentAgent command.

To remove the service, use the following command:
tniwinagent.exe /uninstall

A message will notify you when the service is successfully installed or uninstalled.

Updating the resident agent and its settings

The resident agent can be updated on the remote computers using one of the following methods:

  1. Re-deploy the agent from the Scanner in TNI.

    In this case, do not remove the resident agent first; otherwise, the contents of the agent's folder – including any saved scan results – will be deleted.

  2. Configure auto-updates from a network resource. For this, enable this option from Resident agent options and specify the path to the directory where the updated versions of the agent and the settings file will be placed. If only the settings need to be updated, then the settings file (tniwinagent.ini) alone may be copied into the specified directory, without the agent file.
    The resident agent automatically checks for updates 5 minutes before the scheduled scan and updates itself if necessary.

    Example path for updating via HTTP:
    http://websiteaddress/folder/

    Example path for updating via SMB:
    \\computername\folder\

    It's not possible to update the agent without the settings file.

  3. Set up the resident agent in program's Options as usual and export it to get an updated tniwinagent.ini file (and an up-to-date tniwinagent.exe as well). Stop the service on the target computer using the services.msc applet or from the command window with the net stop TNIResidentAgent or sc stop TNIResidentAgent command. Copy the new tniwinagent.ini file (and tniwinagent.exe itself, if needed) to the agent folder, overwriting the existing one, and start the service (see Manual resident agent installation). If you only want to update the settings and will copy the new .ini file before stopping or restarting the service, it will be overwritten with the previous settings that the agent still has in memory, so you need to stop the service beforehand.