# unable to install exchange 2016 using ansible

**URL:** <https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [September 12, 2016, 7:48pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528 "2016-09-12T19:48:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chandra\_Pandey](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Chandra\_Pandey](https://forum.ansible.com/u/Chandra_Pandey)\
**Post date:** [September 12, 2016, 7:48pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/1 "2016-09-12T19:48:49Z")

</div>

I get error while installing fresh exchange 2016 server using ansible —

ExchangeSetup.log Error

Active Directory operation failed on . The supplied credential for ‘ADS\Chandra Pandey’ is invalid.  
[09/12/2016 19:34:45.0055] [0] The supplied credential is invalid

Ansible Error:

\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM RESULT u’\<Response code 0, out “C:\Users\Chandra Pan”, err “”\>’  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> PUT “/etc/ansible/playbooks/exch.ps1” TO “C:\Users\Chandra Pandey\AppData\Local\Temp\ansible-tmp-1473708846.5-280345779333025\exch.ps1”  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM PUT “/etc/ansible/playbooks/exch.ps1” to “C:\Users\Chandra Pandey\AppData\Local\Temp\ansible-tmp-1473708846.5-280345779333025\exch.ps1” (offset=121 size=121)  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> EXEC & ‘C:\Users\Chandra Pandey\AppData\Local\Temp\ansible-tmp-1473708846.5-280345779333025\exch.ps1’  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-ExecutionPolicy’, ‘Unrestricted’, ‘-EncodedCommand’, ‘JgAgACAAJwBDADoAXABVAHMAZQByAHMAXABDAGgAYQBuAGQAcgBhACAAUABhAG4AZABlAHkAXABBAHAAcABEAGEAdABhAFwATABvAGMAYQBsAFwAVABlAG0AcABcAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAA3ADMANwAwADgAOAA0ADYALgA1AC0AMgA4ADAAMwA0ADUANwA3ADkAMwAzADMAMAAyADUAXABlAHgAYwBoAC4AcABzADEAJwA=’]  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM RESULT u’\<Response code 0, out “\r\nWelcome to Microso”, err “There is a pending r”\>’  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> EXEC Set-StrictMode -Version Latest  
Remove-Item “C:\Users\Chandra Pandey\AppData\Local\Temp\ansible-tmp-1473708846.5-280345779333025” -Force -Recurse;  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM EXEC u’PowerShell’ [u’-NoProfile’, u’-NonInteractive’, u’-ExecutionPolicy’, u’Unrestricted’, u’-EncodedCommand’, u’UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgBSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAEMAaABhAG4AZAByAGEAIABQAGEAbgBkAGUAeQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADcAMwA3ADAAOAA4ADQANgAuADUALQAyADgAMAAzADQANQA3ADcAOQAzADMAMwAwADIANQAiACAALQBGAG8AcgBjAGUAIAAtAFIAZQBjAHUAcgBzAGUAOwA=‘]  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM RESULT u’\<Response code 0, out “”, err “”\>’  
\<[dev-01.xyz.com](http://dev-01.xyz.com)\> WINRM CLOSE SHELL: 2304FF63-3899-4A5F-AA24-67A3E8DAF0B1  
changed: [[dev-01.xyz.com](http://dev-01.xyz.com)] =\> {“changed”: true, “invocation”: {“module\_args”: {“\_raw\_params”: “exch.ps1”}, “module\_name”: “script”}, “rc”: 0, “stderr”: “There is a pending reboot from a previous installation of a Windows Server role or feature. Please restart the computer and then run Setup again.\r\nYou must be a member of the ‘Organization Management’ role group or a member of the ‘Enterprise Admins’ group to continue.\r\nYou must use an account that’s a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.\r\nYou must use an account that’s a member of the Organization Management role group to install the first Client Access server role in the topology.\r\nYou must use an account that’s a member of the Organization Management role group to install the first Client Access server role in the topology.\r\nYou must use an account that’s a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.\r\nYou must use an account that’s a member of the Organization Management role group to install or upgrade the first Client Access server role in the topology.\r\nYou must use an account that’s a member of the Organization Management role group to install the first Mailbox server role in the topology.\r\nSetup encountered a problem while validating the state of Active Directory: Active Directory operation failed on . The supplied credential for ‘ADS\Chandra Pandey’ is invalid. See the Exchange setup log for more information on this error.\r\nEither Active Directory doesn’t exist, or it can’t be contacted.\r\n”, “stdout”: “\r\nWelcome to Microsoft Exchange Server 2016 Unattended Setup\r\n\r\nCopying Files…\r\nFile copy complete.\r\nSetup will now collect additional information needed for installation.\r\n\r\n Languages\r\n Management tools\r\n Mailbox role: Transport service\r\n Mailbox role: Client Access service\r\n Mailbox role: Unified Messaging service\r\n Mailbox role: Mailbox service\r\n Mailbox role: Front End Transport service\r\n Mailbox role: Client Access Front End service\r\n\r\nPerforming Microsoft Exchange Server Prerequisite Check\r\n\r\n Configuring Prerequisites … COMPLETED\r\n Prerequisite Analysis\r\n\r\nThe Exchange Server setup operation didn’t complete. More details can be found in ExchangeSetup.log located in the :\ExchangeSetupLogs folder.\r\n”, “stdout\_lines”: [“”, “Welcome to Microsoft Exchange Server 2016 Unattended Setup”, “”, “Copying Files…”, “File copy complete.”, “Setup will now collect additional information needed for installation.”, “”, " Languages", " Management tools", " Mailbox role: Transport service", " Mailbox role: Client Access service", " Mailbox role: Unified Messaging service", " Mailbox role: Mailbox service", " Mailbox role: Front End Transport service", " Mailbox role: Client Access Front End service", “”, “Performing Microsoft Exchange Server Prerequisite Check”, “”, " Configuring Prerequisites … COMPLETED", " Prerequisite Analysis", “”, “The Exchange Server setup operation didn’t complete. More details can be found in ExchangeSetup.log located in the :\ExchangeSetupLogs folder.”]}

---

<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:** [September 12, 2016, 8:47pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/2 "2016-09-12T20:47:58Z")

</div>

Can you share you playbook for creating Exchange?

Is there anything useful in :\ExchangeSetupLogs\ExchangeSetup.log ?

One of the errors was about being unable to talk to a local port. Does there need to be some firewall configuration before running this step?

I think it is possible that you need auth delegation (I don’t know anything about Exchange architecture, but if it requires talking to other windows hosts during installation it might need auth delegation.

To use auth delegation, ensure you are running pywinrm 0.2.0 and set the following in your windows group\_vars/ inventory:

ansible\_winrm\_transport: kerberos  
ansible\_winrm\_kerberos\_delegation: yes

I hope the above helps, please let us know how you get on.

Jon

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [September 15, 2016, 10:23pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/3 "2016-09-15T22:23:56Z")

</div>

I’m actually undertaking the same task this week for a PoC demo, so I’ll let you know if I figure out the magic incantations to get it working. 🙂

-Matt

---

<div class="post-metadata">

**Author:** ![Chandra\_Pandey](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Chandra\_Pandey](https://forum.ansible.com/u/Chandra_Pandey)\
**Post date:** [September 16, 2016, 7:50am UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/4 "2016-09-16T07:50:47Z")

</div>

Hi, Thanks , will wait for your result …

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [September 16, 2016, 11:25pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/5 "2016-09-16T23:25:36Z")

</div>

Worked fine for me using Kerberos delegation: ansible\_winrm\_transport=kerberos and ansible\_winrm\_kerberos\_delegation=yes. The setup takes so ridiculously long that I didn’t try it any other way, so your mileage may vary.

-Matt

---

<div class="post-metadata">

**Author:** ![Chandra\_Pandey](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Chandra\_Pandey](https://forum.ansible.com/u/Chandra_Pandey)\
**Post date:** [September 17, 2016, 1:50pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/6 "2016-09-17T13:50:01Z")

</div>

I am getting below message after enable delegation , also pasting my , playbook ansible settings … if you can review with yours?

---

<div class="post-metadata">

**Author:** ![Chandra\_Pandey](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Chandra\_Pandey](https://forum.ansible.com/u/Chandra_Pandey)\
**Post date:** [September 17, 2016, 1:51pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/7 "2016-09-17T13:51:56Z")

</div>

I am getting below message after enable delegation , also pasting my , playbook ansible settings … if you can review with yours?

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [September 19, 2016, 10:46pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/8 "2016-09-19T22:46:52Z")

</div>

Make sure you’re using the very latest pykerberos package from PyPI, not kerberos (remove kerberos if it’s there) to get all the latest goodies lit up.

---

<div class="post-metadata">

**Author:** ![Chandra\_Pandey](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Chandra\_Pandey](https://forum.ansible.com/u/Chandra_Pandey)\
**Post date:** [September 20, 2016, 10:08am UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/9 "2016-09-20T10:08:38Z")

</div>

Hi,

Can you please let me know the commands to install and configuration of host or group var ?

---

<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:** [September 22, 2016, 7:23am UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/10 "2016-09-22T07:23:02Z")

</div>

The following ought to remove pykerberos and install kerberos and latest version of pywinrm. Latest version of pywinrm also needs requests-kerberos to make kerberos connections - if it doesn’t get installed, install that too. Check what you have installed using ‘pip list’

pip uninstall pykerberos

pip install kerberos  
pip install pywinrm version==0.2.0

You should be able to set configuration in host or group vars. Generally I prefer to use group\_vars so I don’t have to copy and paste settings for individual hosts, but its really a case of what makes sense for your inventory.

Jon

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [September 22, 2016, 5:40pm UTC](https://forum.ansible.com/t/unable-to-install-exchange-2016-using-ansible/22528/11 "2016-09-22T17:40:59Z")

</div>

There’s actually a bug in pywinrm for older Pythons (eg, the one in RHEL7) that is triggered by enabling kerberos delegation. It’s fixed in pywinrm 0.2.1.
