wstransfer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointResource        = "Windows/Resource"
	EndpointResourceFactory = "Windows/ResourceFactory"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SOAPTransport

type SOAPTransport interface {
	Send(soapMessage string) error
	Recv() (string, error)
}

type WSTransferClient

type WSTransferClient struct {
	// contains filtered or unexported fields
}

WSTransferClient sends WS-Transfer requests over an authenticated NMF transport. Depending on the operation, it targets either the Windows/Resource endpoint (Get, Put, Delete) or Windows/ResourceFactory (Create and Add* helpers).

func NewWSTransferClient

func NewWSTransferClient(transport SOAPTransport, fqdn string, port int, endpoint string, ldapPort int, debugXML func(string, string)) *WSTransferClient

NewWSTransferClient creates a WSTransferClient targeting the given endpoint. ldapPort controls the ad:instance header value (389 for a DC, 3268 for a GC).

func (*WSTransferClient) AddComputer

func (ws *WSTransferClient) AddComputer(parentDN, computerName, domainName, computerPass string) (string, error)

AddComputer creates a computer account under parentDN using an IMDA AddRequest.

func (*WSTransferClient) AddContainer

func (ws *WSTransferClient) AddContainer(parentDN, cn string) (string, error)

AddContainer creates a generic container object under parentDN.

func (*WSTransferClient) AddGroup

func (ws *WSTransferClient) AddGroup(parentDN, groupName, groupType string) (string, error)

AddGroup creates a security or distribution group under parentDN. groupType is an AD groupType integer as a decimal string (e.g. "-2147483646" for global security).

func (*WSTransferClient) AddOU

func (ws *WSTransferClient) AddOU(parentDN, ouName string) (string, error)

AddOU creates an organizationalUnit container under parentDN.

func (*WSTransferClient) AddUser

func (ws *WSTransferClient) AddUser(parentDN, userName, domainName, userPass string, enabled bool) (string, error)

AddUser creates a user account under parentDN using an IMDA AddRequest.

func (*WSTransferClient) Create

func (ws *WSTransferClient) Create(instanceXML string) (string, error)

Create executes WS-Transfer Create and returns the address of the created resource.

The address is best-effort and may be empty if the server response does not include a parsable ResourceCreated/Address or objectReferenceProperty.

func (*WSTransferClient) CreateComputer

func (ws *WSTransferClient) CreateComputer(parentDN, computerName string) (string, error)

CreateComputer creates a minimal computer object under parentDN. For a fully-configured account with a domain name and password, use AddComputer instead.

func (*WSTransferClient) CustomCreate

func (ws *WSTransferClient) CustomCreate(parentDN, rdn string, attrs []soap.IMDAAttributeSpec) (string, error)

CustomCreate creates an arbitrary AD object under parentDN using an IMDA AddRequest with a caller-supplied attribute set. rdn is the relative distinguished name (e.g. "CN=Foo").

func (*WSTransferClient) Delete

func (ws *WSTransferClient) Delete(dn string) error

Delete removes the AD object at the given distinguished name using WS-Transfer Delete.

func (*WSTransferClient) Get

func (ws *WSTransferClient) Get(dn string, attrs []string) (*soap.ADWSItem, error)

Get fetches the specified attributes of a single AD object by distinguished name using WS-Transfer Get (Windows/Resource).

func (*WSTransferClient) Put

func (ws *WSTransferClient) Put(dn, instanceXML string) error

Put modifies attributes of an existing AD object using WS-Transfer Put. instanceXML is a raw LDAP attribute XML payload (IMDA ModifyRequest body).

Jump to

Keyboard shortcuts

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