Solved

Generate Random passwords for domain users ?

Posted on 2006-11-07
9
386 Views
Last Modified: 2012-06-21
we are migrating our domain from 2000 to 2003, we have created new users accounts and now we need to generate new random passwords for the users?

is there a tool.. script... that can be used to create the random password for the users, since i do not want to reset them all to a common password .

i need to have for each user random password ?

0
Comment
Question by:ajalboush
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 22

Expert Comment

by:Christopher McKay
ID: 17887584
Is this what you're looking for?

http://www.winguides.com/security/password.php

Hope this helps!

:o)

Bartender_1
0
 
LVL 9

Expert Comment

by:vsg375
ID: 17888087
Good link indeed !

Here's another one to an installable version (can be helpful if no Inet is available)

http://www.snapfiles.com/download/dlranpass.html

HTH
Cheers
0
 
LVL 5

Expert Comment

by:MarkusKolbeck
ID: 17888494
you can perform those tasks with the following vbScript:

_____________________________________
Option Explicit
Dim Title, NumChar, Count, strRdm, intRdm, i, strNewPassword, dtStart
Dim strUserName, objConnection, objCommand, objRecordSet, objUser

strUserName = InputBox("Please enter the Username (samAccountName)", "Provide the Username", "MarkusK")

ResetPassword(CheckForUser(strUserName))

Function CheckForUser(samAccountName)

    dtStart = TimeValue(Now())
    strUserName = samAccountName
    Set objConnection = CreateObject("ADODB.Connection")
    objConnection.Open "Provider=ADsDSOObject;"
 
    Set objCommand = CreateObject("ADODB.Command")
    objCommand.ActiveConnection = objConnection
 
       '**** - Replace dc=fabrikam,dc=com with your Domain
    objCommand.CommandText = "<LDAP://dc=fabrikam,dc=com>;(&(objectCategory=User)" & _
            "(samAccountName=" & strUserName & "));samAccountName,distinguishedName;subtree"
   
    Set objRecordSet = objCommand.Execute
 
    If objRecordset.RecordCount = 0 Then
            WScript.Echo "sAMAccountName: " & strUserName & " does not exist."
                                Wscript.quit
    Else
        CheckForUser = objRecordSet.Fields(1)
    End If
 
    objConnection.Close
   
End Function


Sub ResetPassword(ByVal strUserDN)


      WScript.Echo strUserDN
      '**** - Define the new password
      strNewPassword = CreateRandomPassword

      '**** - Bind to the AD User Object
      Set objUser = GetObject("LDAP://" & strUserDN)
      
      '**** - Reset the password
      'objUser.SetPassword strNewPassword
      
      '**** - Delete the Script-Object
      Set objUser = Nothing
      
      WScript.Echo "The Password for User " & strUserName & " (" & strUserDN & ") has been set to: " & strNewPassword

End Sub


Function CreateRandomPassword()

      '**** - Set the password length, e.g. 8 characters
      NumChar = 8
      
      '**** - Perform a "real" randomize
      Randomize Timer
      
      '**** - Generate Password
      Do Until Count = NumChar
            Count = Count + 1
            GetRdm
            strRdm = strRdm & Chr(intRdm)
      Loop
      
      '**** - Return the value
      CreateRandomPassword = strRdm

End Function

Sub GetRdm

  intRdm = Int((122 - 49) * Rnd + 48)
 
  '**** - Enable the next line to get only alphanumeric passwords; otherwise you get complex passwords
  If intRdm > 57 And intRdm < 65 Or intRdm > 90 And intRdm < 97 Then GetRdm
 
End Sub
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 5

Expert Comment

by:MarkusKolbeck
ID: 17888501
you can also write the whole list of usernames - passwords into a text file, excel, or whatever you wish.

let me know if you need further assistance.

ATB
Markus
0
 
LVL 5

Expert Comment

by:MarkusKolbeck
ID: 17888535
one thing I forgot while testing:
you'll have to remove the ' in the line:
'objUser.SetPassword strNewPassword
in order to set the password

Otherwise the script only SAYS that the password was reset.

;-)

ATB
Markus
0
 
LVL 9

Expert Comment

by:vsg375
ID: 17888760
Excellent script, Markus ! I'll definitely keep it !

Cheers
0
 
LVL 5

Expert Comment

by:MarkusKolbeck
ID: 17888796
(: THXS :)
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 17935471
Issue resolved - question PAQ'd and the 500 points have been revoked.

RomMod
Community Support Moderator
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question