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!

Can access all items in User Manager except one.

Status
Not open for further replies.

ibizarich

Technical User
Jan 11, 2002
8
GB
By Shelling out and performing the NET USER command from Access I can create a New user and assign them all the relevant properties Except to tick the box that says "user must change password at next login". I don't know if this was overlooked in the NET USER command as everything else is there. ie, passwordchg and passwordreq, but they are not the right ones. Can anyone tell me how I can get a tick in that box from Access?
 
If you are using the code I gave you in you other post, you can not request that user change password at next logon from the command prompt.
 
Also the original code I gave you was a little rushed (sorry). In case you haven't figured it out it won't work as it does not enclose the FullName and Description in double quotes. This revised code is a lot better, with it FullName and Description are optional.

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

Dim strCommand As String


strCommand = Environ("ComSpec") & " /c net user " & strUserName & " " & strPassword & " /add"

If Len(strFullName) > 0 Then
strCommand = strCommand & " /fullname:""" & strFullName & """"
End If

If Len(strDescription) > 0 Then
strCommand = strCommand & " /usercomment:""" & strDescription & """"
End If

Shell strCommand

End Sub
 
Thanks for your help there, Ive got all that working fine now, thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top