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:
Define the script input files.
Stop the NightWatchman central service.
Create a backup of the Agility Framework Reporting database.
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.
Backup your NightWatchman database before you continue.
The Welcome screen, click Next.
On the Data Import Script screen, provide the following:
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
On the Confirmation screen, click Next.
On the Import Progress screen, you can see the progress of the import.
You may also be prompted for input in the conflict resolution stage.
On the Completion screen, you can see the results of the import.
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 |
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: 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
|
Import AD sites |
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: 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
|
Map computers to groups |
Retrieves a list of computer details from the Dependency: 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
|
Map subnets to groups |
Retrieves a list of subnet details from the Dependency: 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
|
Resolve import conflicts |
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.
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.Resolve computers by name – the script selected in the Import Wizard Data Import Script page is run and populates the
NetBiosName, DomainName, GroupPath
andSourceDataPath
columns in the staging table.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.
Add new groups – creates new groups necessary, arising from processing the import data.
Move computers to groups – the identified computers are moved to their allocated groups.
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.
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. NoteWhen 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. NoteWhen run with You can run the Import Wizard again interactively to determine what to do with the conflicts using the |
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:
|
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.