Jump to content
Sign in to follow this  

I got a error message, would you help me?

Recommended Posts

I Add a user, and I want set the user's property


$UserName = 'Fred'

$Password = '1234'

$strComputer = @ComputerName



$objName = "WinNT://" & @ComputerName & "/" & $UserName

$objUser = ObjGet($objName)

$objUserFlags = ObjGet($objUser & ".userFlags")

$objPasswordExpirationFlag = $objUserFlags Or $ADS_UF_DONT_EXPIRE_PASSWD Or $ADS_UF_PASSWD_CANT_CHANGE

$objUser.Put ("userFlags", $objPasswordExpirationFlag )


ERROR Message:

D:\My Documents\AutoIt\AddUser.au3 (25) : ==> The requested action with this object has failed.:

$objUser.Put ("userFlags", $objPasswordExpirationFlag )

$objUser.Put ("userFlags", $objPasswordExpirationFlag )^ ERROR

->15:05:08 AutoIT3.exe ended.rc:1

Is anybody known the reason?

Sorry for bay english.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...