NightWatchman can be configured from the command-line by administrators. This enables systems running NightWatchman across an enterprise to be configurable from a central location using any systems management tool that enables commands to be run on remote computers.

Please refer to 1E Agent Mac command-line switches for Macs.

Windows command-line syntax

On NightWatchman for Windows, all switches must be preceded by a dash and all values must be set using an equals sign:

nightwatchman.exe -<switch>=<value>
On this page:

For example, to set the NightWatchman service to start automatically:

nwmsvc.exe -start=auto
The command-line examples assume that NightWatchman is placed on the Windows path or that the administrator has changed directory to the NightWatchman installation folder.

NightWatchman command-line switches

Service switches

There is no equivalent service for the Mac; commands such as relicense are run from the nightwatchman executable.

Switch/optionNotes
nwmsvc -relicenseLicenses NightWatchman with the valid license key.
nwmsvc -startStarts the NightWatchman service.
nwmsvc -stopStops the NightWatchman service.

Executable information switches

You can use these to display information about the current version and settings.

SwitchNotes
versionDisplays the NightWatchman product version number. You will need the version number when contacting 1E support.
settingsDisplays the current NightWatchman service configuration parameters on the command-line.
summaryDisplays the current NightWatchman service configuration parameters on the command-line.
helpDisplays the command-line syntax help.

System switches

Use these to control the core functionality of NightWatchman.

SwitchNotes
countdowndlgtextEnables customization of a countdown message.
countdownsecsNumber of seconds that the countdown timer dialog is displayed before a power-off or log-off action is executed.
hibernatenowPuts the computer into hibernate mode. Works in conjunction with countdownsecs and shutdownmsg.
logoffactionDetermines the behavior when a user is logged onto the system. In Active and Force mode, scripts are executed to close down applications gracefully.
monitorjobsTurns the Configuration Manager job monitoring on or off. monitorjobs also controls the integration with WakeUp. If monitorjobs=ON, NightWatchm an p erforms auto power-off for machines awoken by a scheduled WakeUp signal.
onceoffDetermines whether the other switches on the NightWatchman command-line is applied in a once-off operation.
pendingjobwindowminsDefines the power down behavior according to pending Configuration Manager jobs.
retryattemptsNumber of times a power-off is attempted if cancelled by the user.
retryintervalInterval (in minutes) the service retries the power-off if cancelled by the user or if the power-off cannot be performed.
runalwaysSets the behavior for running the RunAlways script during a NightWatchman initiated log-off, power-off or reboot. This script is run in the context of the logged-on user.
runalwaysforsleepBehavior for running the RunAlways script during a NightWatchman initiated hibernate or standby.
scheduledactionsConfigures scheduled power down actions at specific times for specified days of the week.
scripttimeoutsecsNumber of seconds NightWatchman waits before deciding a script has timed out.
shutdownactionUse scheduledactions instead.
shutdowndaysUse scheduledactions instead.
shutdownmsgEnables customization of a countdown message.
shutdownnowImplements an immediate power-off, regardless of shutdownaction.
shutdowntimeUse scheduledactions instead.
standbynowPuts the computer into standby mode. standbynow works in conjunction with countdownsecs and shutdownmsg.
systemtrayControls the behavior of the system tray applet.
useractivitymaxidleminsDuration (in minutes) for the window that governs the recent user activity test.

Script control switches

Use these to control the behavior of NightWatchman scripts.

SwitchNotes
prerunEnables a custom script to be run, prior to a NightWatchm an p ower-off, hibernate or standby event.
runalwaysBehavior for running the RunAlways script during a NightWatchman initiated log-off, power-off or reboot.
runalwaysforsleepBehavior for running the RunAlways script during a NightWatchman initiated hibernate or standby.
runonresumeBehavior for the RunOnResume script when the computer resumes from a low-power state.
scripttimeoutsecsNumber of seconds NightWatchman waits before deciding a script has timed out.

Policy switches

Use these to set the communications between the 1E Agent and the Agility Framework server to retrieve its Power Policies from the NightWatchman Console.

SwitchNotes
policyserverurlSets the location of the NightWatchman Management Center policy service.
pollintervalminsSets the polling interval, in minutes, to check for new Power Policy settings.
pollretryintervalminsSets the retry interval, in minutes, to check for new power policy settings if the initial check fails.

Power scheme switches

Use these switches to control the behavior of monitors, disks, sleep and hibernate functions.

