AddNTAccount Method
Description
Creates a new Microsoft Windows NT Authenticated account in the Microsoft Office Project Server 2003 database using the Project Server security object.
Syntax
Function AddNTAccount( _
ByVal bstrUserName As String, _
ByVal bstrNTAccount As String, _
ByVal bstrEmail As String, _
ByVal bstrPhonetic As String, _
ByVal bstrGrpGUIDs As String, _
ByVal bstrGlobalPerm As String, _
ByVal bstrCatPerm As String, _
ByVal lAdminRandomSeed0 As Long, _
ByVal lAdminRandomSeed1 As Long _
) As Long
Parameters
Parameter | Description |
---|---|
bstrUserName |
Required String. The friendly name for this account. |
bstrNTAccount |
Required String. The associated Windows NT Account, in the form DOMAIN\alias. |
bstrEmail |
Required String. The associated e-mail account. |
bstrPhonetic |
Required String. The phonetic spelling of bstrUserName. Note The phonetic spelling is used only for a Locale ID (LCID) of 1041, which is for Japanese. 1033 is the LCID for U.S. English. If the LCID is not 1041, use an empty string (""). |
bstrGrpGUIDs |
Required String. Comma-separated list of the GUIDs for the groups in which this user is a member. |
bstrGlobalPerm |
Required String. The global permission settings for this group, in the format "101,2;102,1;". The string has the following parts:
|
bstrCatPerm |
Required String. The category security permission settings for the group, in the format "<101>508,2;509,1;<102>508,1;". The string has the following parts:
|
lAdminRandomSeed0 |
Required Long. Random number for security purposes. |
lAdminRandomSeed1 |
Required Long. Random number for security purposes. |
Return Value
The AddNTAccount method returns HRESULT as a Long (4-byte integer) value.
Remarks
See admin/sec_svr_users.asp for how Project Server uses AddNTAccount.
Example
The following Microsoft Visual Basic 6.0 example adds a new Windows NT Authenticated account in the Project Server database.
Dim lResult as Long
Dim sGroupGuids as String
Dim lSeed1 as Long
Dim lSeed2 as Long
' Assign comma-separated list of group GUIDs to sGroupGuids
' Assign long integer positive values to lSeed1 and lSeed2
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.AddNTAccount("Friendly Name", "DOMAIN\fname", "fname@domain.com", "", _
sGroupGuids, "101,2;102,1", "<101>508,2;509,1;<102>508,1;", _
lSeed1, lSeed2)
Set oSec = Nothing