Oh
yeah, I guess I have to read the username from a file and pass it into the dsmod
command also. Do I just want a list of users in a .txt file, .cvs??? And how do
I read from that?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Douglas M. Long
Sent: Monday, May 24, 2004 9:41 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] Password set and enable accountOk, so my task is to generate random passwords and enable the accounts for 3200 users. The user accounts and all attributes were first created with ldife, and I am now thinking about using the dsmod utility to do accomplish the password set and account enablement. I wish I knew vbs like you guys do, but I dont yet (this years resolution). So here is what I have for the password generation part:Function Password_GenPass( nNoChars, sValidChars )
' nNoChars = length of generated password
' sValidChars = valid characters. If zerolength-string ( "" )then
' default is used: A-Z AND a-z AND 0-9Const szDefault = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789"
Dim nCount
Dim sRet
Dim nNumber
Dim nLengthRandomize 'init randomIf sValidChars = "" Then
sValidChars = szDefault
End If
nLength = Len( sValidChars )For nCount = 1 To nNoChars
nNumber = Int((nLength * Rnd) + 1)
sRet = sRet & Mid( sValidChars, nNumber, 1 )
Next
Password_GenPass = sRet
End FunctionWScript.Echo "Your password: " & Password_GenPass( 10, "" )What is my next move? I am guessing I have to pass this password to a variable, instead of echo, and then somehow pass that into the dsmod command, but as I already said, I dont know vb script. Any help is highly appreciated.
