System Control (Windows)

Automation Manager System Automated Tasks (AM)

Automated Tasks designated as AM are created using the Automation Manager.

Backup All Event Logs (AM)

Script Type: PowerShell

Backs up all Windows Events Logs to the specified path.

Parameters
Field Note Example Parameters
Backup Path

The full path where the backups are written

C:\xyz\

Check Disk (AM)

Script Type: PowerShell

Checks the file system and file system metadata of a volume for logical and physical errors using CHKDSK.

Important: Interrupting CHKDSK is not recommended.

Switches Notes
/F

Fixes errors on the disk

/V

On FAT/FAT32, this displays the full path and name of every file on the disk. On NTFS, this displays cleanup messages, if any.

/R

Locates bad sectors and recovers readable information (implies /F).

/X

Forces the volume to dismount first if necessary (implies /F).

/I

Performs a minimum check of index entries.

/C

Skips checking of cycles within the folder structure.

/Lsize

Changes the log file size.

To run Check Disk in read-only mode (with no switches), replace the Command Switch input parameter with a space (highlight default parameter and press spacebar).

Parameters
Field

Note

Example Parameters

Command Switch

Enter CHKDSK switch, /i performs a minimum check of index entries

/i

Drive to Check

The letter of the mapped drive.

C:\

Cleanse Hard Disk (AM)

Script Type: PowerShell

The script cleans the hard disk when the available free space falls below the entered threshold by performing the following tasks.

  • Empty the Recycle Bins.
  • Delete all temporary files for all users, including temporary internet files and cookies.
  • Removes the contents of c:\tmp (where it exists).
Parameters
Field Note Example Parameters
Drive to Check

The letter of the mapped drive.

C:\

Minimum Disk Space

Enter the minimum disk space below which the hard disk space is cleaned

1000

Create Mapped Drive (AM)

Script Type: PowerShell

Create a mapped drive, the mapped drive created by this Task does not persist; i.e. the specified drive is not retained when the device restarts.

Notes:

  •    The network drive to be used as the mapped Share must be accessible. The net use command can be used on the local computer to verify if the Share is accessible.
  •    The credentials for accessing the network drive must be valid. Confirm the validity of the credentials by signing in to the server that hosts the network share using the credentials.
  •    The drive letter to be designated must be available (for example, verify whether Z: is already mapped to another drive).
  •    There can be no other connections to the server using the credentials configured for the Create Mapped Drive object. It is not possible to sign in to the same server with two different sets of credentials.
Parameters
Field Note Example Parameters
Drive Letter

The name for the new drive.

Z:

User Name to Map Drive

User name to map the share.

Domain\Username

Password to Map Drive

The password of the account used to map the drive.

Password!@#

Share to Map

The name of the share that is to be mapped to the new drive.

\\ServerName\shared_folder

Delete Old Folders

Script Type: VBScript

The Delete Old Folders Task parses the defined folder, and subfolders, deleting all files older than the specified number of days.

This Automated Task's Command Line field requires two parameters: the folder location and the number of days criteria.

Paramters
Folder location

Location encapsulated in quotation marks

Example: "C:\Test"

Number of days

Simple the number of days

Example: 5

Parameter Example
"C:\Test" 5

The above example deletes files in the folder (and subfolders) of: C:\Test that are older than 5 days.

IMPORTANT: The Delete Old Folders Automated Task completely removes any files meeting the number of days criteria from the device, they are not stored in the Recycle Bin, so cannot be restored. As such we would suggest using caution when applying this Task.

Disable CD-ROM (AM)

Script Type: PowerShell

Disable the device's CD-ROM  (where available). Please note that this task requires a reboot to complete the requested action.

Does not require any Parameters.

Disable USB (AM)

Script Type: PowerShell

Disables all USB ports on the selected device(s). This may disable a local keyboard, headset, etc.

Does not require any Parameters.

Disable Wireless Adapters (AM)

Script Type: PowerShell

Disables the device's wireless adapters  (where available)

Does not require any Parameters.

Empty Recycle Bin (AM)

Empties the Recycle Bin, please be aware that any content stored in the Recycle Bin and removed using this option is non-recoverable.

Does not require any Parameters.

Enable CD-ROM (AM)

Script Type: PowerShell

Enables the CD-ROM (where available). Please note that this task requires a reboot to complete the requested action.

Does not require any Parameters.

Enable USB (AM)

Script Type: PowerShell

Enables the USB interface on the target computer.

