Platform SDK: Exchange Server

IAcctMgmt::NtAccountCreate Method

Creates a Windows NT domain account.

IDL Definition

HRESULT NtAccountCreate(
   [in] BSTR bstrDomain,
   [in] BSTR bstrUserLogin,
   [in] BSTR bstrPassword,
   [in] BSTR bstrUserComment,
   [in] BSTR bstrLocalGroup
);

Visual Basic Definition

Public Sub NtAccountCreate (
  bstrDomain as String,
  bstrUserLogin as String,
  bstrPassword as String,
  bstrUserComment as String,
  bstrLocalGroup as String
)

Parameters

bstrDomain
The domain in which to create the user account. If the string is empty, then the local machine domain is used.
bstrUserLogin
The login name for the account.
bstrPassword
The password for the account.
bstrUserComment
The description for the account.
bstrLocalGroup
The local group in which to add the account. If the string is empty, then the domain users group is assumed.

Remarks

Potential exceptions include HRESULT values of E_INVALIDARG as well as HRESULTs with the facility bits set to FACILITY_WIN32 (Win32). These values are generated by the standard call HRESULT_From_WIN32() function, returning the last thread error as an HRESULT across the interface. If the account was created successfully, the HRESULT value S_OK is returned.

Example

See the class example.