Likewise Security and Authentication Subsystem
AD Provider client API

AD Provider client API. More...

Functions

DWORD LsaAdJoinDomain (HANDLE hLsaConnection, PCSTR pszHostname, PCSTR pszHostDnsDomain, PCSTR pszDomain, PCSTR pszOU, PCSTR pszUsername, PCSTR pszPassword, PCSTR pszOSName, PCSTR pszOSVersion, PCSTR pszOSServicePack, LSA_NET_JOIN_FLAGS dwFlags)
 Join an Active Directory domain. More...
 
DWORD LsaAdJoinDomainDn (IN HANDLE hLsaConnection, IN PCSTR pHostname, IN PCSTR pHostDnsDomain, IN PCSTR pDomain, IN PCSTR pOu, IN PCSTR pUsername, IN PCSTR pPassword, IN PCSTR pOsName, IN PCSTR pOsVersion, IN PCSTR pOsServicePack, IN LSA_NET_JOIN_FLAGS dwFlags)
 Join Active Directory domain with alternate OU syntax. More...
 
DWORD LsaAdJoinDomainUac (HANDLE hLsaConnection, PCSTR pszHostname, PCSTR pszHostDnsDomain, PCSTR pszDomain, PCSTR pszOu, PCSTR pszUsername, PCSTR pszPassword, PCSTR pszOSName, PCSTR pszOSVersion, PCSTR pszOSServicePack, LSA_NET_JOIN_FLAGS dwFlags, LSA_USER_ACCOUNT_CONTROL_FLAGS dwUac)
 Join Active Directory domain with userAccountControl flags. More...
 
DWORD LsaAdLeaveDomain (HANDLE hLsaConnection, PCSTR pszUsername, PCSTR pszPassword)
 Leave default Active Directory domain. More...
 
DWORD LsaAdLeaveDomain2 (HANDLE hLsaConnection, PCSTR pszUsername, PCSTR pszPassword, PCSTR pszDomain, LSA_NET_JOIN_FLAGS dwFlags)
 Leave Active Directory domain. More...
 
DWORD LsaAdSetDefaultDomain (IN HANDLE hLsaConnection, IN PCSTR pszDomain)
 Set default Active Directory domain. More...
 
DWORD LsaAdGetJoinedDomains (IN HANDLE hLsaConnection, OUT PDWORD pdwNumDomainsFound, OUT PSTR **pppszJoinedDomains)
 Get joined domain list. More...
 
typedef DWORD LSA_NET_JOIN_FLAGS
 Domain join flags. More...
 

Detailed Description

This module provides functions to communicate directory with the lsass Active Directory provider.

Typedef Documentation

typedef DWORD LSA_NET_JOIN_FLAGS

Encodes additional options when joining a domain

Function Documentation

DWORD LsaAdJoinDomain ( HANDLE  hLsaConnection,
PCSTR  pszHostname,
PCSTR  pszHostDnsDomain,
PCSTR  pszDomain,
PCSTR  pszOU,
PCSTR  pszUsername,
PCSTR  pszPassword,
PCSTR  pszOSName,
PCSTR  pszOSVersion,
PCSTR  pszOSServicePack,
LSA_NET_JOIN_FLAGS  dwFlags 
)

Instructs the AD provider to join the computer to an Active Directory domain. If already joined, and #LW_NET_JOIN_DOMAIN_MULTIPLE is not specified, the AD provider will first leave the default domain.

Parameters
[in]hLsaConnectiona connection handle
[in]pszHostnamethe computer name to join with
[in]pszHostDnsDomainthe DNS domain name of the computer
[in]pszDomainthe fully-qualified domain name to join
[in]pszOUan optional OU (organizational unit) to join, specified as forward-slash separated components
[in]pszUsernamethe name of an AD user with permission with permission to join computers to the target domain
[in]pszPasswordthe password for the user
[in]pszOSNamethe operating system name to set on the computer object
[in]pszOSVersionthe operating system version to set on the computer object
[in]pszOSServicePackthe service pack level to set on the computer object
[in]dwFlagsadditional flags to control join behavior
Return values
LW_ERROR_SUCCESSsuccess
DWORD LsaAdJoinDomainDn ( IN HANDLE  hLsaConnection,
IN PCSTR  pHostname,
IN PCSTR  pHostDnsDomain,
IN PCSTR  pDomain,
IN PCSTR  pOu,
IN PCSTR  pUsername,
IN PCSTR  pPassword,
IN PCSTR  pOsName,
IN PCSTR  pOsVersion,
IN PCSTR  pOsServicePack,
IN LSA_NET_JOIN_FLAGS  dwFlags 
)

