Welcome to ServerForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Set local admin password

 
   Windows Server (Home) -> Windows Server Scripting RSS
Next:  Adding provider  
Author Message
Mike

External


Since: Mar 20, 2006
Posts: 56



(Msg. 1) Posted: Wed Jun 14, 2006 12:35 pm
Post subject: Set local admin password
Archived from groups: microsoft>public>windows>server>scripting (more info?)

I would like to change all XP local admins password to the same on the
network. I have a list of computers in a text file that I would like to
point to and then return to a file if it was successful or not.

Anyone have any ideas?

Mike

 >> Stay informed about: Set local admin password 
Back to top
Login to vote
J Ford

External


Since: Jan 12, 2005
Posts: 54



(Msg. 2) Posted: Fri Jun 16, 2006 10:41 am
Post subject: RE: Set local admin password [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

this script will work, just modify it to loop through a text file and add
error handling to track successes and changes.

<script>
On Error Resume Next

Dim oWshNet, sComputerName, sLocalAdmin

' get computer name for local computer
Set oWshNet = CreateObject("WScript.Network")
sComputerName = oWshNet.ComputerName

' Get Local Administrator Name
sLocalAdmin = GetAdministratorName(sComputerName)

' Call sub
ChPW

Sub ChPW()

' connect to user object
Set oUser = GetObject("WinNT://" & sComputerName & "/" _
& sLocalAdmin & ",user")

' Change PW
oUser.SetPassword sNewPassword
oUser.SetInfo

End Sub

Function GetAdministratorName(sComputerName)
Dim sUserSID, oWshNetwork, oUserAccount

Set oUserAccounts = GetObject( _
"winmgmts:{impersonationLevel=impersonate}!//" _
& sComputerName & "/root/cimv2").ExecQuery( _
"Select Name, SID from Win32_UserAccount WHERE Domain = '" _
& sComputerName & "'")

On Error Resume Next
For Each oUserAccount In oUserAccounts
If Left(oUserAccount.SID, 9) = "S-1-5-21-" And _
Right(oUserAccount.SID, 4) = "-500" Then
GetAdministratorName = oUserAccount.Name
Exit For
End if
Next
End Function
</script>

"Mike" wrote:

> I would like to change all XP local admins password to the same on the
> network. I have a list of computers in a text file that I would like to
> point to and then return to a file if it was successful or not.
>
> Anyone have any ideas?
>
> Mike

 >> Stay informed about: Set local admin password 
Back to top
Login to vote
AndyK

External


Since: Sep 28, 2006
Posts: 4



(Msg. 3) Posted: Thu Sep 28, 2006 3:41 pm
Post subject: RE: Set local admin password [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You can use a utility call CUSRMGR. It will do the trick.
It took me awhile to find the file, and I have recently acquired it. It
comes with the 2000 resource kit. If you cannot locate it, let me know and
I'll email it to you.

Andy

"Mike" wrote:

> I would like to change all XP local admins password to the same on the
> network. I have a list of computers in a text file that I would like to
> point to and then return to a file if it was successful or not.
>
> Anyone have any ideas?
>
> Mike
 >> Stay informed about: Set local admin password 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
changing local account passwords in ASP - Hello! I am trying to create a script to run in an ASP page that will allow a user to change a password for identical LOCAL accounts on two servers. The code I am using I got from the Technet script example but it won't run in ASP. It is: Set objUse...

how to change password on a multiple stand alone servers nt4 - Hi; i want change password for one or multiple users on all servers nt4 (members servers, not à dc or pdc); how to ?; thank's

VBS to insert user from active directory to local group de.. - Please, How can I insert an user from active directory in a local group in a desktop using vbs.

Adding a Global group to a Local group through scripting - Any thougts how to script adding a global group to a local group? I would like to add a global group to a workstations local admin group. Thanks

List of Local/Domain grp members - Hi Experts, appr if you are able to help. I am in need of a tool that can help me to list all members in a grp. My servers are NT 4 & WIn2k. TQ
   Windows Server (Home) -> Windows Server Scripting All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]