WKStaInfo

(Engine-Level Function)

Description: Returns the characteristic information about this workstation.
Returns: Text
Usage: Script only.
Function Groups: Network,  Hardware and Software
Related to: VStatus | Platform | BuffToHex |
Format: WKStaInfo(Option)
Parameters:  
Option   
Required. Selects the characteristic to return, as shown in the following table

Option

Return characteristic

0

Workstation name

1

User name

2

Domain name

3

Unique Machine Identifier

4Returns TRUE if the local machine is configured to resolve names using DNS.
5Returns the domain name of the computer.
6Returns the activation code if that code can be validated to match the machine ID.
7Returns the installation timestamp.
8Returns the fully qualified distinguished name. example:
"CN=Jeff Smith, OU=Users, DC= Engineering, DC=Com"
Comments:

If looking for the workstation name, it is more efficient to use the \RPCManager variable WkStnName rather than call this function. (\RPCManager.WkStnName)
Variables available in \RPCManager

This function will only return a valid value if the machine has a workstation name assigned to it (i.e. if network services have been installed). If network services have not been installed it will return invalid.
Option 3, the unique machine identifier, returns a 6-byte binary buffer. Use the function System.BuffToHex on the returned value if you would like to use the MachineID as a Hex string.

VTScada relies on a Windows function call to obtain the NetBios name of workstations. That function will truncate names that are longer than 15 characters. You are advised to limit workstation names to be 15 characters or less.