Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

text file

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-13-2007   #1 (permalink)
frank
Guest


 

text file

I have a text file with a list of user names and password is there a way to
pass this information to a script


The text is call user.txt and the script is users.ps1


thanks

My System SpecsSystem Spec
Old 03-13-2007   #2 (permalink)
George Davis
Guest


 

RE: text file

If the user names and passwords are unencrypted and seperated on each line
with a comma, the following should work. It assumes that users.ps1 is in the
same folder:

$users = Get-Content c:\user.txt

foreach($user in $users)
{
$oneLine = $user.Split(",")
$userName = $oneLine[0]
$password = $oneLine[1]
.\users.ps1 $userName $password
}

Hope this helps,
George

"frank" wrote:

> I have a text file with a list of user names and password is there a way to
> pass this information to a script
>
>
> The text is call user.txt and the script is users.ps1
>
>
> thanks

My System SpecsSystem Spec
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto: Add lines of text from a specific point in a text file.. Daz VB Script 13 06-24-2008 10:55 AM
How do I read a text file and sort text by fixed positions? Cornelius PowerShell 5 07-20-2007 06:34 PM
5536 rar file - 2.58 gb downloaded only 14kb text file inside =?Utf-8?B?UXVpY2tDaGVlc2U=?= Vista General 9 09-02-2006 05:57 AM
5536 *.rar 2.58gb file turned into 14kb text file. =?Utf-8?B?UXVpY2tDaGVlc2U=?= Vista General 5 08-30-2006 07:23 PM
5536 *.rar file - 2.58gb's but only a 14kb text file inside =?Utf-8?B?UXVpY2tDaGVlc2U=?= Vista General 0 08-30-2006 05:32 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51