Identical to LsaAdJoinDomain(), but accepts a raw LDAP DN (distinguished name) for the OU to join.

Parameters
[in]hLsaConnectiona connection handle
[in]pHostnamethe computer name to join with
[in]pHostDnsDomainthe DNS domain name of the computer
[in]pDomainthe fully-qualified domain name to join
[in]pOuan optional OU (organizational unit) to join specified as a DN.
[in]pUsernamethe name of an AD user with permission with permission to join computers to the target domain
[in]pPasswordthe password for the user
[in]pOsNamethe operating system name to set on the computer object
[in]pOsVersionthe operating system version to set on the computer object
[in]pOsServicePackthe service pack level to set on the computer object
[in]dwFlagsadditional flags to control join behavior
Return values
LW_ERROR_SUCCESSsuccess
DWORD LsaAdJoinDomainUac ( HANDLE  hLsaConnection,
PCSTR  pszHostname,
PCSTR  pszHostDnsDomain,
PCSTR  pszDomain,
PCSTR  pszOu,
PCSTR  pszUsername,
PCSTR  pszPassword,
PCSTR  pszOSName,
PCSTR  pszOSVersion,
PCSTR  pszOSServicePack,
LSA_NET_JOIN_FLAGS  dwFlags,
LSA_USER_ACCOUNT_CONTROL_FLAGS  dwUac 
)

Identical to LsaAdJoinDomain(), but allows passing User-Account-Control flag values.

Parameters
[in]hLsaConnectiona connection handle
[in]pHostnamethe computer name to join with
[in]pHostDnsDomainthe DNS domain name of the computer
[in]pDomainthe fully-qualified domain name to join
[in]pOuan optional OU (organizational unit) to join specified as a DN.
[in]pUsernamethe name of an AD user with permission with permission to join computers to the target domain
[in]pPasswordthe password for the user
[in]pOsNamethe operating system name to set on the computer object
[in]pOsVersionthe operating system version to set on the computer object
[in]pOsServicePackthe service pack level to set on the computer object
[in]dwFlagsadditional flags to control join behavior
[in]dwUacadditional user account control flags
Return values
LW_ERROR_SUCCESSsuccess
DWORD LsaAdLeaveDomain ( HANDLE  hLsaConnection,
PCSTR  pszUsername,
PCSTR  pszPassword 
)

Leaves the currently-joined default AD domain.

Parameters
[in]hLsaConnectiona connection handle
[in]pszUsernamean optional name of a user with permissions to disable the machine account in AD
[in]pszPasswordan optional password for the provided user
Return values
LW_ERROR_SUCCESSsuccess
DWORD LsaAdLeaveDomain2 ( HANDLE  hLsaConnection,
PCSTR  pszUsername,
PCSTR  pszPassword,
PCSTR  pszDomain,
LSA_NET_JOIN_FLAGS  dwFlags 
)

Leaves a currently-joined AD domain. This function supports leaving a specific domain when multiple domains are joined and additional flags to control leave behavior.

Parameters
[in]hLsaConnectiona connection handle
[in]pszUsernamean optional name of a user with permissions to disable the machine account in AD
[in]pszPasswordan optional password for the provided user
[in]pszDomainthe domain to leave
[in]dwFlagsadditional leave flags
Return values
LW_ERROR_SUCCESSsuccess
DWORD LsaAdSetDefaultDomain ( IN HANDLE  hLsaConnection,
IN PCSTR  pszDomain 
)

Sets the default AD domain.

Parameters
[in]hLsaConnectiona connection handle
[in]pszDomainthe domain
Return values
LW_ERROR_SUCCESSsuccess
DWORD LsaAdGetJoinedDomains ( IN HANDLE  hLsaConnection,
OUT PDWORD  pdwNumDomainsFound,
OUT PSTR **  pppszJoinedDomains 
)

Gets a list of joined domains. Free the result with LwFreeStringArray().

Parameters
[in]hLsaConnectiona connection handle
[out]pdwNumDomainsFoundset to the number of joined domains
[out]pppszJoinedDomainsset to the list of joined domains
Return values
LW_ERROR_SUCCESSsuccess