SwitchNotes
powerschemeControls the setting of a NightWatchm an p ower scheme when the service starts and at user login.
monitoracSwitches the monitor to standby after a specified number of minutes of system idle time when the computer is running on mains power.
monitordcSwitches the monitor to standby after a specified number of minutes of system idle time when the computer is running on battery power.
diskacSwitches the hard disks to standby after a specified number of minutes of system idle time when the computer is running on mains power.
diskdcSwitches the hard disks to standby after a specified number of minutes of system idle time when the computer is running on battery power.
standbyacSwitches the computer to standby after a specified number of minutes of system idle time when the computer is running on mains power.
standbydcSwitches the computer to standby after a specified number of minutes of system idle time when the computer is running on battery power.
hibernateacSwitches the computer to hibernate after a specified number of minutes of system idle time when the computer is running on mains power.
hibernatedcSwitches the computer to hibernate after a specified number of minutes of system idle time when the computer is running on battery power.
passwordonwakeupDetermines if a password is required when the client computer resumes from standby or hibernate.

Hardware utilization monitoring switches

Use these switches to control the monitoring of hardware utilization by the 1E Agent.

SwitchNotes
hardwareutilizationEnables or disables the Hardware Utilization feature.
hardwareutilizationsampleintervalHardware utilization sample interval in seconds.
hardwareutilizationaggregationintervalAggregation interval in minutes.

Process exception switches

Use these to control process exceptions. Before a scheduled NightWatchman event takes place, it checks to see if any of the the processes in the list are running and will abort the event if found.

SwitchNotes
pelistshowDisplays the process exception list.
pelistaddAdds a process name to the process exception list. The name must match the name of the process as it appears in Task Manager.
pelistdelDeletes a process from the process exception list.
pelistfromReplaces the process exceptions list with the contents of a named file. The named file must contain a list of process names, one on each line in the file.
pelistclearClears all process exceptions.

Sleepless detection switches

Use these switches to control sleepless detection and its related exclusion list. Some processes may prevent computers from going into a sleep state. The exclusion list contains a list of processes that NightWatchman tells the computer to ignore when it attempts to enter a sleep state.

SwitchNotes
advancedsleeplessdetectionTurns advanced sleepless detection mode on or off.
busyprocessdetectionTurns busy process detection on or off.
selistshowDisplays the sleepless exclusion list.
selistaddAdds a process to the sleepless exceptions list. The process name must match the name as it appears in the NightWatchman Sleepless Client Detection/Busy and Sleepless Processes report.
selistdelDeletes a process from the sleepless exclusion list.
selistfromReplaces the sleepless exceptions list with the contents of a named file. The named file must contain a list of process names, one on each line in the file.
selistclearClears all sleepless exclusions.

Alarm clock and maintenance window switches

Use these to control alarm clocks and maintenance windows.

SwitchNotes
alarmclockSets an alarm clock schedule for specific days of the week.
acturnonmonitorDetermines if the display for a computer is turned on when an alarm clock wake up occurs.
maintenancewndMaintenance schedule for specific days of the week.
mwturnonmonitorDetermines if the display for a computer is turned on when a Maintenance Window wake up occurs.

Policy and reporting switches

Use these switches for policy and reporting retrievals.

SwitchNotes
policycertissuerWhen using HTTPS for communications and client certificate authentication, set this to the certificate issuer text.
policycertsubjectWhen using HTTPS for communications and client certificate authentication, set this to the certificate subject text.
reportingcertissuerWhen using HTTPS for communications and client certificate authentication, set this to the certificate issuer text.
reportingcertsubjectWhen using HTTPS for communications and client certificate authentication, set this to the certificate subject text.
policyserverurlSets the URL of the NightWatchman Management Center policy service.
reportingSets the status of NightWatchman reporting.
reportingserverurlSets the URL for the NightWatchman Management Center Web Service reporting.
securepolicyserverurlSets the URL for the secure NightWatchman Management Center policy service.
securereportingserverurlSets the URL for the secure NightWatchman Management Center Web Service reporting.

Log file switches

Use these to set options for the log file.

SwitchNotes
debugLevel of debug information output to the NightWatchman log file.
logfilenameLocation and name for the NightWatchman log file.
maxlogfilesizeMaximum size (in bytes) for the NightWatchman log file.

Command-line switches

PropertyDefault valueNotes

acturnonmonitor

 

Determines if the display for a computer is turned on when an alarm clock wake-up occurs. To turn monitors on when an alarm clock occurs:

nightwatchman 
-acturnonmonitor=on

advancedsleeplessdetection

ON
Turns advanced sleepless detection mode on or off. See Sleepless detection for basic and advanced modes. Values are:
  • ON
  • OFF

To turn advanced sleepless detection off:

nightwatchman 
-advancedsleeplessdetection=off

alarmclock

 

Sets an alarm clock schedule for specific days of the week. On Windows, the format of the value is a list of entries separated by a vertical bar (|) where each entry is a day of operation and a time to wake up in the format: day(Hrs:Mins).

The first entry in the list specifies whether to turn the monitor on during the alarm clock and uses the format: monitorstate=<state>, where state is on or off. The client computer is woken up 5 minutes before the specified time to ensure its availability at that time.

For example, the following sets an alarm clock for 07:00 Monday and 08:00 Tuesday (the client computer will be awoken at 06:55 and 07:55 respectively):

