class Sys::Group

Attributes

caption[RW]

Short description of the object.

description[RW]

Description of the group.

domain[RW]

Name of the Windows domain to which the group account belongs.

gid[RW]

The group ID.

install_date[RW]

Date the group was added.

local[W]

Sets whether or not the group is local (as opposed to global).

members[RW]

An array of members for that group. May contain SID's.

name[RW]

Name of the Windows group account on the #domain specified.

sid[RW]

Security identifier for this group.

status[RW]

Current status for the group, such as “ok”, “error”, etc.

Public Class Methods

new() { |self| ... } click to toggle source

Creates and returns a new Group object. This class encapsulates the information for a group account, whether it be global or local.

Yields self if a block is given.

# File lib/windows/sys/admin.rb, line 44
def initialize
  yield self if block_given?
end

Public Instance Methods

local?() click to toggle source

Returns whether or not the group is a local group.

# File lib/windows/sys/admin.rb, line 50
def local?
   @local
end
sid_type() click to toggle source

Returns the type of SID (Security Identifier) as a stringified value.

# File lib/windows/sys/admin.rb, line 56
def sid_type
   @sid_type
end
sid_type=(stype) click to toggle source

Sets the SID (Security Identifier) type to stype, which can be one of the following constant values:

  • Admin::SidTypeUser

  • Admin::SidTypeGroup

  • Admin::SidTypeDomain

  • Admin::SidTypeAlias

  • Admin::SidTypeWellKnownGroup

  • Admin::SidTypeDeletedAccount

  • Admin::SidTypeInvalid

  • Admin::SidTypeUnknown

  • Admin::SidTypeComputer

# File lib/windows/sys/admin.rb, line 73
def sid_type=(stype)
  if stype.kind_of?(String)
    @sid_type = stype.downcase
  else
    case stype
       when Admin::SidTypeUser
          @sid_type = "user"
       when Admin::SidTypeGroup
          @sid_type = "group"
       when Admin::SidTypeDomain
          @sid_type = "domain"
       when Admin::SidTypeAlias
          @sid_type = "alias"
       when Admin::SidTypeWellKnownGroup
          @sid_type = "well_known_group"
       when Admin::SidTypeDeletedAccount
          @sid_type = "deleted_account"
       when Admin::SidTypeInvalid
          @sid_type = "invalid"
       when Admin::SidTypeUnknown
          @sid_type = "unknown"
       when Admin::SidTypeComputer
          @sid_type = "computer"
       else
          @sid_type = "unknown"
    end
  end

  @sid_type
end