Is it possible to use PowerShell to change local user settings on Windows XP (without Active Directory), specifically the settings on the user properties tab - such as "Password never expires" and groups that the user is a member of?
Samples would be great, but a pointer to the relevant documentation would be great too - I'm not even sure what to look for.
The simplest way is to direct ADSI queries to the local WinNT provider - that will return local objects on the system you are interested in. These can be local or remote systems but this will attach to the local account and security objects rather than the AD.
With that you can then query and modify properties of the $user object.
To set the "Password Doesn't expire" Flag you need to set the relevant flag in the UserFlags attribute. You can find a useful table of these at Motobit here.
To forcibly set Joe's account password from the above example to never expire:
Modifying group memberships is a bit more involved but Microsoft's PowerShell Guy has a step by step walk though for adding Domain User accounts to a Local Group on a system which I think is exactly what you need.
heres a way to turn off Password Never expires by connecting to each machine..
http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/3836/afv/topic/Default.aspx
PS version 2.0
Great reference - http://learningpcs.blogspot.com/2011/01/powershell-winnt-provider.html
I'm not sure how to do exactly what you asked, but the MS Getting Started documentation is here: http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/start.mspx
These did not work for me so after much searching and much trial and error I came up with this to remove
password never expires
from the local administrator account, based on SID, and local guest account, based on SID.