nightwatchman 
-alarmclock="monitorstate=off|
mon(07:00)|tue(08:00)"


On the Mac, the format of the value is a list of entries separated by commas where each entry is a day of operation and a time to wake up, in the following format: day=Hrs:Mins. The client computer is woken up 5 minutes before the specified time to ensure its availability at that time.

For example, the following sets an alarm clock for 07:00 Monday and 08:00 Tuesday (the client computer will be awoken at 06:55 and 07:55 respectively):

nightwatchman 
-alarmclock mon=07:00, tue=08:00

autorestart

 autorestart is deprecated as NightWatchman no longer supports non-APM/ACPI machines.

busyprocessdetection

ON

Disables busy process detection.

busyprocessdetection is not applicable to Windows 7, Windows 8.1 or Windows 10.
  • ON – busy processes that keep the computer awake are reported centrally but will still prevent the computer from going to sleep. The contents of the report contain the names for the busy processes. If these are included in the sleepless exclusion list, they will not be allowed to stop the computer from going to sleep after a period of inactivity.
  • OFF – ensures that busy processes on Windows Vista will not prevent a computer from sleeping, thereby reproducing the standard Windows 7, Windows 8.1 or Windows 10 behavior

To turn busy process detection on:

nightwatchman 
-busyprocesssdetection=on

countdowndlgtext

 

Customize a countdown message.

The maximum length is 79 characters; if this is exceeded the default message is used.


This message varies according to the shutdownaction currently set. Setting a value for coutdowndlgtext replaces all messages with a single custom message.

countdownsecs

30 seconds
Duration (in seconds) the countdown timer dialog is displayed before a power-off or log-off action is executed.
  • Must be between 0 and 3600 inclusive

The countdown timer dialog will only appear if countdownsecs is not 0. To set a 5-minute countdown:

nightwatchman 
-countdownsecs=300

debug

13Sets the level of debug information output to the NightWatchman log file. You should only change this value after checking with the 1E support.

delaysecs

30 seconds
Sets the number of seconds before the countdown timer dialog is displayed before a power-off or log-off action is executed.
  • Must be between 30 and 300 inclusive

To set a 1 minute delay before the countdown starts:

nightwatchman 
-delaysecs=60

diskac

60 minutesSwitches the hard disks to standby after a number of minutes of system idle time when the computer is running on mains power.
  • Must be between 0 and 1440 inclusive
  • 0 turns power management off

diskdc

5 minutesSwitches the hard disks to standby after a number of minutes of system idle time when the computer is running on battery power.
  • Must be between 0 and 1440 inclusive
  • 0 turns power management off

hardwareutilization

OFFEnables or disables hardware utilization monitoring. When enabled the 1E Agent will retrieve information from PCs to determine which ones are in use throughout the day. Values are:
  • ON - Turns hardware utilization monitoring on
  • OFF - Turns hardware utilization monitoring off

hardwareutilizationsampleinterval

600Hardware utilization sample interval (in seconds).
  • Must be between 5 and 900 seconds

hardwareutilizationaggregationinterval

60The aggregation interval (in minutes).
  • Range is 5 to 1440 minutes.

help

 Displays the command-line syntax help.

hibernateac

0Switches the computer to hibernate after a number of minutes of system idle time when the computer is running on mains power.
  • Must be between 0 and 1440 inclusive
  • 0 turns power management off

hibernatedc

0Switches the computer to hibernate after a number of minutes of system idle time when the computer is running on battery power.
  • Must be between 0 and 1440 inclusive.
  • 0 turns power management off.

hibernatenow

 

Puts the computer into hibernate mode. Works in conjunction with countdownsecs and shutdownmsg.

Any other switches on the same command-line aborts the hibernate operation and reports an error.

httpserver

 

Server name hosting the NightWatchman Management Center standard security websites used for policy retrieval and reporting. This can be set to the server name or IP address and may also refer to the port number if this has been changed from the default on the server side. For example, to set the server name to nwmcserver:

./nightwatchman 
-s HTTPServer nwmcserver


To use an IP address of 192.168.23.23:

./nightwatchman 
-s HTTPServer 192.168.23.23


To use nwmcserver as the server using port 180:

./nightwatchman 
-s HTTPServer nwmcserver:180

httpsserver

 

Server name hosting the NightWatchman Management Center secure websites used for policy retrieval and reporting. This can be set to the server name and may also refer to the port number if this has been changed from the default on the server side.

You cannot use the IP address for the secure server definition.

To set the server name to nwmcserver:

./nightwatchman 
-s HTTPSServer nwmcserver

To set the server name to nwmcserver using port 180:

./nightwatchman 
-s HTTPSServer nwmcserver:180

ignoreerrors

OFFBehavior on detecting errors in the power-off scripts during a scheduled event.
  • ON – during power-off, errors are ignored and the power-off will continue. User are given the option to cancel the event.
  • OFF – script errors will prevent power-off from taking place

