# Chef User resource on Windows platform

**URL:** <https://discourse.chef.io/t/chef-user-resource-on-windows-platform/4974>\
**Category:** Chef Infra (archive)\
**Created:** [January 8, 2014, 2:54pm UTC](https://discourse.chef.io/t/chef-user-resource-on-windows-platform/4974 "2014-01-08T14:54:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kapil\_Shardha](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@Kapil\_Shardha](https://discourse.chef.io/u/Kapil_Shardha)\
**Post date:** [January 8, 2014, 2:54pm UTC](https://discourse.chef.io/t/chef-user-resource-on-windows-platform/4974/1 "2014-01-08T14:54:15Z")

</div>

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?

Thanks

Kapil

---

<div class="post-metadata">

**Author:** ![Adam\_Edwards1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/adam_edwards1/32/27_2.png) [@Adam\_Edwards1](https://discourse.chef.io/u/Adam_Edwards1)\
**Post date:** [January 8, 2014, 5:18pm UTC](https://discourse.chef.io/t/chef-user-resource-on-windows-platform/4974/2 "2014-01-08T17:18:07Z")

</div>

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:

[https://tickets.opscode.com/browse/CHEF-4937](https://tickets.opscode.com/browse/CHEF-4937)  
Windows user resource sets actual full name to value of comment field

[https://tickets.opscode.com/browse/CHEF-4938](https://tickets.opscode.com/browse/CHEF-4938)  
Windows user resource does not set key properties of a user

Kapil, let me know if you’d like more information on workarounds.

-Adam

-----Original Message-----  
From: [kapil.shardha@ems-works.com](mailto:kapil.shardha@ems-works.com) [[mailto:kapil.shardha@ems-works.com](mailto:kapil.shardha@ems-works.com)]  
Sent: Wednesday, January 8, 2014 6:54 AM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
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?

Thanks

Kapil
