Skip to main content

NightWatchman Enterprise 7.3

Web WakeUp authorization table

The Web WakeUp tables added to the Agility Framework database are also supplied with an SQL Server Agent job that can be used to populate the tbWWU_Authorised_UserMachines table from a .csv file.

The SQL Server Agent job is called 1E Web WakeUp, Import Authorisation. Before running it, you must first create the source authorization input file and set the SQL Server Agent job to use the file.

Note

Running the SQL Server Agent job will clear any existing data from the authorization table, except for "power user" type entries where the computer name is set to "".*

The authorization input file format

The input file for the 1E Web WakeUp, Import Authorisation SQL Server Agent job is a .csv format file where each line in the file contains the following information in the following format:

  • <User ID > is the user whose authorization is being set. When using Windows authentication <UserID> should be in the format DomainName\UserName.

  • <Computer Name> is the netBIOS name of the computer the <UserID> is allowed to wake.

  • <Domain Name> is the domain the computer is running on.

The example below is an authorization input file with three entries:

Revised 9/4/2009 ESA for WWU implementation,,
ACME\rachel,devwks1,ACME
ACME\rachel,devwks2,ACME
ACME\joey,saleswks2,ACME

Although the first line must also have three comma separated elements, it is treated as a header line and ignored. Notice how the first line, as it is ignored by the import process, can be used as a place to store notes on the file.

Setting the authorization input file

To set the SQL Server Agent job to reference a specific authorization file you need to modify the SQL Server Agent job's Import CSV step in SQL. The command-line for this step is:

EXEC [dbo].[spWWU_Import_Authorised_UserMachines] 'C:\CN-DN-PU.csv'

Change the default file referenced at the end of the command-line to point to your .csv file. For example, to set the SQL Server Agent job 1E Web WakeUp, Import Authorisation to use C:\1EWWU\ACME\acme.csv:

EXEC [dbo].[spWWU_Import_Authorised_UserMachines] 'C:\1EWWU\ACME\acme.csv'

To edit this job in SQL Server Management Studio:

  1. Navigate to SQL Server Agent/Jobs.

  2. Right-click 1E Web WakeUp, Import Authorisation and choose Properties from the context menu to open the Job Properties - 1E Web WakeUp, Import Authorisation dialog.

  3. In the Select a page column on the left, choose Steps to display the Job Step List in the right pane.

  4. Select the only job step Import CSV and click the Edit button to display the Job Setp Properties - Import CSV dialog.

  5. In the Command: field, edit the currently displayed SQL command from:

    EXEC [dbo].[spWWU_Import_Authorised_UserMachines] 'C:\CN-DN-PU.csv' 

    to (in order to point to your particular authorization file):

    EXEC [dbo].[spWWU_Import_Authorised_UserMachines] 'C:\1EWWU\ACME\acme.csv'
  6. Click OK to save your changes and close the Job Step Properties - Import CSV dialog.

  7. Click OK to close the Job Properties - 1E Web WakeUp, Import Authorisation dialog.

  8. You can then execute the modified job to import the specified data:

    1. Right-click the SQL Server Agent/Jobs/1E Web WakeUp, Import Authorisation node and select Start Job at Step... item from the context menu.

    2. The job will start running. In the Start Jobs - <ServerName> dialog confirm that the Status returned at the end is Success.

    3. Click Close to complete the job execution.

  9. After execution open the table tbWWU_Authorised_UserMachines to confirm the results are as expected.

When the SQL Server Agent job is run

The following steps shows what happens when the SQL Server Agent job is run:

  1. Existing entries in the authorization table are removed, except for 'power user' type entries where the computer name is set to "*".

  2. The new entries from the input file are added to the authorization table.

Note

One consequence of this sequence is that 'power user' type entries where the computer name is set to "" should only ever be added to the database by hand and not added to the input .csv file as this may result in the import failing due to primary key violations in the database.