Discussion Locked

Error changing password in NT Server

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

4 replies

by p.j.hutchison

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).

This discussion is closed to new replies.