Automated PC shutdown: save money, energy and the environment
This set of FAQs provides answers to common support questions asked about NightWatchman, its functionality and its settings. For answers to more detailed questions you can search the 1E knowledge base at www.1e.com, or contact 1E directly at support@1e.com for technical queries, or sales@1e.com for all other questions.
NightWatchman is a client-side service that allows administrators to control the power state of PCs on a network. NightWatchman is installed on each client. It may be installed remotely and silently enabling easy power management control over a large number of machines. Using NightWatchman it is possible to achieve 100% known state for all workstations. This assists in desktop management, software delivery and energy saving.
OS requirements NightWatchman should install and be configurable on any Workstation running the following Microsoft operating systems:
Windows Vista (Business, Enterprise, Enterprise x64 and Ultimate)
Windows XP SP2 and above
NightWatchman will not install on any Microsoft Server systems.
Software requirements NightWatchman requires the following software installed on the local PC:
Microsoft Visual C++ 2005 redistributable - this should be present if you have any of the Microsoft Office 2007 products installed locally. Alternatively you can download the redistributable here.
System requirements The machine NightWatchman runs on must be APM/ACPI compliant.
Security requirements NightWatchman is a service that is installed on client machines. To install NightWatchman successfully you will need administrator privileges for the PC on which NightWatchman is to be installed. Once installed NightWatchman does not need any further administration privileges. Back to top
Installing NightWatchman is either done interactively by double-clicking on the installer file
and following through the on-screen wizard, or silently using the msiexec command-line.
The simplest way to install interactively is to accept all the defaults in the wizard - this
will cover 80% of the normal NightWatchman usage. Alternatively you can choose the custom
install to initialize the most commonly used NightWatchman settings by hand.
To install silently, without interaction, you can use a command-line similar to the following:
msiexec /i NightWatchman50.msi /qn
Full details on the NightWatchman installation are provided in The NightWatchman Installation Guide, which also shows the flags for controlling the NightWatchman silent installation.
Back to top
The NightWatchman installation is provided with a default 30-day evaluation license. If you want to purchase a full license or require further time to complete your evaluation, please contact sales@1e.com.
NightWatchman can be registered with the new license key in the following ways:
When installing NightWatchman interactively the License Key can be manually entered on the
User Information screen. If you leave this field blank, you will be given a free 30-day
evaluation period from the date of first installation - this last method will not work once
the initial evaluation period has expired.
Silently using the windows installer command-line:
Where ABCD-1234-5678-8765-4321 represents the valid license key obtained from 1E.
After installation on the command-line. This enables you to apply the new license without uninstalling NightWatchman. Change the directory to the NightWatchman installation and run the following command:
How do I tell if I need to relicense NightWatchman?
When NightWatchman is running in evaluation mode it will write something equivalent to the following in the NightWatchman log file:
Initialising Version 5.0 (Mth Date Year) on <ComputerName> X days left
Where <ComputerName> represents the name of the machine where NightWatchman is running. The X days left indicates how many days are remaining in the evaluation period. After this time period you will need to relicense NightWatchman to continue.
The NightWatchman log files NightWatchman.LOG and NightWatchman50.LO_ can be
found in the C:\Documents and Settings\All Users\Application Data\1E\NightWatchman directory.Back to top
The functionality of the NightWatchman service can be extended by creating additional shutdown
scripts. Administrators can write Windows scripts in either JScript or VBScript to handle the
intelligent shut down of applications, so that no data is lost when performing a user log-off.
The scripts can handle eventualities such as saving current versions of all open files, as
well as making backups of previously saved versions so users can back out of latest changes if
they prefer not to keep them. Any open dialogs are also handled in order to execute the
closure of the application in a safe way.
NightWatchman is provided with pre-defined scripts that handle the following products:
Microsoft Outlook, Microsoft Word, Microsoft PowerPoint, Microsoft Excel and Notepad. To
handle other applications you can either contact 1E or write your own additional scripts using
the details provided in The NightWatchman Scripting Reference.
To do this you use the -shutdowntime flag. For example, change the directory to the NightWatchman installation and run the following command:
Nightwatchman.exe -shutdowntime=20:30
This example sets NightWatchman to shutdown at 8:30 pm.
The command-line switches to configure NightWatchman can be sent from any systems management console to all the machines requiring management.
This is the most frequently used configuaration for NightWatchman. Powering off PCs saves
energy and ensures that the PCs have a clean start each day. NightWatchman shuts down PCs
without losing the unsaved work of logged on users; executing scripts to make sure that any
active applications are closed in a safe fashion.Back to top
How do I put a machine into hibernate or standby mode?
In addition to the shutdownnow command, NightWatchman has two commands that act immediately to put a PC into hibernate or standby mode. These commands are called hibernatenow and standbynow.
For example the following command prompts NightWatchman to immediately put the local PC into hibernate mode:
How do I perform a one-off shutdown without affecting my normal NightWatchman settings?
NightWatchman has a new command, onceoff, that enables one-off shutdowns with custom shutdown settings. You can customise the one-off shutdown using the logoffaction, shutdownaction, countdownsecs and shutdownmsg switches.
For example, the following NightWatchman command-line sets a one off shutdown where the logoffaction for that shutdown only will be force, and the shutdown will occur at 7:30 pm:
How do I force users to log-off in a secure environment?
Change the directory to the NightWatchman installation and run the following command to enforce a shutdown on all machines at 8:30 pm allowing no user intervention via the system tray interface:
In contemporary secure environments it is a requirement that users are logged off from systems when they leave the office. NightWatchman can log-off users even if the system has been locked, or if a password-protected screensaver is in use. NightWatchman can force the system to shut down if you want to be absolutely sure that your systems are shutdown each day at the same time NightWatchman will save any open user data and close applications using the NightWatchman scripts.Back to top
Aside from powering off machines and logging off users, NightWatchman can also control the power schemes currently in use. This means that the settings for power conservation, such as putting the monitor, hard disks and computer into standby mode, can be unified into an enforceable company wide scheme.
The switches available for managing the power schemes mirror the options that are available to the user through the system property dialog. They are divided into two main groups: switches that control the settings when the machine is on mains power, and those that control the settings during battery operation.
Change the directory to the NightWatchman installation and run the following command:
The shutdowndays command-line switch sets the days of operation where the scheduler will fire. The days are specified as integers, where 0 = Sun, 1 = Mon, 2 = Tue etc. The days may be set individually separated by commas or as a range separated by a dash.
Change the directory to the NightWatchman installation and run the following command:
nightwatchman.exe -shutdowndays=2,3,5
This command sets the scheduler to run on Tuesday, Wednesday and Friday only.
The following command sets the scheduler to run all days between Monday and Friday.
nightwatchman.exe -shutdowndays=1-5
The default is for the scheduler to run all days.
Back to top
The shutdowntime command-line switch sets the time when the scheduler will trigger the shutdown. This switch can be configured to never shut down or to shut down at a specific time. The time must be given in 24 hour format, with the hours separated from the minutes by a colon.
Change the directory to the NightWatchman installation and run the following command:
nightwatchman.exe -shutdowntime=18:30
This command line schedules a shutdown at 6:30 pm.
The following command turns scheduled shutdowns off:
How do I pre-license NightWatchman for use in a baseline PC image?
If you're installing NightWatchman onto a baseline image that will then be deployed to other PCs in your network, you will have to preset the license information in the registry.
You can do this by installing and then stopping the NightWatchman service on the baseline PC, and then by editing the registry as follows:
1.
Delete the
HKLM\SOFTWARE\1E\NightWatchman\LicData\LicData2 key
2.
Set the value
HKLM\SOFTWARE\1E\NightWatchman\LicData\LicData to 00 00 00 00 00 00 00 00.
3.
Set the string value
HKLM\SOFTWARE\1E\NightWatchman\LicData\MSIPidkey to a valid license key.
When the image is applied to the new machine, and the machine has been given its new name, NightWatchman will validate the new license key when it is started for the first time.
Alternatively, you can use the command-line -relicense option once the image has been restored.Back to top
Is it possible to use NightWatchman to shut down a machine more than once a day?
NightWatchman does not specifically support the scheduling of multiple shutdowns during a day. You can however write a batch file that invokes NightWatchman with the -shutdownnow command line option. This could be easily implemented using a scheduled advertisement in Microsoft Systems Management Server.
How do I install NightWatchman to shut down at a specific time?
The NightWatchman shutdown schedule can be configured during a custom interactive installation using the installer wizard or using flags passed on the msiexec command line. To use the first method you select custom install and then follow the on-screen instructions in the NightWatchman installer wizard. The second method requires that you pass the SHUTDOWN_HOUR and SHUTDOWN_MIN parameters to msiexec, as follows:
How do I configure NightWatchman to shut down at a specific time from the command-line?
The command-line option for configuring the shutdown time is -shutdowntime to use this you pass it on the NightWatchman command-line with the time you want to shut down at.
Change the directory to the NightWatchman installation and run the following command:
NightWatchman comes with a set of scripts that are used to save your open files. In order to
avoid overwriting your original files with unwanted changes, these are saved to a holding
area. When you log back on, NightWatchman gives you the opportunity to re-open these saved
files.
How do I cleanly shutdown applications not supported by NightWatchman?
You can write scripts that extend the behaviour of NightWatchman to include currently unsupported applications. For more details on writing NightWatchman scripts please refer to The NightWatchman Scripting Reference.
How do I change the default NightWatchman backup directory?
Changing the backup directory is done by modifying the scripts that come with NightWatchman.
The NwmScript.BackupDirectory variable returns the default location where the NightWatchman
backups are to be saved. This directory is set by NightWatchman as: C:\documents and settings\<username>\application data\1e\NightWatchman\
Where <username> refers to the current user's logon name.
If you want to change the save location for the NightWatchman backups you should change the
code that sets the dumpdir variable, as shown in the last line of the above code fragment, to
a location of your own choosing. For example, the following code sets the dumpdir
variable to point to another temporary location:
dumpdir = “u:\temp”
Note: this example specifies the use of the user mapped drive u:. You can of course set this to any mapped drive the user may have set up on their PC. The advantage of using a user mapped drive is that users of the PC will be able to keep their NightWatchman backup files separate from all other users.
The Power & Patch Management Pack from 1E enhances and extends
Microsoft SMS / System Center Configuration Manager and enables 100% patch
management success. This pack bundles SMSWakeUp and NightWatchman to deliver a
powerful patching and software update solution.