![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Exchange 2007 Bulk Mailbox Creation - Password? I have been looking at the commands, and i've got one ready to import users and create mailboxes in exchange 2007 from a csv file with the following command: Import-CSV import.csv | foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database $_.Database -org script -Password $_.Password} The only problem is I get an error because Password cannot be plain text, it must be a secure string. How can I change this command so that it reads the value from the CSV file and converts it to a secure string before passing it to the account creation part? |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | RE: Exchange 2007 Bulk Mailbox Creation - Password? Try Import-CSV import.csv | foreach {$pswd = ConvertTo-SecureString $_.Password; new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database $_.Database -org script -Password $pswd} -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "John W" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Exchange 2007 Bulk Mailbox Creation - Password? Thanks. That didn't work, it was giving me an error but set me on the right track! i had to add the -asplaintext -force on to the end of that converttosecurestring command. For anyone else with this problem, here's what my final command looks like: import-csv import.csv | foreach {$pswd = ConvertTo-SecureString $_.Pass word -asplaintext -force; new-mailbox -alias $_.alias -name $_.name -userprincip alname $_.upn -database $_.database -org script -Password $pswd -displayname $_. name -firstname $_.firstname -lastname $_.lastname -samaccountname $_.samaccount name} This will import/create mailboxes from a csv file with those headings (ie: $_.Password would be the heading of "Password" in the csv file) "RichS" <RichS@xxxxxx> wrote in message news:684439F6-8C26-46B6-84E4-A40761A0D0C8@xxxxxx
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Exchange 2007 Bulk Mailbox Creation - Password? I do have a question though. now that I have this command: import-csv import.csv | foreach {$pswd = ConvertTo-SecureString $_.Pass word -asplaintext -force; new-mailbox -alias $_.alias -name $_.name -userprincip alname $_.upn -database $_.database -org script -Password $pswd -displayname $_. name -firstname $_.firstname -lastname $_.lastname -samaccountname $_.samaccount name} How is it that I can save it as a file and execute it without having to type that thing in the command shell everytime? I thought i just save it as ps1 file but powershell tells me it's not a recognized cmdlet or something. "John W" <whitesj@xxxxxx> wrote in message news:e2x9dFUAIHA.5360@xxxxxx
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Exchange 2007 Bulk Mailbox Creation - Password? save it as a .ps1 file and you run it by either giving the full path or if you are in directory containing the script you run it as ..\myscript.ps1 where myscript.ps1 is the name you saved it under PowerShell does NOT have the current folder on the path so it can't find the script if you just use the name -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "John W" wrote:
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exchange 2007 Remove Mailbox after AD deletion | Shelley | .NET General | 0 | 07-25-2008 01:20 PM |
| Exchange 2007 - Mailbox management | Sabo, Eric | PowerShell | 14 | 02-11-2008 10:01 AM |
| Re: Exchange 2007: cross org mailbox migration bulk from csv file | selspiero | PowerShell | 9 | 01-10-2008 10:41 AM |
| Exchange 2007: cross org mailbox migration bulk from csv file | selspiero | PowerShell | 8 | 01-09-2008 08:25 AM |
| Creating a new mailbox on Exchange 2007 | huzaifa kagazwala | PowerShell | 5 | 12-04-2006 10:26 AM |