![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Using Powershell to set static passwords I'm using the following to create bulk create mailbox enabled user accounts from a CSV. $Password = Read-Host “Enter Password” -AsSecureString import-csv user1.csv | foreach {New-Mailbox -name $_.Name -sAMAccountName $_.sAMAccountName -UserPrincipalName $_.UPN -database "EXC01\SCCCS\SCCCS Database" -Password $Password -OrganizationalUnit "test.local/SCC" -ResetPasswordOnNextLogon:$true } At the moment, I have to manually type in the password before running the import. Is it possible to assign a static password without having to manually enter it....so have the password set from within the CSV? I'm trying to automate the whole thing but can't figure out how... JC |
My System Specs![]() |
| | #2 (permalink) |
| Scripting Guru ![]() Rep Power: 8 ![]() ![]() ![]() | Re: Using Powershell to set static passwords I believe that method requires a secure string for the password. As long as you know the risks of hardcoding passwords, this might get you around using Read-Host #create the plain text password string $s="IAmASecureString" #create a securestring object $pwd=new-object system.security.securestring #add the plain text string to the secure string $s.toCharArray() | foreach {$pwd.AppendChar($_)} |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Static Events Used By Static Classes | Mike | .NET General | 7 | 03-05-2008 01:42 PM |
| how to call a static method in a .net class from powershell? | YY | PowerShell | 1 | 09-11-2007 12:51 AM |
| Access a static member on a nested static class. | matthew.ashton@gmail.com | PowerShell | 3 | 02-28-2007 08:43 AM |
| Access a static member on a nested static class. | matthew.ashton@gmail.com | PowerShell | 0 | 02-28-2007 04:27 AM |
| NTLM Passwords Linux NAS passwords | SteveK | Vista networking & sharing | 5 | 02-02-2007 12:14 PM |