9.2 Server Object

Features:

9.2.1 Clients property

Returns a collection of client connections.

Syntax

object.Clients

Type

Connections.

Attributes

Read-only.

Example

See Sample in *****.

9.2.2 Date property

Returns or sets the date of the default file server.

Syntax

object.Date[=DateValue As Date]

Type

Date.

Attributes

Read/write.

Remarks

DateValue is an optional parameter that represents the date you want to set the default file server to.

Example

See sample in Example.

9.2.3 Description property

Sets or returns the ServerInfo object that contains information about the company that distributed NetWare.

Syntax

object.Description

Type

ServerInfo.

Attributes

Read-only.

Example

See sample in Example.

9.2.4 DiskStat property

Returns the statistics related to disk activity.

Syntax

object.DiskStat

Type

DiskStat.

Attributes

Read-only.

Example

See sample in Example.

9.2.5 FATStat property

Returns the statistics pertinent to the file system.

Syntax

object.FATStat

Type

FATStat.

Attributes

Read-only.

Example

See sample in Example.

9.2.6 FileStat property

Returns the file I/O-related statistics.

Syntax

object.FileStat

Type

FileStat.

Attributes

Read-only.

Example

See sample in Example.

9.2.7 LanBoards property

Returns a collection of network boards on the server.

Syntax

object.LanBoards

Type

LanBoards.

Attributes

Read-only.

Example

See sample in Example.

9.2.8 LoginStatus property

Returns or sets the login status.

Syntax

object.LoginStatus[=LoginValue As Boolean]

Type

Boolean.

Attributes

Read/write.

Remarks

LoginValue is an optional parameter that enables (TRUE) or disables (FALSE) the login status.

Example

See sample in Example.

9.2.9 Modules property

Returns a collection of NLMs loaded on the server.

Syntax

object.Modules

Type

Modules.

Attributes

Read-only.

Example

See sample in Example.

9.2.10 Name property

Returns the name of the default file server.

Syntax

object.Name

Type

String.

Attributes

Read-only.

Example

See sample in Example.

9.2.11 NetStat property

Returns the network-related statistics.

Syntax

object.NetStat

Type

NetStat.

Attributes

Read-only.

Example

See sample in Example.

9.2.12 Params property

Returns a Params object.

Syntax

object.Params

Type

Params.

Attributes

Read-only.

Remarks

If the Web-based script is not authenticated to eDirectory with appropriate rights, an error is returned.

Example

See sample in Example.

9.2.13 Requests property

Returns the number of server requests serviced by the server.

Syntax

object.Requests

Type

Integer.

Attributes

Read-only.

Example

See sample in Example.

9.2.14 Screens property

Returns a collection object representing the screens on the server console.

Syntax

object.Screens

Type

Screens.

Attributes

Read-only.

Example

See sample in Example.

9.2.15 Transaction property

Returns or sets the tracking status.

Syntax

object.Transaction[=Status As Boolean]

Type

Boolean.

Attributes

Read/write.

Remarks

Status is an optional parameter that enables (TRUE) or disables (FALSE) the tracking status.

Example

See sample in Example.

9.2.16 Utilization property

Returns the percentage utilization of the server processor time.

Syntax

object.Utilization

Type

Integer.

Attributes

Read-only.

Example

See sample in Example.

9.2.17 Attach method

Attaches to the specified server and returns the server ID.

Syntax

object.Attach( 
   ServerName As String)

Parameters

ServerName

The name of the NetWare server.

Return Values

Long. Returns the server ID.

Remarks

In case of an error, this method returns -1.

Example

See sample in Example.

See Also

9.2.18 Detach method

Detaches the connection from a NetWare server.

Syntax

object.Detach( 
   ServerID As Long)

Parameters

ServerID

The ID of the server. This value is obtained from the Attach method.

Return Values

Boolean. Returns TRUE if successful; otherwise, returns FALSE.

Example

This example detaches from server NWServer_1.

’Sets the variable to the server object
Set srv = CreateObject ("UCX:Server") 

’Returns the date of the file server
Print srv.Date

’Returns the name of the file server
Print ("The server name is: "&Srv.Name)

’Returns the name of the company that distributed the NetWare
’OS
Set info = srv.Description
Print (info.company)&" distributed the NetWare OS"

’Returns the number of bytes read from the disk
Set diskstat = srv.Diskstat
Print ("Number of bytes read: "&diskstat.bytesread)

