Export (0) Print
Expand All

4.2 Enabling a User Account

The following sequence of methods and parameters enables the user account created in the previous example. This is performed on the machine with the network address of "msdc-1", a domain name of "ms", and a user name of "testuser" with Relative ID = 2810.

  1. Send SamrConnect.

    Parameter field

    Parameter value

    ServerName

    msdc-1

    DesiredAccess

    0x31

  2. Receive SamrConnect.

    Parameter field

    Parameter value

    Status

    0

    ServerHandle

    [implementation-specific value] serverHandle

  3. Send SamrLookupDomainInSamServer.

    Parameter field

    Parameter value

    ServerHandle

    serverHandle

    Name.Length

    4

    Name.MaximumLength

    4

    Name.Buffer

    ms

  4. Receive SamrLookupDomainInSamServer.

    Parameter field

    Parameter value

    Status

    0

    DomainId

    [implementation-specific SID]. For example: S-1-5-21-3448151421-356457007-600757626

  5. Send SamrOpenDomain.

    Parameter field

    Parameter value

    ServerHandle

    serverHandle

    DesiredAccess

    0x00000200

    DomainId

    S-1-5-21-3448151421-356457007-600757626

  6. Receive SamrOpenDomain.

    Parameter field

    Parameter value

    Status

    0

    DomainHandle

    [implementation-specific value] domainHandle

  7. Send SamrOpenUser.

    Parameter field

    Parameter value

    DomainHandle

    domainHandle

    DesiredAccess

    0x02000000

    UserId

    2810

  8. Receive SamrOpenUser.

    Parameter field

    Parameter value

    Status

    0

    UserHandle

    [implementation-specific value] userHandle

  9. Send SamrSetInformationUser2.

    Parameter field

    Parameter value

    UserHandle

    userHandle

    UserInformationClass

    16

    Buffer

    Control = { 0x00000010 }

  10. Receive SamrSetInformationUser2.

    Parameter field

    Parameter value

    Status

    0

  11. Send SamrCloseHandle.

    Parameter field

    Parameter value

    Handle

    userHandle

  12. Receive SamrCloseHandle.

    Parameter field

    Parameter value

    Status

    0

    Handle

    0

  13. Send SamrCloseHandle.

    Parameter field

    Parameter value

    Handle

    domainHandle

  14. Receive SamrCloseHandle.

    Parameter field

    Parameter value

    Status

    0

    Handle

    0

  15. Send SamrCloseHandle.

    Parameter field

    Parameter value

    Handle

    serverHandle

  16. Receive SamrCloseHandle.

    Parameter field

    Parameter value

    Status

    0

    Handle

    0

 
Show:
© 2014 Microsoft