Install and use the login script

The login script is installed on the instance and can be downloaded directly from a module.

Before you begin

Role required: admin

About this task

The same script is used to perform the Help the Help Desk scan, which gathers information about a user's Windows computer and updates the CMDB.

Procedure

  1. Log in to your instance with Windows Internet Explorer.
  2. Navigate to System Definition > Help the Help Desk Login Script.
  3. Follow the download instructions in the page that appears.
  4. Put the helpthehelpdesk.js file in the following folder: %SystemRoot%\sysvol\sysvol\<domain DNS name>\scripts where %SystemRoot% is usually c:\winnt or c:\WINDOWS and <domain DNS name> is the DNS name of the domain, similar to MyDomain.com.
    This folder is replicated to all domain controllers in the domain.
  5. Open the helpthehelpdesk.js file in a text editor, such as Wordpad.
  6. Check the var server line to ensure that the URL for your ServiceNow instance is correct.
    The name of the instance is added automatically. It should look something like this:

    var server = "https://abctech.service-now.com/";

    Login script example
  7. Ensure that basic authorization for SOAP requests is enabled in your instance, and a SOAP user is defined.
    This allows the script to connect to your instance. The entry should look something like this:
        var httpUsername = "user_on_your_instance"; 
        var httpPassword = "user's_password"; 
  8. Create a Logon.bat script to run helpthehelpdesk.js as follows.
        @echo off 
        cscript %0\..\helpthehelpdesk.js 
        EXIT 
  9. Add Logon.bat to the Logon script field on the Profile tab of the user properties dialog in the Active Directory Users and Computers MMC corresponds to the scriptPath attribute of the user object.
    Logon scripts can also be configured in Group Policy. However, Group Policy only applies to clients with Windows 2000 or above. The setting in Group Policy is User Configuration, Windows Settings, Scripts (Logon/Logoff), Logon. Best practice is to copy the file you want for the Logon script to the Windows clipboard.
  10. Open the Logon setting in the Group Policy editor.
  11. Click the Show Files button.
  12. Paste the desired file in the dialog.
    You can select the file and edit it in this dialog as well. This is easier than navigating in Windows Explorer to the folder where Group Policy Logon scripts are saved. However, if you do have to navigate to the folder, the path on the domain controller is:

    %SystemRoot%\sysvol\sysvol\<domain DNS name>\<policy GUID>\user\scripts\logon

    Again, %SystemRoot% is usually c:\winnt and <domain DNS name> is the DNS name of the domain, similar to MyDomain.com.

    <policy GUID> is a hexadecimal string representing the GUID (unique identifier) of the specific Group Policy Object (GPO). Group Policies are assigned to a domain, site, or organizational unit in Active Directory.

    The logon script setting applies to all users in the domain, site, or organizational unit to which the GPO applies. You will notice that you assign a logon script to all users in the container at once, rather than having to assign the scriptPath attribute for each user. This makes it much easier to assign logon scripts to many users. However, since the same Group Policy applies to all users in the domain, site, or organizational unit, you must code the logon script to accommodate all users.