ignorescripterrors

OFFBehavior on detecting errors in the power-off scripts during a scheduled event.
  • ON – during power-off, errors are ignored and the power-off will continue. Users are given the option to cancel the event.
  • OFF – script errors will prevent power-off from taking place

logfilename

C:\ProgramData\
1E\Agent\nightwatchman.log

Location and name for the NightWatchman log file. For example, to set the log file called NW.LOG in C:TEMP:

nightwatchman 
-logfilename=C:\TEMP\NW.LOG

logoffaction

Active

Determines the behavior when a user is logged onto the system. In ACTIVE and FORCE mode, scripts are executed to close down applications gracefully.

This switch is now provided for legacy support only. Use scheduledactions instead.
  • ACTIVE –users are given the opportunity to postpone a log-off. If they are not present and the countdown timer dialog expires, log-off will occur. Log-off will be stopped if any scripts generate an error.

  • FORCE – countdown timer dialog has no option to cancel. All NightWatchman tests run prior to the scheduled event is bypassed. The event ignores errors generated by the power-off scripts. Unsaved data may be lost.
  • PASSIVE –log-off is not actioned if a user is logged on.

macspoolerdirectory

/Library/ApplicationSupport/
1E/NightWatchman/Messages
Location for the Mac spooler directory, where reporting messages are stored before being sent to the NightWatchman Management Center Web Service. macspoolerdirectory, set by the installer, modifies the settings for communicating with the NightWatchman Management Center Reporting and should not need to be modified under normal circumstances.

maintenancewnd

 

Maintenance schedule for specific days of the week. The format of the value is a list of entries separated by a vertical bar |. The first entry in the list determines if the on/off state of the monitor during the maintenance window and uses the format:

monitorstate=<state>


where <state> is on or off. The remaining entries determine the day of operation, a time to wake up, a duration and an action to perform at the end, in the following format:

day(Hrs:Mins,Duration,EndAction)


The Hrs:Mins time parameter must always be in the format hh:mm. So to represent 3am the string is 03:00. The client computer is woken up to 5 minutes before the specified time to ensure its availability. EndAction may take one of values:

  • 0 – do nothing
  • 1 – puts the client computer into standby mode
  • 2 – puts the client computer into hibernate mode
  • 3 – powers-off the client computer


For example, to set a 23-minute maintenance window on Mondays leaving the computer on, and a 1-hour maintenance window on Tuesdays leaving the computer on standby:

nightwatchman 
-maintenancewnd="monitorstate=off|
mon(03:00,23,0)|tue(02:00,60,1)"

maxbatchsendintervalsecs

  • 14400 – purchased license
  • 300 – evaluation license
Interval (in seconds) to wait before batch dispatching messages in the spooler to the NightWatchman Management Center Web Service. This switch takes precedence over minmessagesperbatch. maxbatchsendintervalsecs, set by the installer, modifies the settings for communicating with the NightWatchman Management Center Reporting and should not need to be modified under normal circumstances.

maximumfileagesecs

604800 (7 days)Duration (in seconds) the 1E Agent will store reporting information locally when the NightWatchman Management Center Web service cannot be contacted. Data held beyond the default value is deleted.maximumfileagesecs, set by the installer, need not be modified under normal circumstances.

maxlogfilesize

1048578 bytes
Maximum size (in bytes) for the NightWatchman log file. If the log file exceeds this value NightWatchman saves the curent log file to a file in the same location but with the extension .LO_, overwriting any existing copy. NightWatchman will continue to write to the file specified in logfilename.
  • The minimum value is 1024, as this is the minimum size for any file.

For example, to set a 32K limit for the log file:

nightwatchman 
-maxlogfilesize=32768

minmessagesperbatch

  • 25 – purchased license
  • 5 – evaluation license
Minimum number of messages in the spooler before a batch is dispatched to the NightWatchman Management Center Web Service. It is subservient to maxbatchsendintervalsecs in terms of setting how long between sending messages to the NightWatchman Management Center Web Service. minmessagesperbatch, set by the installer, modifies the settings for communicating with NightWatchman Management Center Reporting and should not need to be modified under normal circumstances.

monitorac


15 minutesSwitches the monitor to standby after a specified number of minutes of system idle time when the computer is running on mains power.
  • Must be between 0 and 1440 inclusive
  • 0 diables power management

monitordc

3 minutesSwitches the monitor to standby after a specified number of minutes of system idle time when the computer is running on battery power.
  • Must be between 0 and 1440 inclusive
  • 0 disables power management

monitorjobs

ONEnables or disables the Configuration Manager job monitoring. monitorjobs also controls the integration with WakeUp. If monitorjobs=ON, NightWatchman performs auto power-off for machines awoken by a scheduled WakeUp signal. Values are:
  • ON – turns Configuration Manager job monitoring on
  • OFF – turns Configuration Manager job monitoring off

