Version
6.0.x, 7.0.x; 7.2.x.
Topic
This document describes how to update multiple computer tags using a SQL script.
Steps
You can use the "Computer Tag" field in the properties of Computer objects to help organize and manage your Bit9 agent installation. In this example, we will map the IP address of a given computer to the Computer Tag for that computer:
- Create a plain text file for the mappings. It must have comma-delimited rows, with quotes enclosing the values, and a column header row. Here is an example of the contents of such a file:
ip_address,comment
"192.168.16.5","Baltimore Register 1"
"192.168.7.80","Philadelphia Register 2"
- Name this file "ip_to_name_mappings.txt". Then place it at the root of the C: drive, on the SQL Server where the Bit9 database is. You cannot place this file on some other server or workstation.
- Run the query below. You will need full SQL Server administrator permissions in order to run this particular query.
use das;
update
dbo.hostmain
set
dbo.hostmain.comment = source.comment
from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0','Text;Database=C:\;','SELECT * FROM [ip_to_name_mappings.txt]')
as
source,
dbo.hostmain
where
dbo.hostmain.host_id in (
select Computer_Id
from bit9_public.ExComputers
where bit9_public.ExComputers.Ip_Address = source.ip_address
)
;
Important Note(s)
The SQL query requires your DBA to enable "Ad Hoc Distributed Queries." Check with your SQL Server administrator about setting these permissions before you run the script.