shared

package
v0.0.0-...-873e84e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: MIT Imports: 3 Imported by: 7

Documentation

Index

Constants

View Source
const (
	FULLY_DECRYPTED = iota
	FULLY_ENCRYPTED
	ENCRYPTION_IN_PROGRESS
	DECRYPTION_IN_PROGRESS
	ENCRYPTION_PAUSED
	DECRYPTION_PAUSED
)

Possible values for the value placed in the ConversionStatus field returned by the GetConversionStatus method of Win32_EncryptableVolume

View Source
const (
	DATA_ONLY      = 0x00000001
	ON_DEMAND_WIPE = 0x00000002
	SYNCHRONOUS    = 0x00010000
)

Bitflags for the value placed in the EncryptionFlags field returned by the GetConversionStatus method of Win32_EncryptableVolume

View Source
const (
	NOT_WIPED = iota
	WIPED
	WIPING_IN_PROGRESS
	WIPING_PAUSED
)

Possible values for the value placed in the WipingStatus field returned by the GetConversionStatus method of Win32_EncryptableVolume

View Source
const (
	SESS_INTERACTIVE_LOGON        = 2
	SESS_REMOTE_INTERACTIVE_LOGON = 10
	SESS_CACHED_INTERACTIVE_LOGON = 11
)

Variables

View Source
var (
	ErrAccessDenied     = errors.New("access is denied")
	ErrExists           = errors.New("the account already exists in the domain and reuse is not enabled")
	ErrInvalidParameter = errors.New("a parameter is incorrect")
	ErrNoSuchDomain     = errors.New("the specified domain does not exist")
	ErrNotSupported     = errors.New("the request is not supported")
	ErrWorkstationSvc   = errors.New("the Workstation service has not been started")

	ErrNoOfflineJoinInfo           = errors.New("the offline join completion information was not found")
	ErrBadOfflineJoinInfo          = errors.New("the offline join completion information was bad")
	ErrCantCreateJoinInfo          = errors.New("unable to create offline join information. Please ensure you have access to the specified path location and permissions to modify its contents. Running as an elevated administrator may be required")
	ErrBadDomainJoinInfo           = errors.New("the domain join info being saved was incomplete or bad")
	ErrJoinPerformedMustRestart    = errors.New("offline join operation successfully completed but a restart is needed")
	ErrNoJoinPending               = errors.New("there was no offline join operation pending")
	ErrValuesNotSet                = errors.New("unable to set one or more requested machine or domain name values on the local computer")
	ErrCantVerifyHostname          = errors.New("could not verify the current machine's hostname against the saved value in the join completion information")
	ErrCantLoadOfflineHive         = errors.New("unable to load the specified offline registry hive. Please ensure you have access to the specified path location and permissions to modify its contents. Running as an elevated administrator may be required")
	ErrConnectionInsecure          = errors.New("the minimum session security requirements for this operation were not met")
	ErrProvisioningBlobUnsupported = errors.New("computer account provisioning blob version is not supported")
)

Functions

This section is empty.

Types

type BitLockerConversionStatus

type BitLockerConversionStatus struct {
	ConversionStatus     uint32
	EncryptionPercentage uint32
	EncryptionFlags      uint32
	WipingStatus         uint32
	WipingPercentage     uint32
}

BitLockerConversionStatus represents the GetConversionStatus method of Win32_EncryptableVolume

type BitLockerDeviceInfo

type BitLockerDeviceInfo struct {
	DeviceID           string
	PersistentVolumeID string
	DriveLetter        string
	ProtectionStatus   uint32
	ConversionStatus   uint32
	RecoveryKeys       []string
}

BitLockerDeviceInfo contains the bitlocker state for a given device

type CPU

type CPU struct {
	FriendlyName    string `json:"FriendlyName"`
	NumberOfCores   uint8  `json:"cores"`
	NumberOfLogical uint8  `json:"logical"`
}

type Disk

type Disk struct {
	DriveName             string               `json:"DriveName"`
	TotalSize             uint64               `json:"TotalSize"`
	Available             uint64               `json:"FreeSpace"`
	FileSystem            string               `json:"FileSystem"`
	BitLockerEnabled      bool                 `json:"BitLockerEnabled"`
	BitLockerEncrypted    bool                 `json:"BitLockerEncrypted"`
	BitLockerRecoveryInfo *BitLockerDeviceInfo `json:"BitLockerRecoveryInfo,omitempty"`
}

type Hardware

type Hardware struct {
	HardwareUUID      string       `json:"HardwareUUID"`
	Manufacturer      string       `json:"Manufacturer"`
	Model             string       `json:"Model"`
	SystemFamily      string       `json:"SystemFamily"`
	ServiceTag        string       `json:"ServiceTag"`
	BIOSVersion       string       `json:"biosVersion"`
	BIOSManufacturer  string       `json:"biosManufacturer"`
	BIOSReleaseDate   time.Time    `json:"biosReleaseDate"`
	TPMSpecVersion    string       `json:"tpmSpecVersion,omitempty"`
	IsUsingUEFI       bool         `json:"isUsingUEFI"`
	SecureBootEnabled bool         `json:"safebootEnabled"`
	CPU               []CPU        `json:"cpus"`
	Memory            []MemoryDIMM `json:"memoryDIMMs"`
}

type LocalGroup

type LocalGroup struct {
	Name    string `json:"name"`
	Comment string `json:"comment"`
}

