General discussion
July 8, 2004 at 06:12 AM
arthurtan123

Error changing password in NT Server

by arthurtan123 . Updated 22 years, 4 months ago

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 discussion is locked

All Comments