mwturnonmonitor

 

Determines if the display for a computer is turned on when a maintenance window wake up occurs. For example, to turn a monitor on when a maintenance window wake up occurs:

nightwatchman 
-mwturnonmonitor=on

onceoff

 

Replaces shutdownonce. Determines whether the other switches on the NightWatchman command-line is applied in a once-off operation. Any other switches used in conjunction with the onceoff command will not affect other global scheduled settings. It can be used in conjunction with countdownsecs, logoffaction, shutdownaction, shutdownmsg and shutdowntime.

onceoff cannot be scheduled to start within 5 minutes of a maintenance window.

onceoff only retries on the day of the power-off. If the day expires before retryattempts, no more retries are attempted. If you do not want users to cancel the event, use -logoffaction=force.

For example, to force a power-off at 7:30 pm:

nightwatchman 
-onceoff 
-shutdowntime=19:30 
-logoffaction=force 
-shutdownaction=normal

passwordonwakeup

ON
Determines if a password is required when the client computer resumes from standby or hibernate.Values are:
  • ON –  password required on resume from standby or hibernate
  • OFF – no password required

For example, to set the client computer not to request a password on resumption:

nightwatchman 
-passwordonwakeup=off

pelistadd

 

Adds a process name to the process exception list.The name must match the name of the process as it appears in Task Manager. For example, to set Nightwatchman to abort power-offs when the Notepad application is running:

nightwatchman 
-pelistadd=notepad.exe

pelistclear

 Clears all process exceptions.

pelistdel

 

Deletes a process from the process exception list. For example, to remove the Notepad application process from the process exception list:

nightwatchman 
-pelistdel=notepad.exe

pelistfrom

 

Replaces the process exceptions list with the contents of a named file. The named file must contain a list of process names, one on each line in the file.

Clears any existing items in the process exceptions list before adding the new items from the file.

For example, to list the contents of a process exception list from a file named myprocesses.txt:

nightwatchman 
-pelistfrom=myprocesses.txt

pelistshow

 Displays the process exception list.

pendingjobwindowmins

5
Defines the power down behavior according pending Configuration Manager jobs. It takes an integer that defines the number of minutes in the look-ahead window. monitorjobs =ON must be set (as it is by default) in order for this value to be used.

The way that the power-off behavior is modified is dependent on the shutdown type:
  • Shutdown now – if either of the following is true, NightWatchmanwill abort its power down attempt.
    • Pending jobs exist scheduled to start within the specified look-ahead window starting from the current time.
    • There are current running jobs.
  • Scheduled shutdown – if either of the following is true, NightWatchmanwill abort its scheduled power down attempt, and will retry in the configured retry interval.
    • Pending jobs exist scheduled to start within the specified look-ahead window starting from the current time.
    • There are current running jobs.

When PENDINGJOBWINDOWMINS=0 but the MONITORJOBS=ON, the look-ahead functionality is turned off but the check for running Configuration Manager jobs will still happen. To turn off Configuration Manager job monitoring altogether set MONITORJOBS=OFF.

This behavior is dependent on checking the list of pending Configuration Manager jobs. If the client is not installed on the local computer, power down will proceed as normal regardless of the setting of the switch

policycertissuer

 

If using HTTPS for communications and client certificate authentication, set this to the certificate issuer text.

This must be set to the same value as reportingcertissuer.

policycertsubject

 

If using HTTPS for communications and client certificate authentication, set this to the certificate subject text.

This must be set to the same value as reportingcertsubject.

policyserverurl

 

URL of the NightWatchman Management Center policy service in the format:

http://<server>/AFWebService/PolicyService.asmx

where <server> is the location of your server.

This value is set during installation and will not require modification during normal use. For example, to set your NightWatchman Management Center Web Service server to AFServer:

nightwatchman -policyserverurl=http://AFServer/AFWebService/PolicyService.asmx

pollintervalmins

  • 1500 – purchased license
  • 15 – evaluation license
Polling interval (in minutes) to check for new power policy settings. This poll checks to see which power policy is used for the client computer and retrieves its settings. Power policies and their associated computers are defined using the NightWatchman Console.
  • Must be between 1 and 43200 inclusive.
Power policies held in the NightWatchman Management Center will set this value if applied to the 1E Agent. Default values in the NightWatchman Management Center are dependent on the environment size (selected in the NightWatchman Management Center installer). These are:
  • 1 – very small
  • 90 – small
  • 1500 – medium
  • 3000 – large

pollintervalsecs

600Interval (in seconds) for the delay in resending rejected messages to the NightWatchman Management Center Web Service Component. pollintervalsecs, set by the installer, modifies the settings for communicating with NightWatchman Management Center Reporting and should not need to be modified under normal circumstances.

pollretryintervalmins

  • 30 – purchased license
  • 5 – evaluation license
