Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create NT domain user accounts

Status
Not open for further replies.

ibizarich

Technical User
Jan 11, 2002
8
GB
Im struggling to create NT domain user accounts in Access 97. I've plenty of examples of VB code, but my Access developers book doesnt seem to cover this topic. How do I create a new user account? Thanks.
 
Try using this sub.
strUserName=NT UserName
strPassword=User Password

Sub AddNTUsers(strUserName As String, strPassword As String)

Shell Environ("ComSpec") & " /c net user " & strUserName & " " & strPassword

End Sub
 
Thanks for that, I've managed to get that working in the domain. That sucessfullly sets the name and password, so you know if its possible to add the Full Name and Description, or any of the "Tickable" options, like Account disabled etc?
 
I haven't tested it but this should be real close.

Sub AddNTUsers(strUserName As String, strPassword As String, strFullName As String, strDescription As String)

Shell Environ("ComSpec") & " /c net user " & strUserName & " " & strPassword & " /add /fullname:'" & strFullName & "'" & "/usercomment:'" & strDescription & "'"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top