CreateWebAccount Method

Creates user accounts for Microsoft Office Project Server 2003.

Syntax

expression**.CreateWebAccount(ServerURL, Name, AuthenticationType, AccountType, ShowDialog)**

*expression   *     Optional. An expression that returns an Application object.

ServerURL    Optional String. The URL of the Project Server where the account is being created. If ServerURL is not specified, the value of the ServerURL property will be used.

Name    Optional String. The name of the user account to create. If AuthenticationType is pjWindowsUserAccount, Name must be in the format of a valid security identifier for Microsoft Windows NT Authentication, "\*Domain name   *\User name", where Domain name is the name of the user's Windows domain and User name is the user's logon name. If the specified identifier does not exist, an error will occur. If Name is not specified and the value of the ServerIdentification property is pjWindowsUserAccount, the Windows user account that was used to log on will be used. If Name is not specified and the value of the ServerIdentification property is pjUserName, the value of the UserName property will be used.

AuthenticationType    Optional Long. Specifies how users are identified to Project Server. Can be one of the following PjAuthentication constants: pjWindowsUserAccount or pjUserName. The default value is pjUserName.

AccountType    Optional Long. The type of user account to create. The default value is pjResourceAccount.

ShowDialog    Optional Boolean. True if a message confirming the creation of the user account appears. The default value is True.

Remarks

Any argument not specified with the CreateWebAccount method must have a value specified through alternate means, either programmatically or through the user interface, or an error will occur.

Example

This example creates a new resource account for each human resource in the active project. The accounts are created on different servers, according to the resource's group, using Microsoft Windows NT Authentication.

Sub CreateAccountsForGroups()
    Dim R As Resource
    
    For Each R In ActiveProject.Resources
        If R.Type = pjResourceTypeWork Then
            If R.Group = "Accounting" Then
                Application.CreateWebAccount "http://accounting", R.WindowsUserAccount, _
                    pjWindowsUserAccount, pjResourceAccount
            ElseIf R.Group = "Marketing" Then
                Application.CreateWebAccount "http://corp1", R.WindowsUserAccount, _
                    pjWindowsUserAccount, pjResourceAccount
            End If
        End If
    Next R
End Sub

Applies to | Application Object

See Also | ResourceWindowsAccount Method | UserName Property | WindowsUserAccount Property