1
This is the suggested way to add a logon script to a local user in Windows. http://technet.microsoft.com/en-us/library/cc770908.aspx
Edited:
I also found the following : http://technet.microsoft.com/en-us/library/cc771314.aspx
Is it possible to add a logon script to a user through Local Users and Groups tab in Computer Management using powershell?
Update :
I am able to copy the script file to the location -\%COMPUTERNAME%\C$\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup' and it runs successfully. But in the local user properties I am not able to set the value of the attribute 'Logon script' to the desired value.
The duplicate question that this one was closed against no longer exists. There is NO duplicate. – Tog – 2013-12-16T14:44:31.127
Just to clarify, you're wanting to assign a script using PowerShell, vs the local group policy editor? As in, the script will assign the startup script? – Tanner Faulkner – 2013-12-16T15:59:14.343
Actually I want to do the script assignment through powershell script and not manually through local group policy editor. Is there a way to do that? – cmm user – 2013-12-17T05:38:12.433