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

local groups

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


 

local groups

I have a list of local users and I have text file that matches the local
users with new passwords

I would like to write a script that match the local user and then reset to
the new password

the text sample is jdoe,password

Please let me know if that correct as well

Thanks in advance

My System SpecsSystem Spec
Old 06-08-2007   #2 (permalink)
Brandon Shell
Guest


 

Re: local groups

Here is the function to set password


"frank" <frank@discussions.microsoft.com> wrote in message
news:349906CA-F949-4EA2-89A1-6D329CE74472@microsoft.com...
>I have a list of local users and I have text file that matches the local
> users with new passwords
>
> I would like to write a script that match the local user and then reset to
> the new password
>
> the text sample is jdoe,password
>
> Please let me know if that correct as well
>
> Thanks in advance


My System SpecsSystem Spec
Old 06-08-2007   #3 (permalink)
Brandon Shell
Guest


 

Re: local groups

This is real post... Im on the bus and we hit a bump... and off the post
went.
----------------------------------------------------------------------------

Here is a function to Reset local user password on Remote Machine

function Reset-UserPassword{
# From: Brandon Shell
# Purpose: To Reset User Password on Hosts Local SAM
# Example:
# --
# PS> Reset-UserPassword -user Jsmith -password H!Th3r3 -server
myserver1
#################################################################
Param([string]$user,[string]$password,[string]$server)
If(!($server)){$server = get-content env:COMPUTERNAME}
$tUser = [ADSI]("WinNT://$server/$user,User")
$tUser.SetPassword($password)
}

You can then do something like. I havent tested this as I am on the bus.

$csv = get-content $UserCSVFile
foreach($srv in $servers)
{
foreach($entry in $csv)
{
$usr = $entry.Split(",")[0]
$pwd = $entry.Split(",")[1]
Reset-UserPassword -user $usr -password $pwd -server $srv
}
}

"frank" <frank@discussions.microsoft.com> wrote in message
news:349906CA-F949-4EA2-89A1-6D329CE74472@microsoft.com...
>I have a list of local users and I have text file that matches the local
> users with new passwords
>
> I would like to write a script that match the local user and then reset to
> the new password
>
> the text sample is jdoe,password
>
> Please let me know if that correct as well
>
> Thanks in advance


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add local machine users to local admin group via GPO Andrew .NET General 0 06-10-2008 10:43 PM
AD Domain Local Groups and Vista James A. Buker Vista account administration 3 12-11-2007 07:25 PM
Local Users and Groups UnknownTBeast Vista General 3 11-11-2007 06:32 PM
Can NOT find "Local users and groups" in Control Panel -> Management Tools -> Computer Management! dave Vista General 3 06-30-2007 09:08 AM
Two Ethernet Cards, local shows as limited instead of as local Deathwing00 Vista networking & sharing 10 06-15-2007 09:05 AM


Update your Vista Drivers Update Your Drivers Now!!

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