# Using win\_iis\_webapppool to update application pool attributes

**URL:** <https://forum.ansible.com/t/using-win-iis-webapppool-to-update-application-pool-attributes/23012>\
**Category:** Ansible Project\
**Created:** [November 11, 2016, 10:25pm UTC](https://forum.ansible.com/t/using-win-iis-webapppool-to-update-application-pool-attributes/23012 "2016-11-11T22:25:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![philip\_shangguan1](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@philip\_shangguan1](https://forum.ansible.com/u/philip_shangguan1)\
**Post date:** [November 11, 2016, 10:25pm UTC](https://forum.ansible.com/t/using-win-iis-webapppool-to-update-application-pool-attributes/23012/1 "2016-11-11T22:25:58Z")

</div>

I am trying to config .NET application pool and I need to change the “Identity” to use “Custom account” and then enter the user name and password. It seems I can not find the correct attribute names to use in the playbook to have those values set. I tried to search them in:

[https://msdn.microsoft.com/en-us/library/microsoft.web.administration.applicationpool\_properties(v=vs.90).aspx](https://msdn.microsoft.com/en-us/library/microsoft.web.administration.applicationpool_properties(v=vs.90).aspx)

but was not successful. This link seems have the right info. but hard to figure out how to add them into the playbook for “attributes”

Thanks,  
Philip

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 14, 2016, 10:21am UTC](https://forum.ansible.com/t/using-win-iis-webapppool-to-update-application-pool-attributes/23012/2 "2016-11-14T10:21:39Z")

</div>

The only way my colleagues have found to do this is via appcmd. If you are on ansible 2.2. you could use win\_command instead of raw but the rest of the syntax would probably be the same as below:

- name: Add authentication for Site  
raw: ‘C:\Windows\System32\inetsrv\appcmd.exe set config “Site/” -section:system.webServer/security/authentication/anonymousAuthentication /enabled:“True” /commit:apphost’

- name: Add authentication user for Site  
raw: ‘C:\Windows\System32\inetsrv\appcmd.exe set config “Site/” -section:system.webServer/security/authentication/anonymousAuthentication /userName:{{ iis\_domain }}{{ iis\_user }} /password:{{ iis\_cred }} /commit:apphost’

HTH

Jon

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 15, 2016, 1:01pm UTC](https://forum.ansible.com/t/using-win-iis-webapppool-to-update-application-pool-attributes/23012/3 "2016-11-15T13:01:50Z")

</div>

By the way, if you have the opportunity, please could you test my changes to win\_iis\_webappool module here:  
[https://github.com/ansible/ansible-modules-extras/pull/3257](https://github.com/ansible/ansible-modules-extras/pull/3257)  
the version lets to set enumerated values in the configuration such as ‘managedPipelineMode’  
and also returns the possible enumeration values in the response.

Many thanks,

Jon

---

<div class="post-metadata">

**Author:** ![David\_Norman](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@David\_Norman](https://forum.ansible.com/u/David_Norman)\
**Post date:** [February 28, 2017, 1:46pm UTC](https://forum.ansible.com/t/using-win-iis-webapppool-to-update-application-pool-attributes/23012/4 "2017-02-28T13:46:59Z")

</div>

> [This message was sent securely using ZixCorp.](http://www.zixcorp.com/get-started/) |
> 
> - |

A ton of fixes for win\_iis\_webapppool were merged this morning, so they should make Ansible 2.3. Jon now imports C:\Windows\system32\inetsrv\Microsoft.Web.Administration.dll, which is what makes it possible to reach all the indexes we were previously getting undefined.

There’s a notable change from how I was doing workarounds for 2.2 and older to use readable strings instead of having to lookup integer values. For example, processModel.identityType:3 will now be processModel.identityType:SpecificUser. Another - managedPipelineMode:0 will be managedPipelineMode:Integrated.

The docs in the pull request note at least one of those in the example output: [https://github.com/ansible/ansible/pull/20680](https://github.com/ansible/ansible/pull/20680)

CONFIDENTIALITY NOTICE: The information in this e-mail message, and any attachment, is intended for the sole use of the individual and entity to whom it is addressed. This information may be privileged, confidential, and protected from disclosure. If you are not the intended recipient you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it, or its, contents, is strictly prohibited. If you think that you have received this e-mail message in error please e-mail the sender and destroy all copies of this communication and any attachments. Thank you.
