I would like to have a script that creates a new user name(user account) in Q1IM with first initial and last name. If the same name already exists add a middle initial. If still exists add a numerical value to the new username. I have the following script.
I need help in integrating the script into Q1IM.
And also to enable the script doing the following:
If the same name already exists add a middle initial. If still exists add a numerical value to the new username.
If still exists add a numerical value to the new username. I have the following script. I need help in integrating the script into Q1IM.
Public Sub CreateAdAccount(ByVal sUserName As String, _
ByVal sPassword As String, _
ByVal sFirstName As String, ByVal sLastName As String, _
ByVal sGroupName As String)
Dim catalog As Catalog = New Catalog()
Dim dirEntry As New DirectoryEntry()
Dim adUsers As DirectoryEntries = dirEntry.Children
Dim newUser As DirectoryEntry = adUsers.Add("CN=" & sUserName, "user")
SetProperty(newUser, "givenname", sFirstName)
SetProperty(newUser, "sn", sLastName)
SetProperty(newUser, "SAMAccountName", sUserName)
SetProperty(newUser, "userPrincipalName", sUserName)
newUser.CommitChanges()
SetPassword(newUser, sPassword)
EnableAccount(newUser)
newUser.Close()
dirEntry.Close()
End Sub