A LocalGroup represents a locally defined group on a Windows system.

type LocalGroupMember

type LocalGroupMember struct {
	Domain        string `json:"domain"`
	Name          string `json:"name"`
	DomainAndName string `json:"domainAndName"`
}

A LocalGroupMember contains information about a member of a group.

type LocalUser

type LocalUser struct {
	Username             string        `json:"username"`
	FullName             string        `json:"fullName"`
	IsEnabled            bool          `json:"isEnabled"`
	IsLocked             bool          `json:"isLocked"`
	IsAdmin              bool          `json:"isAdmin"`
	PasswordNeverExpires bool          `json:"passwordNeverExpires"`
	NoChangePassword     bool          `json:"noChangePassword"`
	PasswordAge          time.Duration `json:"passwordAge"`
	LastLogon            time.Time     `json:"lastLogon"`
	BadPasswordCount     uint32        `json:"badPasswordCount"`
	NumberOfLogons       uint32        `json:"numberOfLogons"`
}

type Memory

type Memory struct {
	TotalRAM              uint64 `json:"totalRAM"`
	UsableRAM             uint64 `json:"usableRAM"`
	FreeRAM               uint64 `json:"freeRAM"`
	TotalPageFile         uint64 `json:"totalPF"`
	FreePageFile          uint64 `json:"freePF"`
	SystemManagedPageFile bool   `json:"managedPF"`
}

type MemoryDIMM

type MemoryDIMM struct {
	MType string `json:"MemoryType"`
	Size  uint64 `json:"Size"`
	Speed uint16 `json:"Speed"`
}

type NetSetupProvisioningParams

type NetSetupProvisioningParams struct {
	Domain               string   `json:"domain"`
	HostName             string   `json:"hostname"`
	MachineAccountOU     string   `json:"machine_account_ou,omitempty"`
	CertificateTemplates []string `json:"certificate_templates,omitempty"`
	GroupPolicyObjects   []string `json:"group_policy_objects,omitempty"`
}

type Network

type Network struct {
	Name          string   `json:"NetworkName"`
	MACAddress    string   `json:"MACAddress"`
	IPAddressCIDR []string `json:"IPAddresses"`
	DHCPEnabled   bool     `json:"DHCPEnabled"`
}

type OperatingSystem

type OperatingSystem struct {
	FriendlyName   string    `json:"FriendlyName"`
	Version        string    `json:"Version"`
	Architecture   string    `json:"Architecture"`
	LanguageCode   uint16    `json:"Language"`
	LastBootUpTime time.Time `json:"LastBootUpTime`
	SystemDrive    string    `json:"SystemDrive"`
}

type Process

type Process struct {
	Pid        int    `json:"pid"`
	Ppid       int    `json:"parentpid"`
	Executable string `json:"exeName"`
	Fullpath   string `json:"fullPath"`
	Username   string `json:"username"`
}

type Service

type Service struct {
	SCName      string `json:"name"`
	DisplayName string `json:"displayName"`
	Status      uint32 `json:"status"`
	StatusText  string `json:"statusText"`
	ServiceType uint32 `json:"serviceType"`
	IsRunning   bool   `json:"isRunning"`
	AcceptStop  bool   `json:"acceptStop"`
	RunningPid  uint32 `json:"pid"`
}

type SessionDetails

type SessionDetails struct {
	Username      string    `json:"username"`
	Domain        string    `json:"domain"`
	LocalUser     bool      `json:"isLocal"`
	LocalAdmin    bool      `json:"isAdmin"`
	LogonType     uint32    `json:"logonType"`
	LogonTime     time.Time `json:"logonTime"`
	DnsDomainName string    `json:"dnsDomainName"`
}

func (*SessionDetails) FullUser

func (s *SessionDetails) FullUser() string

func (*SessionDetails) GetLogonType

func (s *SessionDetails) GetLogonType() string

type Software

type Software struct {
	DisplayName     string    `json:"displayName"`
	DisplayVersion  string    `json:"displayVersion"`
	Arch            string    `json:"arch"`
	Publisher       string    `json:"publisher"`
	InstallDate     time.Time `json:"installDate"`
	EstimatedSize   uint64    `json:"estimatedSize"`
	Contact         string    `json:"Contact"`
	HelpLink        string    `json:"HelpLink"`
	InstallSource   string    `json:"InstallSource"`
	InstallLocation string    `json:"InstallLocation"`
	UninstallString string    `json:"UninstallString"`
	VersionMajor    uint64    `json:"VersionMajor"`
	VersionMinor    uint64    `json:"VersionMinor"`
	RegKey          string    `json:"RegKey"`
}

EstimatedSize is in KB, As estimated & written to the registry by the installer itself, or Windows Installer for an MSI.

func (*Software) Architecture

func (s *Software) Architecture() string

func (*Software) Name

func (s *Software) Name() string

func (*Software) Version

func (s *Software) Version() string

type WindowsUpdate

type WindowsUpdate struct {
	UpdatesReq    bool                    `json:"required"`
	NumUpdates    int                     `json:"number"`
	UpdateHistory []*WindowsUpdateHistory `json:"history"`
}

type WindowsUpdateHistory

type WindowsUpdateHistory struct {
	EventDate  time.Time `json:"eventDate"`
	Status     string    `json:"status"`
	UpdateName string    `json:"updateName"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL