This does not appear to be by design. You can work around these things by
shelling out, particularly with the powershell resource or net * commands,
but obviously that’s not desirable.
I’ve filed the tickets below so we can get these evaluated for fixes:
Windows user resource sets actual full name to value of comment field
Windows user resource does not set key properties of a user
Kapil, let me know if you’d like more information on workarounds.
From: firstname.lastname@example.org [mailto:email@example.com]
Sent: Wednesday, January 8, 2014 6:54 AM
Subject: [chef] Chef User resource on Windows platform
I have been testing user creation on windows platform (Server 2012 R2)
using Chef’s User resource and have some questions about it.
The attribute “comment” sets the “Full name” user field whereas I was
expecting it to set the “Description” field of the windows user object.
Not sure if it is by design or a bug.
Moreover, a user is created with “Password never expires” field checked by
default. There are other check boxes like "User cannot change password"
and “Account is disabled” etc. Is there a way to check/uncheck these
options using Chef’s User resource?