SpaceObServer.Application.AddRootToDatabase

<< Zum Inhaltsverzeichnis >>

Navigation:  OLE Automation > Application > Methods >

SpaceObServer.Application.AddRootToDatabase

Description

Adds the passed directory as a new root directory to the connected database and applies extended settings for this new root.
 

Syntax

AddRootToDatabase (Path : <String>, FollowMountPoints <Boolean>, TrackAlternateDataStreamsandHardLinks <Boolean>, CalculateMD5checksums <Boolean>, PurgeInterval <Integer>, UseChangeJournal <Boolean>, ExcludeFilter <String>, ObservingServer <String>, Database : <String>, [optional]Container <String>, [optional]UserAccess <String>)
 

Parameters

Path

A new root path, which will be added to the database.

FollowMountPoints

You can decide if a scan should follow symbolic links and mount points within the selected directory branch.

TrackAlternateDataStreamsandHardLinks

Detects NTFS Alternate Data Streams as well as NTFS hard links within a scan and include this values to the calculation of the allocated folder size.

CalculateMD5checksums

this option decides if MD5 checksum of files content should be calculated and stored in the database, as indicator to identify duplicate files.

PurgeInterval

Selects how many days the file system size information of the selected directory remains in the database.

UseChangeJournal

Pass true to activate the "Change Journal analyzing" for the new root directory.

ExcludeFilter

Exclude pattern for files and folders which should not be included in scans. Multiple patterns are delimited by ":".

ObservingServer

The name of the machine/server that should execute the scans for the new root. Pass "localhost" to use the executing machine. Blank the server name ("") if you want to allow any server to execute scans for this directory.Multiple machines are delimited by ";".

Database

The name of the database to store the file system information of the added root in.

[optional]Container

(Optional Parameter) The name of the container to add the root path. By default no Container is used (Default value is '').

[optional]UserAccess

(Optional Parameter) A semicolon separated list of users and/or groups which are allowed to see and access the root in the SpaceObServer user interface (Default value is '').

 
Example

This is an example that shows how to add multiple scans using PowerShell:

$SOS.AddRootToDatabase("C:\", $False, $False, $True, "100", $False, "~snapshot", "", "SOS_REMOTE_C", "SOS_Admin;SOS_Backup;")
$SOS.AddRootToDatabase("D:\", $False, $False, $True, "100", $False, "~snapshot", "", "SOS_REMOTE_D")
$SOS.AddRootToDatabase("E:\", $False, $False, $True, "100", $False, "~snapshot", "", "SOS_REMOTE_E")

This is the same example using VBScript:

SOS.AddRootToDatabase "C:\", False, False, True, 100, False, "~snapshot", "", "SOS_REMOTE_C", "SOS_Admin;SOS_Backup;"
SOS.AddRootToDatabase "D:\", False, False, True, 100, False, "~snapshot", "", "SOS_REMOTE_D"
SOS.AddRootToDatabase "E:\", False, False, True, 100, False, "~snapshot", "", "SOS_REMOTE_E"

Adds the new root directories "C:\", "D:\" and "E:\" to the SQL server database and sets the following extended properties:
1. "Calculate MD5 Checksums" will be activated.
2. The Purge old data Intervall is set to 100 days.
3. The data will be stored in different databases on the SQL server: "C:\" in "SOS_REMOTE_C", "D:\" in "SOS_REMOTE_D" and "E:\" in "SOS_REMOTE_E".
4. Root directory "C:\" will only be visible for the users "SOS_Admin" and "SOS_Backup". "D:\" and "E:\" are visible for all users.

Remarks

Some additional settings for new roots can be set later using SetRootProperty.