Gives the volume restriction information for a specified object.
Gives the name of the object for which the space restriction is defined.
object.Name
String.
Read-only.
See sample in Example
Gives the number of blocks the object can use.
object.Restriction
Integer.
Read-only.
If this property is non-zero, the object has a space restriction. Otherwise, the object has no space restriction.
See sample in Example
Gives the number of blocks the object is currently using.
object.Usage
Long.
Read-only.
See sample in Example
Provides information about the amount of space an object is allowed to use on a volume.
object.VolumeLimit
String/Integer.
Read-only.
The value returned by this property is the number of blocks the object can use on the mounted volume. The size of each block is 4 KB. If there is no space restriction, this property will return the string "Unlimited."
This sample provides all information about the amount of space TestUser is allowed to use on volume Sys.
On Error Resume Next
Set volmgr = CreateObject ("UCX:VolumeMgr")
Set volumes = volmgr.volumes
Set volume = Volumes.Element("Sys")
If (Err.Number=0) then
Set RestrictionsObj=volume.GetSpaceRestriction()
If (Err.Number=0) then
Set restr = RestrictionsObj.Element("Testuser")
If(Err.Number=0) then
Print "The number of restriction blocks for
"&restr.Name & " is "&restr.Restriction
Print"The number of blocks currently in use for
"&restr.Name &" is "&restr.Usage
Print "The amount of space allowed for " &restr.Name
&" is "&restr.VolumeLimit
Else
Print "Failed to find restriction for the specified
user "&Err.Description
Endif
Else
Print "Failed to get restrictions object
"&Err.Description
Endif
Else
Print "Failed to find the volume "&Err.Description
Endif
Removes the volume space restriction for a specified user on the mounted volume.
object.RemoveSpaceRestriction()
None.
Boolean. Returns TRUE if successful; otherwise, FALSE.
This example removes the volume space restriction for TestUser on volume Sys.
Set nds1 = CreateObject ("UCX:"NWDir")
’Log in to an account with supervisory rights
nds1.Login("username","password")
If (Err.Number=0) then
’Get all information about Sys
Set volmgr=CreateObject("UCX:VolumeMgr")
Set vols=volmgr.volumes
Set volume = Vols.Element("Sys")
Set restns = volume.GetSpaceRestriction()
If (Err.Number=0)then
Set restr = Restns.Element("testuser")
If (Err.Number=0) then
Restr.RemoveSpaceRestriction()
If (Err.Number=0) then
Print "Restriction removed successfully"
Else
Print "Failed to remove restriction "
&Err.Description
Endif
Else
Print "Could not remove the restriction
"&Err.description
Endif
Else
Print "GetSpaceRestriction failed - "&Err.Description
Endif
nds1.Logout()
Else
Print("Login failed")
Endif
Sets the volume space restriction for a specified user on the mounted volume.
object.SetSpaceRestriction(
Value As Long)
Long. The volume space restriction value to be set for the user.
Boolean. Returns TRUE if successful; otherwise, FALSE.
This example sets the space restriction for TestUser on volume Sys.
Set nds1 = CreateObject ("UCX:NWDir")
’Log in to an account with supervisory rights
nds1.login("username","password")
If (Err.Number=0) then
’Get all information about Sys
Set volmgr = CreateObject("UCX:VolumeMgr")
Set vols = volmgr.volumes
Set volume = Vols.Element("Sys")
Set restns = volume.GetSpaceRestriction()
If (Err.Number=0) Then
Set restr = Restns.Element("Testuser")
If (Err.Number=0) Then
Restr.SetSpaceRestriction(1024)
If (Err.Number=0) then
Print "Restriction set successfully"
Else
Print "Failed to set restriction "&Err.Description
Endif
Else
Print "Could not set the restriction object "
&Err.description
Endif
Else
Print "GetSpaceRestriction failed - "&Err.Description
Endif
nds1.Logout()
Else
Print "Login failed"
Endif