Retry interval (in minutes) to check for new power policy settings if the initial check fails.
  • Must be between 1 and 1440 inclusive.

powerscheme

OFF

Controls the setting of a NightWatchman power scheme when the service starts and at user login.

The logged in user requires permissions to be able to change their local power scheme.
  • ON –  power scheme is applied when the service starts and when a user logs in
  • OFF – power scheme will not be applied

prerun

 
Enables a custom script to be run, prior to a NightWatchman power-off, hibernate or standby event. This script is set to run before all other actions. At the start of any scheduled event and depending on the status of the -prerun option, NightWatchman runs this script to have control over whether the scheduled event continues.
  • If it fails (exits with a non-zero error code), the scheduled event is automatically postponed and will retry after the standard period defined in retryinterval.
  • If it succeeds and shutdownaction is Standby or Hibernate, the machine is put into one of these states.
  • If it succeeds and shutdownaction is Normal, Reboot or Logoff, the process exception list is checked. If any of the processes in the exception list are currently running, the scheduled event is aborted.

During a NightWatchman installation, a default PreRun script is created that explicitly performs no action and only returns a success code. The script is commented to enable the functionality to be customized easily.
  • ON – enables the pre-run script
  • OFF – disables the pre-run script

rebootnow

 

Reboots the computer. rebootnow works in conjunction with countdownsecs and shutdownmsg.

Any other switches on the same command-line will abort the reboot operation and report an error.

relicense

 

Licenses NightWatchman with the valid license key. If no license key was entered during the initial NightWatchman installation, a 30-day evaluation license would have been put in place. If the license key has already expired the service will have stopped. You will need to restart the service manually after relicensing with:

nwmsvc.exe -start

For example, to relicense NightWatchman for Windows with a new licence key (ABCDE-1234-3456-5678-5678):

nwmsvc.exe 
-relicense=ABCDE-1234-3456-5678-5678

To relicense NightWatchman for Macs with a new licence key (ABCDE-1234-3456-5678-5678):

./nightwatchman 
-s relicense ABCDE-1234-3456-5678-5678

reporting

 Status of NightWatchman reporting. If reporting=ON, NightWatchman sends regular messages to the NightWatchman Management Center Web Service defined by reportingserverurl. Switch category: Policy and reporting
  • ON – enables reporting
  • OFF – disables reporting

reportingcertissuer

 

If using HTTPS for communications and client certificate authentication, set this to the certificate issuer text.

This must be set to the same value as policycertissuer.

reportingcertsubject

 

If using HTTPS for communications and client certificate authentication, set this to the certificate subject text.

This must be set to the same value as policycertsubject .

reportingserver

 
This switch is replaced by reportingserverurl .

reportingserverurl

 

Replaces reportingserver. Sets the URL for the NightWatchman Management Center Web Service reporting in the format:

http://<server>/AFWebService/PostMessage.aspx


where <server> is the location of the NightWatchman Management Center Web Service Component. This value is set during installation and will not require modification during normal use.

For example, to set your NightWatchman Web Service server to RServ:

nightwatchman -reportingserverurl= http://RServ/AFWebService/PostMessage.aspx

retryattempts

3
Number of times a power-off is attempted if cancelled by the user
  • Must be between 0 and 10 inclusive

For example, to set NightWatchman to try and shutdown 10 time after the user cancels the event:

nightwatchman -retryattempts=10

retryinterval

60
Interval (in minutes) the service retries the power-off if cancelled by the user or if the power-off cannot be performed.
  • Must be between 1 and 60 inclusive.

For example, to set NightWatchman to retry every 15 minutes:

nightwatchman -retryinterval=15

runalways

OFF

Bbehavior for running the RunAlways script during a NightWatchman initiated log-off, power-off or reboot. This script is run in the context of the logged-on user.

On Windows, the script is called RUNALWAYS.vbs and on the Mac, it is called RunAlways.scpt
  • ON – enables the RunAlways script during a NightWatchman initiated log-off, poweroff or reboot. If the script returns a non-zero value it cancels the event; else it continues.
  • OFF – disables the RunAlways script

runalwaysforsleep

OFF

Behavior for running the RunAlways script during a NightWatchman initiated hibernate or standby.

On Windows, the script is called RUNALWAYS.vbs and on the Mac, it is called RunAlways.scpt
  • ON – enables the RunAlways script during a NightWatchman initiated hibernate or standby
  • OFF – disables the RunAlways script during a NightWatchman initiated hibernate or standby

runonresume

OFF

Behavior for the RunOnResume script when the computer resumes from a low-power state.

On Windows the script is called RUNONRESUME.vbs, on the Mac it is called RunOnResume.scpt.
  • ON – enables the RunOnResume script, if it exists, when the computer resumes from a low-power state
  • OFF – disables the RunOnResume script if it exists

runonresumedelaysecs

