Globally changing the Local Admin Password on Windows 2000

X

Xpdite

Hi
we are currently running approximately 4000 Windows 2000 desktops all
with the same local admin password. It is about time for us to change
this password. Is there a way to automate this change?

All of the machines are logging into a Novell network and are
receiving group policies from Zenworks. We do not have Active
Directory in or environment. I have looked at the policy and there is
an option to change the Administrator account name (Which we have
done) but I do not see any options for changing the password.

Any suggestion? The machines are all over the country and it would be
a real pain to have to manually change each one.

Thanks
 
J

John John

You might want to ask about that in Novell user groups. You may be able
to use the Windows 2000 Resource Kit's cusrmgr.exe to do it.

John
 
N

Newbie Coder

Xpdite,

Use a script:

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

Dim objDomain
Dim objComputer
Set objDomain = GetObject("WinNT://" & objArgs(0))
objDomain.Filter = Array("computer")

If objFSO.FileExists(objArgs(0) & ".txt") = True Then
objFSO.DeleteFile(objArgs(0) & ".txt")
End If
Set txtOutput = objFSO.CreateTextFile (objArgs(0))

On Error Resume Next

For Each objComputer In objDomain
strComputer = objComputer.Name
txtOutput.Writeline objArgs(0) & "\" & strComputer
Next

WScript.Echo "All Done"

-------
Usage:
-------

ScriptName.vbs DomainName

-------------------------------

Change Admin Password:
--------------------------

On Error Resume Next

Const FOR_READING = 1
strFile = "computers.txt" ' Change the name here

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFile) Then
Set objTextStream = objFSO.OpenTextFile(strFile, FOR_READING)
Else
WScript.Echo "Computer List '" & strFile & "' not found."
WScript.Quit
End If

Do Until objTextStream.AtEndOfStream
strComputer = objTextStream.ReadLine
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user")

objUser.SetPassword "09iuy%4e" ' Set your password here
objUser.SetInfo
Loop
objTextStream.Close

Remember to change the 'computers.txt' & the password you want to before you
run the script

This will then change all local admin passwords for all machines on the
network
 
X

Xpdite

Xpdite,

Use a script:

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

Dim objDomain
Dim objComputer
Set objDomain = GetObject("WinNT://" & objArgs(0))
objDomain.Filter = Array("computer")

If objFSO.FileExists(objArgs(0) & ".txt") = True Then
objFSO.DeleteFile(objArgs(0) & ".txt")
End If
Set txtOutput = objFSO.CreateTextFile (objArgs(0))

On Error Resume Next

For Each objComputer In objDomain
strComputer = objComputer.Name
txtOutput.Writeline objArgs(0) & "\" & strComputer
Next

WScript.Echo "All Done"

-------
Usage:
-------

ScriptName.vbs DomainName

-------------------------------

Change Admin Password:
--------------------------

On Error Resume Next

Const FOR_READING = 1
strFile = "computers.txt" ' Change the name here

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFile) Then
Set objTextStream = objFSO.OpenTextFile(strFile, FOR_READING)
Else
WScript.Echo "Computer List '" & strFile & "' not found."
WScript.Quit
End If

Do Until objTextStream.AtEndOfStream
strComputer = objTextStream.ReadLine
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user")

objUser.SetPassword "09iuy%4e" ' Set your password here
objUser.SetInfo
Loop
objTextStream.Close

Remember to change the 'computers.txt' & the password you want to before you
run the script

This will then change all local admin passwords for all machines on the
network

--
Newbie Coder
(It's just a name)









- Show quoted text -

That is quite the script. Unfortunately I no nothing about
scripting. I believe that I need to no all of the computers names and
have them in the computer.txt in order for this to work. This also
could be a problem.

I was hoping that there would be something in the policies to be able
to do this as you are given the option to rename the local admin
account but I guess not. My issue is that we have had the same local
Admin password for so long that to many people no it and not being in
a domain makes thing more difficult.
 
N

Newbie Coder

XPdite,

The first script will get the names of all machines on the network

Then make sure you change the name of the text file in the second script to
reflect the same of the text file created with the first. Then just run the
second script which will change the local admin password on all machines
listed in the text file

To create the script paste the code in a notepad file
File menu | Save As
Type the name surrounded by double-quotes:
Example: "List.vbs"
Change the File Types to ALL FILES & click SAVE

At the command line call the script passing the domain name:

C:\>list.vbs MyDomain

That will then create a machine list

Create another VBS file (in notepad (see above)) & place the text file in
the same directory as the change local admin password sctipt & run. It will
go through the text doc one by one connecting to that machine... When its
finished it will quit.

What you can do is create a text file with a few names in:

Example:

NetworkedMachineName1
NetworkedMachineName2

and run it just for that as a test - easy

I hope this helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top