Page 1 of 1 1
Topic Options
#72628 - 2003-01-15 10:44 AM Local Admin password
Xine Offline
Lurker

Registered: 2002-07-03
Posts: 3
Loc: Strasbourg
Hi,

I search a script who can help me to modify the local Admin password on all our workstations. If someone can help me,....

Thanks to all

Top
#72629 - 2003-01-15 11:40 AM Re: Local Admin password
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
This is what I use for our server admin password changes. You'd need to populate the $Servers array with the names of the machines on which you want to change the password. NB You can't change the local admin password on any NT4.0 domain controllers (and though I can't test/prove it, I suspect not on W2k DCs either).

code:
$x = SetOption("wrapateol","on")
? "Please enter the new local administrator password for the domain servers..."
? Gets $pword

Cls

? "Confirm that you wish to change the administrator password on these servers..." ?

$Servers = "Server1","Server2","Server3"


For Each $Server In $Servers

? Ucase($Server) + " Change password? (y/n)" Get $x
If Ucase($x) = "Y"
$ADsUser = GetObject("WinNT://corpdom01/" + $Server + "/administrator,user")
If @ERROR = 0
? "ADSI object created OK on " + $Server + "."
Else
? "Error creating local administrator object on " + $Server + "."
Endif
$ADsUser.SetPassword($pword)
If @ERROR = 0
? "Local administrator password set on " + $Server + "."
Else
? "Error whilst setting new local administrator password on " + $Server + "."
Endif
?
$ADsUser = 0
Endif

Next

:end
Exit

You'll also need to have the ADSI runtime files installed on the machine from which you will run this script.

Hope this helps a little.

-Breaker

[ 15. January 2003, 11:41: Message edited by: Breaker ]
_________________________
================================================
Breaker


Top
#72630 - 2003-01-16 12:58 AM Re: Local Admin password
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You can also use my RenameAdmin.exe ( http://mywebpages.comcast.net/habullock/Perlutilities.htm ) or Win32ADmin.DLL ( http://mywebpages.comcast.net/habullock/kix_solutions.htm ) to code this task.

You can wrap RenameAdmin.exe in a CMD file using "FOR /F" to process a list of computers.

You can use Win32Admin.DLL to lookup the builtin Administrator account if you support OS's of different languages where the administrator account name has been localized.

Not sure why Breaker said that you could not change the password for the Administrator account on the domain. It is just another account as long as the target computer is the PDC.

[ 15. January 2003, 13:01: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#72631 - 2003-01-16 03:38 PM Re: Local Admin password
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
AFAIK, there's no local admin account on a NT4 domain controller, just the domain administrator account. This, it's technically correct to say that you cannot change the local admin password. I know, it's like splitting hairs [Wink]
_________________________
There are two types of vessels, submarines and targets.

Top
#72632 - 2003-01-16 03:52 PM Re: Local Admin password
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Jens is right. The important point is really that there is no local administrator account on a BDC. In its place is the domain administrator account, which resides on the PDC, and generally we don't treat that in the same way as the local admin accounts on member servers.
_________________________
================================================
Breaker


Top
#72633 - 2003-03-06 02:57 PM Re: Local Admin password
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

It looks like the same question as topic F1-6799.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#72634 - 2003-03-06 07:49 PM Re: Local Admin password
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
As long as we are splitting hairs... Yes NT 4.0 Domain Controllers do have a local Administrator account and password, it just so happens to be the same account that the BDCs use as well because on NT 4.0 Domains the PDC is the only controller that maintains an authoritave SAM.

Any password changes are actually passed onto the PDC, the BDC has a copy of that file.

It can be modified just like any other account.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 988 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org