SpaceObServer.Application.SetRootProperty

<< Click to Display Table of Contents >>

Navigation:  OLE Automation > Application > Methods >

SpaceObServer.Application.SetRootProperty

Description

Sets a certain property for one root in the currently connected database.

 
Syntax

SetRootProperty(RootID : <Integer>, PropertyName : <String>, PropertyValue : <OLEVariant>);

 
Parameters

RootID

The index of the root (starting with 0 to RootCount-1)

PropertyName

The name of the property you want to set. This parameter can be one of the following strings:

"ChangeJournal": De- / Activates the NTFS Change Journals for the given root..
"ScanLocation": Updates the path of a given root in the connected database.
"ScanUser": Sets the user in the 'Use different credentials for scan' field. This user is used by the SpaceObServer scan service to execute the scan.
"ScanPassword": Sets the password for the user used in the  'Use different credentials for scan' field. The password is used by the SpaceObServer scan service to execute the scan.
"UserAccess": Sets the users and/or groups which are allowed to see and access the scans. User and group names have to be separated by semicolon.

PropertyValue

The new value to be set for this root property.

Remarks: In case of  "ChangeJournal"  pass "true" to activate the  NTFS Change Journals. Pass "false" otherwise

 
Example

This is an example that shows how to add a new root and set the credentials for the root, using SetRootProperty:

PowerShell:

$SOS.AddRootToDatabase("\\Server1\Share1", $False, $False, $True, "100", $False, "~snapshot")

$RootID = $SOS.GetRootID("\\Server1\Share1")

$SOS.SetRootProperty($RootID, "ScanUser", "MyDomain\Smith")
$SOS.SetRootProperty($RootID, "ScanPassword", "myStrongPwd!1")

VBS:

SOS.AddRootToDatabase "\\Server1\Share1", False, False, True, 100, False, "~snapshot"

RootID = SOS.GetRootID("\\Server1\Share1")

SOS.SetRootProperty RootID, "ScanUser", "MyDomain\Smith"
SOS.SetRootProperty RootID, "ScanPassword", "myStrongPwd!1"

Adds the new root directory "\\Server1\Share1" to the SQL server database and sets the credentials for scanning to, user: MyDomain\Smith, password: myStrongPwd!1