Generate a random password:
Hi all
We are currently using Exchange 2007 one 64-bit Windows Server 2008 R2 Enterprise. My system consist : AD, mailbox,HUB,Edge.
We want to create new accounts in an OU it is automatically generated password and the information each user's password into csv file
Please help me
August 3rd, 2010 10:09am
Refer to these:
Creating User Accounts
http://technet.microsoft.com/en-us/library/ee198803.aspx
Create User Accounts from Information in an Excel Spreadsheet
http://msdn.microsoft.com/en-us/library/ms974568.aspx
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2010 10:30am
Hi
you do not understand me, I want
automatically generated password for new account
August 3rd, 2010 10:39am
How are you creating the user accounts in AD ? Using any spreadtsheet or any third party tool ?
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2010 11:13am
Hi
I creating the user account from Exchange Management
Shell or Active Directory
1. From Exchange Management
Shell
C:\Windows\System32>Import-CSV c:\a.csv | foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.email-database "First Storage Group\test" -org
$_.OU -Password $Password -ResetPasswordOnNextLogon $False}.
file a.csv
Name, Alias, Email, OU
The account will be the same OU. I want
generated password for all the account in OU
2. From Active Directory
I want generated password for all the account in OU
August 3rd, 2010 11:33am
Refer to this article:
http://technet.microsoft.com/en-us/magazine/2009.04.windowspowershell.aspx
This function can help you creating users with the predefined passwords, but not sure if it can allow you assigning random passwords:
Function CreateUser {
Param($userinfo)
New-Mailbox –UserPrincipalName $userinfo['upn']
-alias $userinfo['samAccountName']
–database $userinfo['mailboxDatabase']
–name ($userinfo['givenName'] + ' ' + $userinfo['sn'])
–organizationalUnit $userinfo['ou']
–password 'P@ssw0rd!' –FirstName ($userinfo['givenName']
–LastName $userinfo['sn'])
–DisplayName ($userinfo['givenName'] + ' ' + $userinfo['sn'])
–ResetPasswordOnNextLogon $true
}
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2010 11:44am
This function can not randow password
August 3rd, 2010 12:13pm
Hi,
You can use the following script to generate a random password:
--------------------------------
####Set up random number generator###
$random=new-object System.Random
####Generate a new 8 character password, the range is ASCII characters from 33 to 127###
1..8|foreach {$Password=$Password+[char]$random.next(33,127)}
add-content c:\record.log $password
-------------------------
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2010 11:16am
Here is a couple of websites that will show you how to use random passwords in your createUser function.
http://grinding-it-out.blogspot.com/2008/10/generating-passwords-with-powershell.html
http://nex6.blogspot.com/2009/02/really-random-password-generator.html
Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. If the post wasn't the exact answer or was helpful in leading you to the answer, please vote
it as helpful. This can be beneficial to other community members reading the thread.
August 5th, 2010 5:45am