# The network mapping disk generated by win\_mapped\_drive is not available

**URL:** <https://forum.ansible.com/t/the-network-mapping-disk-generated-by-win-mapped-drive-is-not-available/27014>\
**Category:** Ansible Project\
**Created:** [March 16, 2018, 8:27am UTC](https://forum.ansible.com/t/the-network-mapping-disk-generated-by-win-mapped-drive-is-not-available/27014 "2018-03-16T08:27:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![12177589](https://avatars.discourse-cdn.com/v4/letter/1/e19adc/32.png) [@12177589](https://forum.ansible.com/u/12177589)\
**Post date:** [March 16, 2018, 8:27am UTC](https://forum.ansible.com/t/the-network-mapping-disk-generated-by-win-mapped-drive-is-not-available/27014/1 "2018-03-16T08:27:36Z")

</div>

```auto
My Syntax is here

```

```auto
  tasks:
  - name: create a mapped drive under Z
    win_mapped_drive:
      letter: Z
      path: \192.168.227.181.0.0\pys
      username: administrator
      password: Test123456
      
  - name: copy file
    win_copy:
      src: Z:\
      dest: C:\tools
      remote_src: True

```

```auto
The execution result:

```

[![](https://lh3.googleusercontent.com/-QieK6qwfVBM/Wqt93SjymPI/AAAAAAAAAAk/v7ZVmBr4CHM5rlK7y4qlVQ_6Imad0MzeACLcBGAs/s1600/QQ%25E5%259B%25BE%25E7%2589%258720180316161812.png)](https://lh3.googleusercontent.com/-QieK6qwfVBM/Wqt93SjymPI/AAAAAAAAAAk/v7ZVmBr4CHM5rlK7y4qlVQ_6Imad0MzeACLcBGAs/s1600/QQ%25E5%259B%25BE%25E7%2589%258720180316161812.png)

[![](https://lh3.googleusercontent.com/-Hl8K0n0k6X0/Wqt-xoJ41bI/AAAAAAAAAAw/vu-4-cC-fIw3RXFxqZceYCw1a8eUmJKmwCLcBGAs/s1600/QQ%25E5%259B%25BE%25E7%2589%258720180316162121.png)](https://lh3.googleusercontent.com/-Hl8K0n0k6X0/Wqt-xoJ41bI/AAAAAAAAAAw/vu-4-cC-fIw3RXFxqZceYCw1a8eUmJKmwCLcBGAs/s1600/QQ%25E5%259B%25BE%25E7%2589%258720180316162121.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:** [March 16, 2018, 9:07am UTC](https://forum.ansible.com/t/the-network-mapping-disk-generated-by-win-mapped-drive-is-not-available/27014/2 "2018-03-16T09:07:02Z")

</div>

In the latest docs for win\_mapped\_drive ([https://docs.ansible.com/ansible/devel/modules/win\_mapped\_drive\_module.html](https://docs.ansible.com/ansible/devel/modules/win_mapped_drive_module.html)) there is a note that says

> You cannot use this module to access a mapped drive in another Ansible task, drives mapped with this module are only accessible when logging in interactively with the user through the console or RDP.

Ultimately due to the security model of Windows this is not possible and as you can see the Z: drive has been mapped to the path you specified when you logged on locally. We’ve documented some of these limitations here [https://groups.google.com/forum/#!topic/ansible-project/5uk0-ki7zT8](https://groups.google.com/forum/#!topic/ansible-project/5uk0-ki7zT8) but ultimately you have a few options;

- Use become on the task and become the user you want to connect with ([http://docs.ansible.com/ansible/devel/user\_guide/become.html#become-and-windows](http://docs.ansible.com/ansible/devel/user_guide/become.html#become-and-windows)). When you use become those credentials are available on that process to connect to a remote host

- Use CredSSP or Kerberos with credential delegation enabled and the user will be able to access a network path with the connection user’s variables

- Use a module like win\_psexec and run it with the user’s credentials

- Use a scheduled task to run the command with the user’s credentials

There

Thanks

Jordan
