Skip to content

MachineInfo

Machine identity and server role.

Returned by machine_info. Identity comes from the workstation service and the role fields from the server service. When the server service is not running, server_started is false, comment is nil and every role field is false; the identity fields are still populated.

Example

let machine = winnet.machine_info()
echo "$(machine.name) is running $(machine.version_major).$(machine.version_minor)"
if machine.domain_controller
  echo "skipping: cannot unjoin a domain controller"

Fields

backup_domain_controller @ Bool

Whether the machine advertises as a backup domain controller.

comment @ (Str | nil)

Server comment.

domain @ Str

Domain or workgroup the machine belongs to. Use join_status to tell which of the two it is.

domain_controller @ Bool

Whether the machine advertises as a domain controller.

name @ Str

NetBIOS computer name.

server @ Bool

Whether the machine advertises the server role.

server_started @ Bool

Whether the server service supplied server_type and comment.

server_type @ ServerType

Advertised server role mask.

version_major @ Int

Major OS version.

version_minor @ Int

Minor OS version.

workstation @ Bool

Whether the machine advertises the workstation role.