To create a user
- Bind to the computer using the following rules:
- Use an account that has sufficient rights to access that computer.
- Use the following binding string format using the WinNT provider, computer name, and an extra parameter to tell ADSI that it is binding to a computer: "WinNT://<computer name>,<computer>". The "<computer name>" computer is the name of the computer whose groups you want to access. This parameter tells ADSI that it is binding to a computer and allows the WinNT provider's parser to skip some ambiguity resolution queries to determine what type of object you are binding to.
- Bind to the IADsContainer interface.
- Specify "user" as the class using IADsContainer.Create to add the user.
- Write the user to the computer's security database using IADs.SetInfo.
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
