# Use Ansible to Install SharePoint Server Updates

**URL:** <https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090>\
**Category:** Ansible Project\
**Created:** [June 4, 2020, 8:47am UTC](https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090 "2020-06-04T08:47:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raikhan\_Mussin](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@Raikhan\_Mussin](https://forum.ansible.com/u/Raikhan_Mussin)\
**Post date:** [June 4, 2020, 8:47am UTC](https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090/1 "2020-06-04T08:47:48Z")

</div>

Hello!  
My name is Raikhan.

Maybe someone used Ansible to install Microsoft updates?

We configured Ansible to install Microsoft updates, and this works successfully for all updates, except for **SharePoint Server 2013 updates**. When we run playbook to install SharePoint Server updates - nothing happens and there are no understandable errors. The server uses UAC, but we tried to work with elevated privileges and also added parameters to the playbook to temporarily disable and enable UAC in the registry. Nothing helps.

Maybe you have fresh thoughts and ideas?

Thanks!

 ![Ansible - SharePointUpdates.png](https://us1.discourse-cdn.com/ansible/original/2X/a/a4a93741a37320260efd5f3f84d97669734d0501.png)

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [June 4, 2020, 10:44pm UTC](https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090/2 "2020-06-04T22:44:46Z")

</div>

If the task is trying to install updates then you are typically restricted by Windows over a network logon like WinRM. The way around this that Ansible provides is the become [1]. This turns the logon type to an interactive logon which is allowed to install Windows updates just like you can when running it manually.

[1] - [https://docs.ansible.com/ansible/latest/user\_guide/become.html#become-and-windows](https://docs.ansible.com/ansible/latest/user_guide/become.html#become-and-windows)

---

<div class="post-metadata">

**Author:** ![Raikhan\_Mussin](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@Raikhan\_Mussin](https://forum.ansible.com/u/Raikhan_Mussin)\
**Post date:** [June 5, 2020, 9:18am UTC](https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090/3 "2020-06-05T09:18:32Z")

</div>

Hello, Jordan!  
Thanks for the answer.

We use this playbook and it does not work:

- name: Run ps1 script in privileged mode  
hosts: all  
gather\_facts: no  
become\_method: runas

vars:  
ansible\_become\_password: elon\*musk#1

tasks:

- win\_shell: C:\Script\Install-Update.ps1  
become: yes  
become\_user: SpaceX@test.kz

But, if we run the powershell script “Install-Update.ps1” manually, as an administrator - The installation of updates is successful !

What can you recommend for installing updates through Ansible?

Thanks!

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [June 5, 2020, 10:37am UTC](https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090/4 "2020-06-05T10:37:45Z")

</div>

What’s the output when you run the win\_whoami module with the same become setup you have for win\_shell. Please use -vvv so we can see the output. I would also try ansible\_become\_pass as I believe ansible\_become\_password is only valid in later Ansible versions.

---

<div class="post-metadata">

**Author:** ![Raikhan\_Mussin](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@Raikhan\_Mussin](https://forum.ansible.com/u/Raikhan_Mussin)\
**Post date:** [June 8, 2020, 4:39am UTC](https://forum.ansible.com/t/use-ansible-to-install-sharepoint-server-updates/33090/5 "2020-06-08T04:39:06Z")

</div>

Thanks for the answer.  
We tried your recommendations, but the result is the same. Updates are not installed ☹
