Hi,
I'm using this code to create user account,
Function CreateUserAccount (acc, paas)
Dim WinUserAccountName, WinUserAccountPass
WinUserAccountName = Session.Property("WIN_USER_ACCOUNT")
WinUserAccountPass = Session.Property("WIN_USER_PASS")
strComputer = "."
set objSystem = GetObject("WinNT://" & strComputer)
set objUser = objSystem.Create("user", WinUserAccountName)
objUser.SetPassword WinUserAccountPass
objUser.SetInfo
End Function
It works OK so far, the only thing I need to implement is:
- When the user name is already in the machine. Display message to the user telling him/her that this user name is already exist.
How can I do that in VBScript? Is there error code I can catch?
Thanks,