# Ansible windows 8.1 management...

**URL:** <https://forum.ansible.com/t/ansible-windows-8-1-management/17991>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [April 16, 2015, 2:34am UTC](https://forum.ansible.com/t/ansible-windows-8-1-management/17991 "2015-04-16T02:34:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Legleux](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Michael\_Legleux](https://forum.ansible.com/u/Michael_Legleux)\
**Post date:** [April 16, 2015, 2:34am UTC](https://forum.ansible.com/t/ansible-windows-8-1-management/17991/1 "2015-04-16T02:34:21Z")

</div>

**Ansible 1.8.4 on ubuntu 12.04 to connect to windows 8.1** guest vm using literally the exact same windows module examples from the ansible documentation.

ansible -m win\_ping and -m setup work great.  
2 Problems standing in my way

1. I am trying to mount a network drive using ansible. The play is simply:

- name: ‘Mount drive to T’  
hosts: windows  
tasks:  
script: mount\_drive.ps1

mount\_drive.ps1 is simply  
New-PSDrive -Name T -PSProvider FileSystem -Root \some\_mountable\_drive\dir -Persist

When this is executed, ansible happily reports the play recap it was “ok” which is a lie.

I know that this works because I have run the command while logged in on the windows guest as the user in question and the drive is mounted immediately.  
_I also used the win\_rm python module to execute this command with success_. I define “success” a little looser here because the drive doesn’t appear immediately, but after logout/login but I chalk that up to windows bs.

If the command works (almost) perfectly with the python win\_rm module. I can’t figure out what am i doing wrong with the ansible play.

Problem 2:

- name: Add user  
hosts: windows  
tasks:
- name: Add newuser  
win\_user:  
name: anewuser  
password: “shhhh”  
groups\_action: replace # with or without this matters not  
groups: [“Users”,“Administrators”]

The user is created fine via inspection with lsusrmgr, however the user is not added to those groups

please point me in the right direction. Also some way to get meaningful output from the remote commands would be nice. win\_rm captures the stdout and err from powershell commands, which is how I debugged the win\_rm python module to mount the drive just fine.

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [April 16, 2015, 6:14pm UTC](https://forum.ansible.com/t/ansible-windows-8-1-management/17991/2 "2015-04-16T18:14:16Z")

</div>

> 

The groups and groups\_action options weren’t added to the win\_user module until 1.9.

If you run ansible with the -v option you’ll see the stdout/stderr from your script, and can turn on additional debugging output using additional v’s (up to -vvvvv).
