Page 1 of 2 12>
Topic Options
#137043 - 2005-04-04 10:50 AM change local admin password
mstcool Offline
Fresh Scripter

Registered: 2005-03-31
Posts: 5
hi
i'd like to change local admin password to all pc connected
i created an exe file. when i try it manually it works, but when i put in a kix script it doesn't work.

help me

mstcool from france

Top
#137044 - 2005-04-04 12:55 PM Re: change local admin password
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
MSTCOOL

What rights do users have running the script??? Must be admin.
How did you create the .exe?

Other solution:
Search the board for renameadmin.exe (http://home.comcast.net/~habullock/Library/RenameAdmin.exe). It's a tool created by Howard which you can use to reset the admin password from your workstation.
You could create a .txt or a .ini with all the computer names. Use this file as input etc. etc.
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#137045 - 2005-04-04 02:24 PM Re: change local admin password
mstcool Offline
Fresh Scripter

Registered: 2005-03-31
Posts: 5
Patrick Rutten

in my .exe there is the function : net user administrator + password

i m a domain admin so i ve all right.

how can i integrated this .exe to a kix script ?

ps: tks for the RenameAdmin.exe

mstcool

Top
#137046 - 2005-04-04 03:00 PM Re: change local admin password
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I use Howard's utility in a central admin script that runs every two hours as a scheduled task.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#137047 - 2005-04-05 01:13 AM Re: change local admin password
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You can use RUN or SHELL to call the executable from within KiXtart.
_________________________
There are two types of vessels, submarines and targets.

Top
#137048 - 2005-04-05 05:13 AM Re: change local admin password
kobeye Offline
Lurker

Registered: 2005-01-20
Posts: 1
shell "command"to run the exe file,but the best way is use GP to change admin password,you can create the batch in every computer when the logon in domain
Top
#137049 - 2005-04-05 07:32 AM Re: change local admin password
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Running it via a GPO is not secure either. Users have rights to read that script as well and see what you're doing.

Only some type of encrypted method is considered reasonably safe. Remote scripts or Scheduled Tasks are an acceptable risk to many Admins depending on the situation involved.

Top
#137050 - 2005-05-18 02:17 AM Re: change local admin password
heroik Offline
Fresh Scripter

Registered: 2005-02-03
Posts: 13
Les, I am actually using your local admin password changing script. The script works great. I am tyring to run this script from a server with domain admin rights to change local admin passwords for workstations and exclude servers. Aside from using the exclude list (which I would primarily use to exclude specific workstations), is there an easy way to do this? There may be some servers that I forget to include in the list. I've tried using @PRODUCTTYPE, but it only reads the registry from the server I am running the script from.
Top
#137051 - 2005-05-18 02:56 AM Re: change local admin password
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Basically, you should be able to read the same info that the macro gets out of the registry remotely. Since upgrading to AD, I no longer use NetView b ut rather just pull from AD using ADODB. There are lots of examples of it on the board.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#137052 - 2005-05-18 07:10 PM Re: change local admin password
heroik Offline
Fresh Scripter

Registered: 2005-02-03
Posts: 13
You're right. I found it. Jens had a posting for OSID(). I tried to do the same thing, but for unknown reasons it didn't work. I'll have to try working off his UDF to see what I did wrong.
Top
#137053 - 2005-05-18 07:27 PM Re: change local admin password
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Maybe something smaller like this.

Code:
Break On
$sComputer='computername'
$sComputer = '\\'+Join(Split($sComputer,'\'),'',3)+'\'
$Server = ReadValue($sComputer+'HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions','ProductType')
If $Server <> "WinNT" ; System is not a Workstation so assume it is a Server
? 'System is a Server ' + $Server
Else
? 'System is a workstation ' + $Server
EndIf


 

 

Top
#137054 - 2005-05-18 11:23 PM Re: change local admin password
heroik Offline
Fresh Scripter

Registered: 2005-02-03
Posts: 13
I have something similar working right now...

Code:

for each $computer in netview2($domain,1)
$comp = split($computer,',')[0]
$tcomp = '\\' + $comp + '\'
$RegValue = ReadValue($tcomp + 'HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions','ProductType')
if $RegValue = 'WinNT'
...
endif
next



I guess you've already eliminated my two lines with your one line of code. I just want run this on WinNT/2K/XPPro.

Top
#137055 - 2005-05-19 01:16 AM Re: change local admin password
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
This line of code (originally formulated by Radimus) would work better in the long run as well. It will take and strip out the \\ or \ if supplied and add them if they're not supplied

'\\COMP1\' or 'COMP1' or '\COMP1\' or 'COMP\' are all handled correctly as '\\COMP1\' for the final value.

$sComputer = '\\'+Join(Split($sComputer,'\'),'',3)+'\'

Top
#137056 - 2005-05-21 11:08 AM Re: change local admin password
ChristopheM Offline
Hey THIS is FUN
*****

Registered: 2002-05-13
Posts: 309
Loc: STRASBOURG, France
Code:
function SetPassword( $userID, $password, optional $computer )
dim $objUser

if not $computer $computer = "." endif

$objUser = GetObject("WinNT://" + $computer + "/" + $userID + ",user")
if @error exit 1 endif

;-- Set the password for the account --
$objUser.SetPassword( $Password )
$objUser.SetInfo()
If @error
exit 2
Else
exit 0
EndIf
endfunction

if you don't have the RenameUser tool, you could try this function.
_________________________
Christophe

Top
#137057 - 2005-05-21 10:18 PM Re: change local admin password
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
I just noticed that Heroik hijacked this thread from mstcool. Sorry abou that.

mstcool are you all set now with any of these solutions?

Heroik in the future, please do not hijack someone else's topic. Please create your own post and ask your question. You can post a link to another thread that you think pertains to your issue, but it's not appropriate to take over another posting.
 

Top
#137058 - 2005-06-11 12:30 AM Re: change local admin password
heroik Offline
Fresh Scripter

Registered: 2005-02-03
Posts: 13
Sorry about the hijack. I thought it followed the subject of the thread, but I guess that doesn't matter, I should've posted a new thread. Thank you for the help.
Top
#137059 - 2005-06-16 11:54 AM Re: change local admin password
mstcool Offline
Fresh Scripter

Registered: 2005-03-31
Posts: 5
i don't try it yet.
i ll do it this week

thanks for your post
bye
mstcool from france

Top
#137060 - 2005-08-08 10:30 AM Re: change local admin password
Zakonski Offline
Fresh Scripter

Registered: 2005-08-05
Posts: 5
Quote:

Code:
function SetPassword( $userID, $password, optional $computer )
dim $objUser

if not $computer $computer = "." endif

$objUser = GetObject("WinNT://" + $computer + "/" + $userID + ",user")
if [b]@error[/b] exit 1 endif

;-- Set the password for the account --
$objUser.SetPassword( $Password )
$objUser.SetInfo()
If [b]@error[/b]
exit 2
Else
exit 0
EndIf
endfunction

if you don't have the RenameUser tool, you could try this function.




I've saved the code to SetPassword.kix, now if I want to change the password, will this work??

====reset.kix=====
Code:

Call 'D:\KIX\UDF\SetPassword.kix'

SetPassword('admin','test','computer')


Top
#137061 - 2005-08-08 02:47 PM Re: change local admin password
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You obviously missed the post above where DOC said "please do not hijack someone else's topic". :@
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#137062 - 2005-08-08 03:42 PM Re: change local admin password
Zakonski Offline
Fresh Scripter

Registered: 2005-08-05
Posts: 5
I'm sorry, I'll check out If there's allready another topic about my problem!
Top
Page 1 of 2 12>


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

Who's Online
0 registered and 980 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.082 seconds in which 0.051 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