ok here goes. I have the following code for checking if a user exists in a NT domain:
and the following code for putting a follownumber at the end of the username:Code:if NetUserGetInfo(bServer(0), bUsername(0), 3, lpBuf) = ERR_Success) then Dim lpBuf As Long Dim ui3 As USER_INFO_3 Dim bServer() As Byte, bUsername() As Byte bServer = "\\tempsrv" & vbNullChar bUsername = username & vbNullChar Call MoveMemory(ui3, ByVal lpBuf, Len(ui3)) msgbox "username " & username & " already exists" else blabla create user end if
how can i put this in a loop that if username1 and username2 already exist it creates a username username3 for example???Code:username = Left(username, Len(username) - 1) & Right(username, 1) + 1
I hope you know what i mean![]()




Reply With Quote