We are currently evaluating Chef as a management tool for our Windows
platform. We are playing around with some of the built in resources, and it
did not take long to realize that crucial features are missing.

One of the items that is important to us is manipulating Windows services,
specifically, the “Log On As” parameter. We need to be able to run Windows
services under various (local and AD-authenticated) accounts.

We would prefer to have an abstracted way of doing this (i.e. not defining
custom CMD/Powershell for each recipe that manipulates a service), for
example by having logonas_user/logonas_password attributes for the service
resource.

What documentation topics should we look at? Ideally, we’d like to somehow
extend the existing Service resource (provider?). Should we look at
developing a custom resource?

I am still somewhat intimidated some of the terminology, so I’d appreciate
some pointers to the documentation or maybe examples of others doing
similar work.

#
# Author:: James Kessler (<james.kessler@tradingtechnologies.com>)
# Cookbook Name:: windows
# Provider:: service
#
# Copyright:: 2013, Trading Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

We are currently evaluating Chef as a management tool for our Windows
platform. We are playing around with some of the built in resources, and it
did not take long to realize that crucial features are missing.

One of the items that is important to us is manipulating Windows services,
specifically, the “Log On As” parameter. We need to be able to run Windows
services under various (local and AD-authenticated) accounts.

We would prefer to have an abstracted way of doing this (i.e. not defining
custom CMD/Powershell for each recipe that manipulates a service), for
example by having logonas_user/logonas_password attributes for the service
resource.

What documentation topics should we look at? Ideally, we’d like to somehow
extend the existing Service resource (provider?). Should we look at
developing a custom resource?

I am still somewhat intimidated some of the terminology, so I’d appreciate
some pointers to the documentation or maybe examples of others doing
similar work.

The logonas_user is relatively easy to account for via the registry
provider
(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services<service_name>\ObjectName).
The logonas_password is a whole other story and is something we have yet to
figure out a solution to on our end as well.

The challenge we’ve hit is its easy to “create” the service with the proper
password, however managing that in the event of a password change is
problematic. It would be great if the provider you’ve started could make it
into the community cookbook with support for managing the password. I just
noticed that there is some password logic that I don’t fully understand athttps://github.com/opscode/chef/blob/master/lib/chef/util/windows/net_user.rb#L125.
I’m curious if that same logic could used for the service account password?

#
# Author:: James Kessler (<james.kessler@tradingtechnologies.com>)
# Cookbook Name:: windows
# Provider:: service
#
# Copyright:: 2013, Trading Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

We are currently evaluating Chef as a management tool for our Windows platform. We are playing around with some of the built in resources, and it did not take long to realize that crucial features are missing.

One of the items that is important to us is manipulating Windows services, specifically, the “Log On As” parameter. We need to be able to run Windows services under various (local and AD-authenticated) accounts.

We would prefer to have an abstracted way of doing this (i.e. not defining custom CMD/Powershell for each recipe that manipulates a service), for example by having logonas_user/logonas_password attributes for the service resource.

What documentation topics should we look at? Ideally, we’d like to somehow extend the existing Service resource (provider?). Should we look at developing a custom resource?

I am still somewhat intimidated some of the terminology, so I’d appreciate some pointers to the documentation or maybe examples of others doing similar work.

The logonas_user is relatively easy to account for via the registry provider (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services<service_name>\ObjectName). The logonas_password is a whole other story and is something we have yet to figure out a solution to on our end as well.

The challenge we’ve hit is its easy to “create” the service with the proper password, however managing that in the event of a password change is problematic. It would be great if the provider you’ve started could make it into the community cookbook with support for managing the password. I just noticed that there is some password logic that I don’t fully understand at https://github.com/opscode/chef/blob/master/lib/chef/util/windows/net_user.rb#L125. I’m curious if that same logic could used for the service account password?