Does not require any Parameters.

Enable Wireless Adapters (AM)

Script Type: PowerShell

Enables the device's wireless adapters (where available)

Does not require any Parameters.

Get Basic System Details (AM)

Script Type: PowerShell

Collects basic device information such as Software, Services, Local Users, Local Groups and Drives.

Does not require any Parameters.

Get Full System Details (AM)

Script Type: PowerShell

Get the following information from target system(s): Available Windows Updates, Drive Details, Lists Software Inventory, Lists Startup Applications, Lists Local Users, List of Services, Network Details, List of Windows Features, Windows Product Key, Local Groups, List of Users in each Group, Firewall Status and UAC Status.

Does not require any Parameters.

Install .NET 4.5.1

Script Type: Batch

.NET 4.5.1 is required to run any Automated Tasks and Script Checks created with the Automation Manager (.amp), including those System Automated Tasks marked as RC.

To ensure these scripts will execute successfully, the Agent queries the device for the presence of a supported version of .NET when attempting to run a Script Check or Automated Task which utilizes a .amp script. If .NET is missing (or an older version installed) the Check or Task will fail with a unsupported .NET error message displayed in its More Information section on the All Devices view and the Install .NET 4.5.1 Automated Task may be used to either install or upgrade .NET on the target device at a time convenient to both you and the computer user.

Please be aware that the installation or upgrade of .NET may require a restart to complete, and where this is the case a Reboot message is displayed on the N-sight RMM UI.

Note: although this script type is Batch, it executes PowerShell commands to install .NET on the target device. As such, at least PowerShell version 2 must be installed on the device for the script to complete successfully.

Does not require any Parameters.

Map Network Printer (AM)

Script Type: PowerShell

Maps a network printer using the given printer path.

Parameters
Field Note Example Parameters
Name of printer to map

Path to the network printer

\\printserver1\HP_101

Perform Disk Maintenance (AM)

Script Type: PowerShell

Performs a flush DNS, Deletes Temp Files, Empties the Recycle Bin and a Defrag on specified drive.

Parameters
Field Note Example Parameters
Drive to Perform Maintenance on Letter of the drive to perform maintenance on C:

Reboot

Script Type: VBScript

When executed this Automated Task will reboot the system, although does not force a restart.

As such if any dialogs are displayed during the shutdown process - for example this device is shutting down, please save any work type messages - the shutdown process is aborted.

Script Parameters
Reboot Delay Number of seconds to wait from invoking the script itself and actually rebooting the system.
Reboot Comment Specify a comment that will be placed in the systems event log.

Please refer to the Permissions section, in particular Local Policies - Reboot Script, if problems are experienced running the Reboot Automated Task.

Renew DHCP (AM)

Script Type: PowerShell

Get a new IP address or update DHCP options sent by a DHCP server.

Does not require any Parameters.

Set Power Plan (AM)

Script Type: PowerShell

Sets the power plan. Enter the required Power Plan based on the language of the device's Operating System; for example:

English

Balanced

Power Saver

High Performance

French

Équilibre

Économies d’énergie

Performances élevées

German

Ausbalanciert

Energiesparplan

Höchstleistung

Italian

Bilanciamento

Risparmio di energia

Prestazioni elevate

Portuguese (Brazilian)

Equilibrado

Economia de energia

Alto desempenho

Spanish

Equilibrada

Economizadora

Alto rendimiento

 

Parameters
Field Note Example Parameters
Power Plan Specify the required power plan Balanced

Synchronize Domain Controller (AM)

Script Type: PowerShell

Synchronizes the specified domain controller.

Parameters
Field Note Example Parameters
Domain Controller The DNS name domain controller to synchronize. DC1
Naming Context The distinguished name of the naming context to replicate. <intentionally left blank>

Wake on LAN (AM)

Script Type: PowerShell

Sends a Wake-on-LAN (WoL) request from the device running the script to a remote computer on the same local area network.

Please be aware that both the network and target device must be configured to support WoL communications.

For information on how to enable WoL functionality on a Windows device, please refer to the Wake on LAN section.

Parameters
Field Note Example Parameters
MAC Address The MAC address of the network adapter on the target server or workstation 00-00-00-00-00-00 or 00:00:00:00:00:00

Windows Machine Shutdown

Script Type: VBScript

The Windows Machine Shutdown Automated Task initiates a shutdown of the local computer the Advanced Monitoring Agent is running on.

This Automated Task does not require any Command Line parameters.