Skip to main content

NightWatchman Enterprise 7.3

Using the Import Wizard to populate hierarchies

If you have large number of computers, manually populating the building and department groups is an onerous task. NightWatchman comes with an Import Wizard that lets you leverage information from the Active Directory to automate this process.

You can run the import by using the Import Wizard (an interactive process) or from the command-line, allowing the whole process to be batched to enable easy synchronization with the source data. It comes with scripts that support importing Organization Unit or Sites and Subnet data and rely on input files to define how this information maps on to the NightWatchman Group hierarchies. To learn more about these scripts see import scripts and input files.

Recommendations

Before running the Import Wizard in a production environment, we recommend that you perform the following steps:

  1. Define the script input files.

  2. Stop the NightWatchman central service.

  3. Create a backup of the Agility Framework Reporting database.

  4. Start the NightWatchman central service.

Running the Wizard

You can run the Import Wizard interactively from the Start Menu\NightWatchman Management Center\ImportWizard.exe menu item or from a command prompt.

  1. Backup your NightWatchman database before you continue.

  2. The Welcome screen, click Next.

  3. On the Data Import Script screen, provide the following:

    Providing your import parameters
    • Location of the import script to be used to populate the temporary staging table

    • Location of the NightWatchman Management Center database

    • The destination group, location or organisation

  4. On the Confirmation screen, click Next.

    Confirming your actions
  5. On the Import Progress screen, you can see the progress of the import.

    Progress of your import

    You may also be prompted for input in the conflict resolution stage.

    Resolving your import conflicts
  6. On the Completion screen, you can see the results of the import.

    The Completion screen

(question) Click here for a tutorial.

Import scripts and input files

The import Wizard comes with a number of sample scripts that use information from a number of sources to modify NightWatchman Management Center data to associate computers with their respective departments and buildings. These scripts are found in <installdir>\ConsoleService\ImportScripts.

  • The scripts are all named <scriptname>.vbs.template. Copy and rename them to <scriptname>.vbs before you use them with the import Wizard.

  • The input files are all named <inputfilename>.csv.template. Copy and rename to <inputfilename>.csv before you used them with the import Wizard.

For example, copy NWM_StagingTable_With_StoredProcedure.vbs .template and rename it to NWM_StagingTable_With_StoredProcedure.vbs.

The sample scripts do the following:

  • Imports Active Directory Organizational UnitsImports Active Directory Organizational Units

  • Imports Active Directory sites

  • Maps computers to groups

  • Maps Subnets to groups

  • Resolves import conflicts

Note

These scripts are provided as-is without any warranty, expressed or implied, of accuracy, completeness, fitness for a particular purpose, title or non-infringement and are not supported or guaranteed by us.1E shall not be liable for any damages you may sustain by using these scripts, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

Purpose

Script

Import OUs

Map_AD_OUs_To_NWM_StagingTable.vbs.template

Retrieves Organizational Unit (OU) computer details from the Active Directory (AD) and writes them to a staging table ready for conversion into NightWatchman group hierarchies. This template recurses down through the OU hierarchies to retrieve the computer details from all the lower levels.

Dependency: Map_AD_OUs_To_NWM_StagingTable_Input.csv

Each line in the input file tells the import Wizard what it should do with the computers in each OU. It is a comma-separated file and the format for each line is:

 Level1,Level2,Level3,Level4,Level5,OU=OUName,DC=D1,DC=D2... DC=Dn,DCFQDN
  • Levels 1-5 define the location in the NightWatchman Group hierarchy where the computers referenced in the OU are placed.

  • OUName is the name for the OU in the AD. D1... Dn define the AD namespace where each argument refers to an item separated by a dot in the namespace.

  • DCFQDN is the fully qualified domain name for the domain controller.

Import AD sites

Map_AD_Sites_To_NWM_StagingTable.vbs.template

Retrieves computer details from AD sites and writes them to a staging table ready for conversion into NightWatchman group hierarchies. This script returns computer details from all subnets in the site.

Dependency: Map_AD_OUs_To_NWM_StagingTable_Input.csv

Each line in the input file tells the Import Wizard what it should do with the computers in each Site. It is a comma-separated file and the format of each line is:

 Level1,Level2,Level3,Level4,Level5,Site
  • Levels 1-5 define the location in the NightWatchman Group hierarchy where the computers referenced in the OU are placed.

  • Site is the name for the site defined in the AD

Map computers to groups

Map_Machines_To_NWM_StagingTable.vbs.template