’Returns the nuber of dirty sectors in the file allocation
’table
Set fatstat = srv.Fatstat
Print ("The number of sectors modified are:
"&fatstat.dirtysectors)

’Returns the number of bytes read from the disk
Set filestat = srv.Filestat
Print ("Number of bytes read from the disk is:
"&filestat.bytesread)
’Returns the login status
If (srv.Loginstatus) then 
     Print ("Login status is enabled") 
     ’Disables the login status of the server
     srv.Loginstatus = FALSE
Else 
     Print ("Login status is disabled") 
     ’Enables the login status of the server
     srv.Loginstatus = TRUE
End If

’Returns the collection of NLMs loaded in the server and also
the name of a specific NLM 
Set Modulesobj = srv.Modules 
Set module = Modulesobj.Element("CLIB") 
Print "NLM Name: "&Module.Name

’Returns the Network related statistics such as the bytes sent
’to the server
Set netstat = srv.Netstat 
Print ("Number of bytes sent:" &netstat.Bytessent)

’Returns the Param object and the specifc property of that
’param object
Set srvparams = srv.Params 
Set paramObj = srvparams.Get("Time Zone") 
Print("Is StartupOnly is set to: " & paramObj.StartupOnly)

’Returns the number of server requests processed bythe server
Print (srv.requests) &" requests are served by the server"

’Returns the collection object corresponding to the screens
’in the server console and also the name of the active screen
Set screensobj = srv.Screens 
Set screen = screensobj.CurrentScreen 
Print "Current screen: "&screen.name

’Returns the tracking status
If (srv.Transaction) then 
     Print ("Transaction tracking is on") 
     ’Sets the tracking status to OFF
      srv.Transaction = FALSE
Else 
     Print ("Transaction tracking is off") 
     ’Sets the tracking status to TRUE
     srv.Transaction = TRUE  
End If

’Returns the processor utilization time in percentage
Print (srv.Utilization &"% of server processor time is being
utilized")

’Attaches to the specific server and returns the connection
’state and the server connection ID 
srvId = srv.attach("Appsdoc") 
Print ("The server Id is: "&srvid)
If (srvId<>-1) Then 
     Print "Successfully attached to the server" 
Else 
     Print "Unable to attach to the server" 
End if

’Disconnects from the server
res=srv.Detach (srvId) 
If (res=TRUE) Then 
   Print "Detached from the server" 
Else 
   Print "Failed to detach from the server" 
End If

See Also

9.2.19 Down method

Shuts down the default file server.

Syntax

object.Down( 
   [force As Boolean])

Parameters

force

Optional. If TRUE, the server is forced to shut down. If FALSE (the default), normal shutdown occurs.

Return Values

Boolean. Returns TRUE if the server is forced to shut down; otherwise, FALSE.

Remarks

Normal shutdown is the default behavior. If files are open on the server, this command returns FALSE. If Force is TRUE, the server is forced to shut down and all open files are closed without warning.

If the Web-based script is not authenticated to eDirectory with appropriate rights, an error is returned.

Example

This example shuts down the default file server.

Set srv = CreateObject ("ucx:Server") 
Print "Preparing to down the file server..." 
srv.Down()

IMPORTANT:Down only brings down the file services and does not return the server to DOS prompt.

9.2.20 Login method

Allows a user to log in to the default file server.

Syntax

object.Login( 
   ClientName As String, 
   ClientType As Integer, 
   Password As String)

Parameters

ClientName

The name of the object logging in to the server.

ClientType

The type of the object logging in to the server. This parameter is used to specify whether the object is the user object, the server object, or another type.

Password

The password associated with the object.

Return Values

Boolean. Returns TRUE if the login is successful; otherwise, FALSE.

Example

See sample in Example

See Also

9.2.21 Logout method

Initiates logout from the server.

Syntax

object.Logout( 
   ServerID As Integer)

Parameters

ServerID

The server you want to log the user out of. If this parameter is not specified, the user is logged out of all servers.

Return Values

Boolean. Returns TRUE if the logout is successful else returns FALSE.

Example

This example logs the user out of all servers.

Set srv = CreateObject ("ucx:Server") 
If (srv.Login ("username", OT_USER, "password")) then 
   Print ("Logged on to the server" 
   If (srv.logout()) Then 
      Print "Successfully logged out" 
     End If 
Else 
     Print ("Verify User name and password, then try again") 
End If

See Also