20Delay (in seconds) between the resume event and when the RunOnResume script is run.
  • Must be between 20 and 300.

runscriptseverylogoff

 
This switch is no longer supported.

scheduledactions

 

Configures scheduled power down actions at specific times for specified days of the week. The syntax for Windows is

D{,D,D}(T,P,L){| D{,D,D}(T,P,L)}

and for Macs

D{,D,D}=T,P,L { D{,D,D}=T,P,L}

where

SymbolNotesValues
DDay of week

SUN,MON,TUE,WED,THU,FRI,
SAT,WEEKDAYS,WEEKEND,
ALLDAYS

where

  • WEEKDAYS = MON,TUE,WED,THU,FRI
  • WEEKEND = SAT,SUN
  • ALLDAYS = all days
TPower down timeIn the format: hh:mm (24hr clock)
PPower down action

Hibernate, Logoff, Normal, PowerOff, Reboot, Standby, PowerOffThenStandby

LLog off actionActive, Force, Passive
All the above values are case insensitive

For example, t o set a power down on Windows at 18:00 with a logoffaction=FORCE for every day of the week:

NightWatchman.exe 
–scheduledactions=”ALLDAYS(18:00,
PowerOff,Force)”


To set a power down on Mac at 18:00 with a logoffaction=FORCE for every day of the week:

sudo ./nightwatchman 
–scheduledactions

scripttimeoutsecs

30
Duration (in seconds) NightWatchman waits before deciding a script has timed out.
  • Must be between 1 and 120 inclusive.
If the value for scripttimeoutsecs is set too low, you could be at risk of data loss as the scripts may not have time to finish and NightWatchman may poweroff without some open files having been saved.

securepolicyserverurl

 

URL for the secure NightWatchman Management Center policy service in the format

https://<server>/AFWebService/PolicyService.asmx

where <server> is the location of your server.

This value is set during installation and will not require modification during normal use. If you do need to change this, you must set the full URL. For example, to set your NightWatchman Management Center Web Service server to AFServer:

nightwatchman 
-securepolicyserverurl=
 https://AFServer/AFWebService/PolicyService.asm

securereportingserverurl

 

URL for the secure NightWatchman Management Center Web Service reporting in the format:

https://<server>/AFWebService/PostMessage.aspx

where <server> is the name of your NightWatchman Management Center Web Service component. securereportingserverurl, set by the installer, modifies the settings for communicating with the NightWatchman Management Center and should not need to be modified under normal circumstances.

For example, to set your NightWatchman Web Service server to RServ:

nightwatchman 
-reportingserverurl= 
    http://RServ/AFWebService/PostMessage.aspx

selistadd

 

Adds a process to the sleepless exceptions list. The process name must match the name as it appears in the NightWatchman Sleepless Client Detection/Busy and Sleepless Processes report. Normally, the name matches the Task Manager process but for running services that are hosted by SvcHost, SvcHost.exe will be reported back.

You will only get the detail of the service name if advanced sleepless client detection is turned on.

For example, to set NightWatchman to sleep even if the LanManServer service prevents this from taking place:

nightwatchman 
-selistadd=SvcHost.exe(LanManServer)

selistclear

 Clears all sleepless exclusions.

selistdel

 

Deletes a process from the sleepless exclusion list. For example, to remove the Notepad process from the sleepless exclusion list:

nightwatchman 
-selistdel=notepad.exe

selistfrom

 

Replaces the sleepless exceptions list with the contents of a named file. The named file must contain a list of process names, one on each line in the file.

Clears any existing items in the sleepless exclusions list before adding the new items from the file.

For example, to list the contents of a sleepless exception list from a file named myprocesses.txt

nightwatchman 
-selistfrom=myprocesses.txt

selistshow

 Displays the sleepless exclusion list.

settings

 

Displays the current NightWatchman service configuration parameters on the command-line.

This switch is now identical to the -summary switch.

shutdownaction

Normal

Determines the shutdown type.

This switch is now provided for legacy support only, use scheduledactions instead.
  • Hibernate – puts the machine into hibernate mode
  • Logoff – performs the log-off action only.  No shut down performed. The machine is left at the log-on prompt. This action has no power management value but can be used to enforce security.
  • Normal – shuts down and powers off
  • Poweroff – shuts down and power offs, this is a synonym for Normal
  • Reboot – restarts the sysetm. This action has no power management value other than to enforce good housekeeping practice.
  • Standby – puts the machine into standby mode

shutdowndays

All days
shutdowndays is now provided for legacy support only on Windows, use scheduledactions instead. It is no longer supported on the Mac, use scheduledactions instead.

Sets the days of operation as a range or a set of integers.

  • 0 – Sunday
  • 1 – Monday
  • 2 – Tuesday
  • 3 – Wednesday
  • 4 – Thursday
  • 5 – Friday
  • 6 – Saturday