Retrieves a list of computer details from the Map_Machines_To_NWM_StagingTable_Input.csv input file and associates them with the specified groups.

Dependency: Map_Machines_To_NWM_StagingTable_Input.csv

Each line in the input file tells the Import Wizard what it should do with the computers in each Site. It is a comma-separated file and the format of each line is:

Level1,Level2,Level3,Level4,Level5,NetBIOSName,ComputerDomain
  • Levels 1-5 define the location in the NightWatchman Group hierarchy where the computers defined by NetBIOSName and ComputerDomain are placed.

Map subnets to groups

Map_Subnets_To_NWM_StagingTable.vbs.template

Retrieves a list of subnet details from the Map_Subnets_To_NWM_StagingTable_Input.csv input file and associates computers with a matching subnet entry into the specified groups.

Dependency: Map_Subnets_To_NWM_StagingTable_Input.csv

Each line in the input file tells the Import Wizard what it should do with the computers in each Site. It is a comma-separated file and the format of each line is:

Level1, Level2, Level3, Level4, Level5, SubnetIP
  • Levels 1-5 define the location in the NightWatchman Group hierarchy where the computers belonging to the subnet with the specified SubnetIP are placed.

Resolve import conflicts

Load_NWM_StagingTable_With_StoredProcedure.vbs.template

The Import Wizard comes with a sample script that resolves to groups items that are in the conflicted table. This sample script shows how to use a stored procedure to load the staging table. It does not require an input file as it works on the conflicted imports table in the NightWatchman Management Console database.

Importing data

Once the import script, target database and target hierarchy have been selected in the Import Wizard,the import process performs the following steps to import the information from Active Directory.

  1. Import data into the staging table – the tbNWM_Dimension_Group_Staging table is used to hold the information gathered from the source prior to converting it to the NightWatchman Console format.

  2. Resolve computers by name – the script selected in the Import Wizard Data Import Script page is run and populates the NetBiosName, DomainName, GroupPath and SourceDataPath columns in the staging table.

  3. Look for computers in more than one group – this step identifies any conflicts in the information being imported where a computer is being allocated to more than one group in either the Organization or Location group hierarchies. When running the wizard interactively, the administrator is prompted to resolve conflicts as they arise.

  4. Add new groups – creates new groups necessary, arising from processing the import data.

  5. Move computers to groups – the identified computers are moved to their allocated groups.

  6. Queue computers for policy refresh – an existing group may have its own power policy assigned, any computer moved into a group is prompted to refresh its policy.

  7. Clear staging table – once the import is completed, the staging table is purged of content.

Command-line parameters

By default the Import Wizard is located in the following directory:

32Bit Machines:C:\Program Files\1E\NightWatchman Management Center\ConsoleService
64Bit Machines:C:\Program Files(x86)\1E\NightWatchman Management Center\ConsoleService

It can be run from a command-line with:

ImportWizard.exe <command-line parameters>

For example, to run the Import wizard in unattended mode on a particular SQL Server instance and using the built-in machine mapping script to assign machines to organization groups:

ImportWizard.exe 
-IsSilent 
-AfrServer SQLSERVER\INSTANCE,14333
-Provider_VBScriptFile="ImportScripts\Map_Machines_To_NWM_StagingTable.vbs"
-TierLevelType="organization"

The command-line parameters for the Import Wizard are:

Parameters

Default value

Notes

AfrServer

The SQL details provided when the Import Wizard component was installed

Location for the NightWatchman Management Center Web Service.

Note

When using this parameter, leave a space between AfrServer and the SQL Server instance name, do not use the = sign.

iSilent

Not silent

Controls whether dialogs are displayed during the import process.

When isSilent is not used, the Import Wizard is displayed to perform the steps interactively, pre-populated with other settings from the command-line.

When isSilent is used, the process is invisible.

Note

When run with IsSilent, conflicts encountered during the import are left in the conflicts table and are not resolved.

You can run the Import Wizard again interactively to determine what to do with the conflicts using the Load_NWM_StagingTable_With_StoredProcedure.vbs script.

Provider_VBScriptFile

Sets the name of the VBScript file used to import data into the staging table.

RemoveStagingTableOnExit

True

Clears the data from the staging table after the import process is completed.

TierLevelType

Location

Group structure for the imported machines. This may be set to either of the following values:

  • Location or L

  • Organization or O

The default values for these parameters are stored in the ImportWizard.exe.config file which also contains the name of the database, however the isSilent value is ignored, which means isSilent parameter must be used to run the process silently.