Hi I am looking to set the logon script parameter for a user profile, using Powershell. I was planning to use WMIC USERACCOUNT to do this but found that it is not possible. As shown below the method does not exist in the method:
class Win32_UserAccount : Win32_Account
{
uint32 AccountType;
string Caption;
string Description;
boolean Disabled;
string Domain;
string FullName;
datetime InstallDate;
boolean LocalAccount;
boolean Lockout;
string Name;
boolean PasswordChangeable;
boolean PasswordExpires;
boolean PasswordRequired;
string SID;
uint8 SIDType;
string Status;
};
I would prefer to do this as a statement in powershell but if that is not possible it could be done as a script
I am looking to set the parameter shown in picture, for a Win Server 2008 R2

It took a long time but finally got the answer the trick was to use IADsTSUserEx. I also tried to use ADSI but could only get it to set a logon script for logging on localy. See other post. Here is the code plus for Elijiah how to set environment varibles of local users through the registry