After a default installation NightWatchman is set to operate 7 days a week. For example, to set a range from Monday to Friday:

nightwatchman 
-shutdowndays=1-5

To set a shutdown for Monday,Tuesday and Thursday only:

nightwatchman 
-shutdowndays=1,2,4

shutdownmsg

 

Customize a countdown message.

The maximum length is 79 characters; if this is exceeded the default message is used.

This message varies according to the shutdownaction currently set. Setting a value for coutdowndlgtext replaces all messages with a single custom message. This message only appears if countdownsecs is not equal to 0. To customize a countdown message with the text 'Let's save some energy!':

nightwatchman 
-shutdownmsg="Let’s save some energy!"

shutdownnow

 

Implements an immediate power-off, regardless of shutdownaction, depending on the value of the countdownsecs, shutdownmsg and logoffaction switches. If there are any other switches on the same command-line, the power-off aborts and reports an error.

shutdownnow only applies to the current operation and will not affect global settings. It disables retryattempts and retryinterval. If useractivitymaxidlemins is set to anything other than 0, shutdownnow on its own will not work when run from a local command-line. Adding -logoffaction=force allows the power-off to work, as will initiating power-off from the NightWatchman system tray menu.

To force a power-off:

nightwatchman 
-shutdownnow 
-logoffaction=force
If logoffaction=passive, no action takes place. If a computer is already in standby or hibernate mode, it will not be woken to shut it down.

shutdownonce

 
shutdownonce is no longer supported. See onceoff for approximately equivalent behavior.

shutdowntime

 
shutdowntime is now provided for legacy support only on Windows, you should use scheduledactions instead. It is no longer supported on the Mac, use scheduledactions instead.

Sets the time for the scheduled event. shutdowntime utilizes the scheduler and it takes the current shutdowndays settings into account and only initializes a scheduled event on days that are set.

  • HH:mm – time in 24 hour format.
  • NOW – no longer supported. Use shutdownnow instead for equivalent behavior
  • OFF – no longer supported. Use scheduledactions=OFF for approximate equivalent behavior.

spoolerdirectory

C:\ProgramData\
1E\Reporting\NightWatchman\
Location of the spooler directory where NightWatchman Management Center Reporting messages are stored before being sent to the NightWatchman Management Center Web Service. spoolerdirectory, set by the installer, modifies the settings for communicating with the NightWatchman Management Center Reporting and should not need to be modified under normal circumstances.

standbyac

60Switches the computer to standby after a number of minutes of system idle time when the computer is running on mains power.
  • Must be between 0 and 1440 inclusive
  • 0 disables power management

standbydc

5Switches the computer to standby after a number of minutes of system idle time when the computer is running on battery power.
  • Must be between 0 and 1440 inclusive
  • 0 disables power management

standbynow

 

Puts the computer into standby mode. standbynow works in conjunction with countdownsecs and shutdownmsg. If there are any other switches on the same command-line, the power-off aborts and reports an error.

standbynow only applies to the current operation and will not affect global settings.

start

 
Starts the NightWatchman service. Values are:
  • <no value> – starts the service once.
  • auto – sets the service to auto start.

For example, to start the service:

nwmsvc –start

To set the service to auto start:

nwmsvc –start=auto

stop

 

Stops the NightWatchman service, for example:

nwmsvc -stop

summary

 

 

Displays the current NightWatchman service configuration parameters on the command-line.

summary is identical to settings .

systemtray

 

Behavior of the system tray applet.

SYSTEMTRAY=OFFis only supported for use in situations where backup documents do not exist. When this option is used and backup documents exist, the system tray icon will appear anyway but the related menu items will be disabled.

SYSTEMTRAY=OFF could be used, for example, if NightWatchman were to be configured for a period of reporting only, then the system tray icon could be hidden so as not to distract users.

  • ON – displays system tray applet
  • ON1 – displays the system tray applet with the Keep Active option disabled
  • OFF – hides the system tray applet, unless backup documents exist

useractivitymaxidlemins

0
Duration (in minutes) for the window that governs the recent user activity test. If users have been active during a determined period prior to a NightWatchman scheduled event, the event is postponed.
  • Must be between 0 and 1440 inclusive
  • 0 disables this feature
We recommended setting this to a value less than retryintervalmins .

The postponement time is governed by the NightWatchman retryinterval switch setting. useractivitymaxidlemins does not affect shutdowns started from the system tray or those where the NightWatchman logoffaction=Force.

To set the user activity window to 20 minutes:

nightwatchman 
-useractivitymaxidlemins=20

version

 Displays the NightWatchman product version number. You will need the version number when contacting 1E support.

waitminutesforunavailableserver

1440Duration (in minutes) to wait before the spooler retrys connecting to the NightWatchman Management Center Web Service. waitminutesforunavailableserver , set by the installer, modifies the settings for communicating with NightWatchman Management Center Reporting and should not need to be modified under normal circumstances.