Re: Local Admin Password Change Scripting



Glad it worked for you.

Keep in mind that objUser.SetPassword can break access to DPAPI
protected secrets in XP and later, such as if the account has used EFS
or has been made EFS recovery agent in standalone situation.

<sjparry@xxxxxxxxxxx> wrote in message
news:1149677646.280232.289880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
All done, thought I'd share the finished script for you to say thanks.
I've changed some labels to make sense to me.
It now looks up the computer name and changes the password accordingly.


Set WshComp = WScript.CreateObject("WScript.Network")
sComp = WshComp.ComputerName
sText10 = "abcdefghij"
sDynaPass = Mid(Left(sComp,InStrRev(sComp,"-")-1),InStr(sComp,"-")+1)
For iTmp = 0 to 9
sDynaPass = Replace(sDynaPass, CStr(iTmp), Mid(sText10,iTmp+1,1))
Next

sNewPass = "Password" & sDynaPass
Set usr = GetObject("WinNT://"& WshComp.ComputerName
&"/Administrator,user")
usr.SetPassword sNewPass
wscript.echo "Computer Name = " & WshComp.ComputerName & vbCrLf _
& "New Password = " & sNewPass & vbCrLf _



sjparry@xxxxxxxxxxx wrote:
Headstart completed!

Thanks, I've amended to use a computer object also...
appears to work, thanks again!


Set WshComp = WScript.CreateObject("WScript.Network")

sComp = WshComp.ComputerName ' from running context
sText10 = "alphabetab" ' from user input, force to 10 char

sBlob = Mid(Left(sComp,InStrRev(sComp,"-")-1),InStr(sComp,"-")+1)
For iTmp = 0 to 9
sBlob = Replace(sBlob, CStr(iTmp), Mid(sText10,iTmp+1,1))
Next



sjparry@xxxxxxxxxxx wrote:
Wonderful, that gives me a flying headstart - thanks very much!

I'm not so hot on the VB, but I'm sure I can get a computername lookup
working myself... unless you'd like to help again? ;)

Thanks again.

Roger Abell [MVP] wrote:
' vbscript snippet with transform outlined
' save as xxx.vbs and at cmd run
sComp = "computer-001254-pc" ' from running context
sText10 = "alphabetab" ' from user input, force to 10 char
' note: the above actually from dynamic acquisition

sBlob = Mid(Left(sComp,InStrRev(sComp,"-")-1),InStr(sComp,"-")+1)
For iTmp = 0 to 9
sBlob = Replace(sBlob, CStr(iTmp), Mid(sText10,iTmp+1,1))
Next

wscript.echo "password" & sBlob
' now get group obj for Administrators and loop over
' user members applying variations for new passwords


<sjparry@xxxxxxxxxxx> wrote in message
news:1149613064.991847.196310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Can anyone help me with creating a script to change local
administrator
passwords using a lookup file?

The basic idea that I would like to achieve is to have a lookup
word 10
characters long (eg. alphabetab, a=0,l=1,p=2,h=3,etc.)
Then, the script would take the machine name computer-001254-pc,
take
the numerical section and apply the characters from the lookup word
to
create the new password. (eg new password = passwordaalpba)

Preferably a dos script I'd find easier, but java would be good
also.

I'm currently trying using FOR /F commands after outputting the
%computername% variable.

Help would be much appreciated.

Thanks.




.



Relevant Pages

  • Re: Local Admin Password Change Scripting
    ... For iTmp = 0 to 9 ... wscript.echo "password" & sBlob ... The basic idea that I would like to achieve is to have a lookup word 10 ... Preferably a dos script I'd find easier, but java would be good also. ...
    (microsoft.public.security)
  • Re: Local Admin Password Change Scripting
    ... I'm not so hot on the VB, but I'm sure I can get a computername lookup ... The basic idea that I would like to achieve is to have a lookup word 10 ... Preferably a dos script I'd find easier, but java would be good also. ...
    (microsoft.public.security)