Hi I'm tring to set a logon program parameter for remote clients that will be created using a powershell script. As shown below
I managed to get a logon script to set in the profile tab using
$objUser.PSBase.InvokeSet('LoginScript', "logoff.cmd")
As seed in this thread here
The problem is I can't find the attribes in ADSIedit also some attrribes that I use and work aren't shown in ADSIedit such as PasswordExpired
which leads me to believe the attribute does exsist. Below is my code
$objComputer = [ADSI]"WinNT://127.0.0.1"
$objUser = $objComputer.Create('user', $username)
$objUser.SetPassword($password)
$objUser.PSBase.InvokeSet('Description', "user " + $userName)
$objUser.PSBase.InvokeSet('userflags', 512)
$objUser.PSBase.InvokeSet('passwordExpired', 1)
$objUser.SetInfo();