wscap

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 (
	EndpointAccountManagement  = "Windows/AccountManagement"
	EndpointTopologyManagement = "Windows/TopologyManagement"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SOAPTransport

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

type WSCapClient

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

WSCapClient is a client for MS-ADCAP (Active Directory Web Services Custom Actions Protocol) endpoints (e.g. AccountManagement, TopologyManagement).

Note: the underlying transport must already be connected to the intended endpoint via NMF. The endpoint value here is used to normalize WS-Addressing headers (To/Action routing).

func NewWSCapClient

func NewWSCapClient(transport SOAPTransport, fqdn string, port int, endpoint string, ldapPort int, debugXML func(string, string)) *WSCapClient

NewWSCapClient creates a WSCapClient targeting endpoint (e.g. EndpointAccountManagement or EndpointTopologyManagement). ldapPort controls the ad:instance SOAP header value.

func (*WSCapClient) ChangeOptionalFeature

func (c *WSCapClient) ChangeOptionalFeature(distinguishedName string, enable bool, featureID string) error

ChangeOptionalFeature enables or disables the AD optional feature identified by featureID (a well-formed GUID string) on the scope object at distinguishedName (MS-ADCAP §3.4.4.1).

func (*WSCapClient) ChangePassword

func (c *WSCapClient) ChangePassword(accountDN, partitionDN, oldPassword, newPassword string) error

ChangePassword changes the password for the account at accountDN (MS-ADCAP §3.3.4.1). The caller must supply the current password as oldPassword.

func (*WSCapClient) GetADDomain

func (c *WSCapClient) GetADDomain() (*soap.ADCAPActiveDirectoryDomain, error)

GetADDomain returns domain properties from the TopologyManagement endpoint (MS-ADCAP §3.4.4.2).

func (*WSCapClient) GetADDomainController

func (c *WSCapClient) GetADDomainController(ntdsSettingsDNs []string) ([]soap.ADCAPActiveDirectoryDomainController, error)

GetADDomainController returns information about domain controllers whose NTDS settings objects match the given DNs (MS-ADCAP §3.4.4.3). Pass nil or an empty slice to query the DC serving the connection.

func (*WSCapClient) GetADForest

func (c *WSCapClient) GetADForest() (*soap.ADCAPActiveDirectoryForest, error)

GetADForest returns forest properties from the TopologyManagement endpoint (MS-ADCAP §3.4.4.4).

func (*WSCapClient) GetADGroupMember

func (c *WSCapClient) GetADGroupMember(groupDN, partitionDN string, recursive bool) ([]soap.ADCAPActiveDirectoryPrincipal, error)

GetADGroupMember returns the members of the group at groupDN (MS-ADCAP §3.3.4.2). When recursive is true, nested group members are expanded.

func (*WSCapClient) GetADPrincipalAuthorizationGroup

func (c *WSCapClient) GetADPrincipalAuthorizationGroup(partitionDN, principalDN string) ([]soap.ADCAPActiveDirectoryGroup, error)

GetADPrincipalAuthorizationGroup returns the authorization groups (security groups and SID history) for the principal at principalDN (MS-ADCAP §3.3.4.3).

func (*WSCapClient) GetADPrincipalGroupMembership

func (c *WSCapClient) GetADPrincipalGroupMembership(partitionDN, principalDN, resourceContextPartition, resourceContextServer string) ([]soap.ADCAPActiveDirectoryGroup, error)

GetADPrincipalGroupMembership returns the group memberships of the principal at principalDN (MS-ADCAP §3.3.4.4). resourceContextPartition and resourceContextServer must both be set or both be empty.

func (*WSCapClient) GetVersion

func (c *WSCapClient) GetVersion() (*soap.ADCAPVersionInfo, error)

GetVersion returns the ADWS server version from the TopologyManagement endpoint (MS-ADCAP §3.4.4.5).

func (*WSCapClient) SetPassword

func (c *WSCapClient) SetPassword(accountDN, partitionDN, newPassword string) error

SetPassword sets the password for the account at accountDN (MS-ADCAP §3.3.4.5). partitionDN is the directory partition containing the account.

func (*WSCapClient) TranslateName

func (c *WSCapClient) TranslateName(formatOffered, formatDesired string, names []string) ([]soap.NameTranslateResult, error)

TranslateName translates one or more AD names between the formats specified by formatOffered and formatDesired (MS-ADCAP §3.3.4.6). Valid format strings are defined in the ActiveDirectoryNameFormat enum (e.g. "DistinguishedName", "CanonicalName").

Jump to

Keyboard shortcuts

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