General discussion

Locked

Error changing password in NT Server

By arthurtan123 ·
I have write a VBS to change user password in NT workstation. User name was import from text file.It was run fine in NT worstation .When I run it on NT server there was a error Nx80005000. Would appreciate someone can help . My vbs is as below :

Dim fsoIn
Dim inFile
Dim arrUserNames
Dim strUser
Dim objUser
Dim strComputer
Dim newPassword
Const ForReading = 1
Const inFilename = "user.txt"

newPassword = Inputbox ("enter new password")

strComputer = Inputbox (" enter Computer Name")

Set fsoIn = CreateObject("scripting.filesystemobject")

Set inFile = fsoIn.OpenTextFile(inFilename, ForReading, True)

inFile.Skipline

while Not inFile.AtEndofStream


arrUserNames = Split(inFile.Readline, vbTab, -1, 1)

strUser = arrUserNames(0)

Set objUser = GetObject("WinNT://" & strComputer & "/" & strUser)

objUser.SetPassword newPassword

objUser.Put "PasswordExpired", CLng(1)

objUser.SetInfo


Wend

wscript.echo ("Changing of Password Completed.")


inFile.close


Wscript.quit

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by shawn In reply to Error changing password ...

Are you sure you have the Windows Script Host installed on the server? On workstations, this is usually installed with Internet Explorer.

To download and install the Windows Script Host, use the following URL (remove any spaces):

http://www.microsoft.com/downloads/details.aspx?FamilyId=0A8A18F6-249C-4A72-BFCF-FC6AF26DC390&displaylang=en

Hope this helps.

Collapse -

by arthurtan123 In reply to

thanks for your help . IT work after I upgraded the explorer from ver5.5 to ver 6 with sp1.

Collapse -

by p.j.hutchison In reply to Error changing password ...

Check which version of WSH you have installed by typing CSCRIPT ? on the command line. You need at least version 5.6 (comes with IE 5.5).

Collapse -

by arthurtan123 In reply to Error changing password ...

This question was closed by the author

Back to Windows Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums