<< Zum Inhaltsverzeichnis >> Navigation: OLE Automation > Application > Methods > SpaceObServer.Application.GetRootProperty |
Description
Queries a certain property for one root in the currently connected database.
Syntax
GetRootProperty(RootID : <Integer>, PropertyName : <String>): <OLEVariant>;
Parameters
RootID |
The index of the root (starting with 0 to RootCount-1) |
PropertyName |
The name of the property you want to query. This parameter can be one of the following strings: "ChangeJournal": Returns a boolean value indicating if NTFS Change Journals are activated for this root. |
Example
PowerShell:
$Path = "C:\SpaceObServer_Exports\ScanStates.txt";
$SOS = New-Object -com SpaceObServer.Application;
$RootCount = $SOS.RootCount;
for(($RootIndex = 0);($RootIndex -lt $RootCount);($RootIndex++))
{
Out-File -FilePath $Path -Append -NoNewLine -InputObject "Root path: ";
Out-File -FilePath $Path -Append -NoNewLine -InputObject $SOS.RootPaths($RootIndex);
Out-File -FilePath $Path -Append -NoNewLine -InputObject "Scan State: ";
Out-File -FilePath $Path -Append -NoNewLine -InputObject $SOS.GetRootProperty($RootIndex,"ScanState");
}
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($SOS)
VBS:
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objCTF
Set objCTF = objFSO.CreateTextFile("C:\SpaceObServer_Exports\ScanStates.txt", True)
Dim SOS
Set SOS = CreateObject("SpaceObServer.Application")
RootCount = SOS.RootCount
RootIndex = 0
Do While RootIndex<RootCount
objCTF.Write "Root path: "
objCTF.Write SOS.RootPaths (RootIndex)
objCTF.Write "Scan state: "
objCTF.Write SOS.GetRootProperty(RootIndex, "ScanState")
RootIndex = RootIndex+1
Loop
Writes the current root paths with their current scan states to a text file named "C:\SpaceObServer_Exports\ScanStates.txt".