Page 1 of 1 1
Topic Options
#40124 - 2003-05-14 05:01 PM Change local admin pasword
Sluffer Offline
Fresh Scripter

Registered: 2003-05-08
Posts: 6
hi guys, I'm new here to the board but i'm following the topics a bit longer. I wonder if there's a possibility of changing the local administrator pasword on remote computers using a loginscript. I have created a script that does mappings, adjusts an ini file and writes data about software and userinfo to a file (tnx to several board members for usefull topics, etc). I would now like to add the changing feature also but i don't quite know how to do it.

Btw We have a NT-2K domain with about 400 users

Tnx
Sluffere

Top
#40125 - 2003-05-14 05:06 PM Re: Change local admin pasword
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Changing the administrator password will require administrative privileges to begin with. Why not change all local administrative passwords from a central location with a script running under domain administrative provileges?
_________________________
There are two types of vessels, submarines and targets.

Top
#40126 - 2003-05-15 03:38 PM Re: Change local admin pasword
Sluffer Offline
Fresh Scripter

Registered: 2003-05-08
Posts: 6
If that should work, no problem. For me it's the same, if i can change it by using the loginscript, ok. I i would need domain privileges to run a separate script, also no prob because i am domain admin. Now the only problem for me is that i don't quite know how to start with such a script that changes the local admin pw.

Sluffer

Top
#40127 - 2003-05-15 03:42 PM Re: Change local admin pasword
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
For starters, you could search the KiXtart BBS as this has already been discussed numerous times.
Secondly, a
code:
shell '%COMSPEC% /C net user Administrator newpassword'

would suffice.
_________________________
There are two types of vessels, submarines and targets.

Top
#40128 - 2003-05-15 03:46 PM Re: Change local admin pasword
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
check out renameadmin.exe at:
http://mywebpages.comcast.net/habullock/Perlutilities.htm

it can also rename the account name but you can simply use it to set the password too.
_________________________
!

download KiXnet

Top
#40129 - 2003-05-15 03:49 PM Re: Change local admin pasword
Sluffer Offline
Fresh Scripter

Registered: 2003-05-08
Posts: 6
Ok tnx, I've searched te board yesterday but i didn't find anything relevant. tnx for the code i will try with that and look if i can make something out of it

Sluffer

Top
#40130 - 2003-05-15 03:57 PM Re: Change local admin pasword
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Searching the board for 'change administrator password' give me 43 hits!
_________________________
There are two types of vessels, submarines and targets.

Top
#40131 - 2003-05-15 04:28 PM Re: Change local admin pasword
Sluffer Offline
Fresh Scripter

Registered: 2003-05-08
Posts: 6
Had problems with the site yesterday. Tried a search half an hour ago and also found alot of hits [Smile]
Top
#40132 - 2003-05-15 06:12 PM Re: Change local admin pasword
JimRobinson Offline
Fresh Scripter

Registered: 2003-01-10
Posts: 42
Loc: Tempe, AZ
quote:
shell '%COMSPEC% /C net user Administrator newpassword'
Correct me if I'm wrong - a fairly normal state - but the above would need to be run on the remote machine, which brings up a whole new set of questions.

cusrmgr.exe, which I think is in the Win2k Resource Kit, will do the task remotely: (the qoute tag mangles the formatting, hence the CODE tags)
code:
C:\>cusrmgr
CUsrMgr Ver 1.0 Jan98 by G.Zanzen (c) MCS Central Europe
Sets a random password to a user
usage: -u UserName [-m \\MachineName] \\ default LocalMachine
Resetting Password Function
-p Set to a random password
-P xxx Sets password to xxx
User Functions
-r xxx Renames user to xxx
-d xxx deletes user xxx
Group Functions
-rlg xxx yyy Renames local group xxx to yyy
-rgg xxx yyy Renames global group xxx to yyy
-alg xxx Add user (-u UserName) to local group xxx
-agg xxx Add user (-u UserName) to global group xxx
-dlg xxx deletes user (-u UserName) from local group xxx
-dgg xxx deletes user (-u UserName) from global group xxx
SetProperties Functions
-c xxx sets Comment to xxx
-f xxx sets Full Name to xxx
-U xxx sets UserProfile to xxx
-n xxx sets LogonScript to xxx
-h xxx sets HomeDir to xxx

-H x sets HomeDirDrive to x

+s xxxx sets property xxxx
-s xxxx resets property xxxx
where xxxx can be any of the following properties:
MustChangePassword
CanNotChangePassword
PasswordNeverExpires
AccountDisabled
AccountLockout
RASUser
returns 0 on success

I have used this in the past to rename and reset local admin passwords.
_________________________
Jim
--------------------

Top
#40133 - 2003-05-15 07:10 PM Re: Change local admin pasword
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You specified that it be run as a login script. Thus, I assumed that whoever runs the loginscript on a computer that then that particular computer's administrative password be changed.

Otherwise, please provide a more detailed description of the problem.
_________________________
There are two types of vessels, submarines and targets.

Top
#40134 - 2003-05-15 07:19 PM Re: Change local admin pasword
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Uh oh..

Wouldn't you want to encrypt the Administrator password if it is being used for a login script?

Otherwise, you open a security hole.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#40135 - 2003-05-16 09:35 AM Re: Change local admin pasword
Sluffer Offline
Fresh Scripter

Registered: 2003-05-08
Posts: 6
It would be convenient if i could do it using the login script because then i know for sure it's executed and that the pasword is changed (also much quicker than doing is by yourself). If it's to difficult to change the pasword using the script then a standalone script is the next best option i guess. A thougth for that script would be: scanning the domain for logged in computers, changing the local admin pasword and write into a log where i can see on what pc it's changed.

Sluffer

Top
#40136 - 2003-05-16 09:41 AM Re: Change local admin pasword
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
best thing is standalone admin script, always.
but making them do everything is too hard and that's why logonscripts are there [Wink]

for this particular task you have been provided with a tool to do that...
haven't tried the renameadmin.exe but sure it will give you option to log it.

with netview() udf (find 2 of them at http://www.gwspikval.com/jooel/UDF ) you get the computernames in nice list...

there couldn't be anything simpler:
code:
for each $computer in netview()
? $computer
shell "renameadmin.exe ... $computer ... >> file.log"
next

_________________________
!

download KiXnet

Top
#40137 - 2003-05-16 10:10 AM Re: Change local admin pasword
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
I actually use Howard's renameadmin tool on our systems. Works quite well.
Top
#40138 - 2003-05-16 11:17 AM Re: Change local admin pasword
Sluffer Offline
Fresh Scripter

Registered: 2003-05-08
Posts: 6
Ok, tnx a lot, i will try it this afternoon, i'll let you know

Sluffer

Top
Page 1 of 1 1


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

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.069 seconds in which 0.031 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