{"action":"opened","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/36973","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/36973/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/36973/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/36973/events","html_url":"https://github.com/saltstack/salt/issues/36973","id":182815268,"number":36973,"title":"Salt is unable to access folder/file on windows 2012 VM","user":{"login":"EdMosher","id":3074024,"avatar_url":"https://avatars.githubusercontent.com/u/3074024?v=3","gravatar_id":"","url":"https://api.github.com/users/EdMosher","html_url":"https://github.com/EdMosher","followers_url":"https://api.github.com/users/EdMosher/followers","following_url":"https://api.github.com/users/EdMosher/following{/other_user}","gists_url":"https://api.github.com/users/EdMosher/gists{/gist_id}","starred_url":"https://api.github.com/users/EdMosher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdMosher/subscriptions","organizations_url":"https://api.github.com/users/EdMosher/orgs","repos_url":"https://api.github.com/users/EdMosher/repos","events_url":"https://api.github.com/users/EdMosher/events{/privacy}","received_events_url":"https://api.github.com/users/EdMosher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-13T15:03:08Z","updated_at":"2016-10-13T15:03:08Z","closed_at":null,"body":"We are using Salt to insure that our company's internal audit policies are installed on a minion virtual machine that is running the Windows Server 2012 R2 Standard OS. In order for our policies to be installed properly, we must first make sure that 2 particular files (C:\\Windows\\security\\audit\\audi.csv and C:\\Windows\\System32\\GroupPolicy\\Machine\\microsoft\\windows nt\\Audit\\Audit.csv) do not exist on the minion.\r\nTo test this initial cleanup, I wrote the following simple state file:\r\n```\r\nRemove security audit file:\r\n  file.absent:\r\n    - name: 'C:\\Windows\\security\\audit\\audit.csv'\r\n\r\nRemove group policy audit file:\r\n  file.absent:\r\n    - name: 'C:\\Windows\\System32\\GroupPolicy\\Machine\\microsoft\\windows nt\\Audit\\Audit.csv\r\n```\r\nBefore I apply this state, I verify that both files exist on the minion. When I apply this state to the minion, the output indicates that both files are not present; and when I check back on the minion, I see that the audit.csv file from the C:\\Windows\\security\\audit folder was removed. However, the Audit.csv file still exists in the C:\\Windows\\System32\\GroupPolicy\\Machine\\microsoft\\windows nt\\Audit folder.\r\nMy first thought was that there was a problem with the embedded space in the \"windows nt\" folder name, but after many attempts at finding the correct combination of quotes and escape characters, I realized that is not the issue.\r\nThe C:\\Windows\\System32\\GroupPolicy folder contains 2 sub-folders (Machine and User) and 1 config file (gpt.ini). However, it does not appear as though salt can see all of the contents of that folder.\r\n```\r\nsalt-master$ sudo salt win-minion cmd.run 'dir C:\\Windows\\System32\\GroupPolicy'\r\n\r\nwin-minion:\r\n     Volume in drive C has no label:\r\n     Volume Serial Number is 2869-B7E5\r\n\r\n     Directory of C:\\Windows\\System32\\GroupPolicy\r\n\r\n     11/18/2013  04:45 PM   <DIR>             .\r\n     11/18/2013  04:45 PM   <DIR>             ..\r\n     11/18/2013  04:45 PM                        11 gpt.ini\r\n                             1 File(s)                      11 bytes\r\n                             2 Dir(s)    96,334,311,424 bytes free\r\n```\r\nIf I issue the 'dir' command at the command prompt on the minion, I get this:\r\n```\r\nC:\\>dir C:\\Windows\\System32\\GroupPolicy\r\n Volume in drive C has no label.\r\n Volume Serial Number is 2869-B7E5\r\n\r\n Directory of C:\\Windows\\System32\\GroupPolicy\r\n\r\n07/17/2014  05:16 PM                     1,480 gpt.ini\r\n06/27/2014  03:52 PM    <DIR>                Machine\r\n11/18/2013  04:45 PM    <DIR>                User\r\n                        1 File(s)                   1,480 bytes\r\n                        2 Dir(s)     96,334,303,232 bytes free\r\n```\r\nI find it sort of curious that the date/timestamp on the gpt.ini file on the minion is different that what is in the output of the salt command.\r\nI even tried manually creating another empty file in the C:\\Windows\\System32\\GroupPolicy folder, and the command from above produced the exact same results (i.e. it only shows the gpt.ini file in the folder).\r\nThe GroupPolicy folder is a hidden folder. I tried removing the hidden attribute from the folder, but that did not change any of the result listed above.\r\nI also tried testing the path using PowerShell.\r\n```\r\nsalt-master$ sudo salt win-minion cmd.run 'Test-Path C:\\Windows\\System32\\GroupPolicy' shell=powershell\r\n\r\nwin-minion:\r\n     True\r\n\r\nsalt-master$ sudo salt win-minion cmd.run 'Test-Path C:\\Windows\\System32\\GroupPolicy\\Machine' shell=powershell\r\n\r\nwin-minion:\r\n     False\r\n```\r\nA couple final notes... * I made sure that the salt-minion process is running as the Administrator which has full access to the folders and file in question. * As the Administrator, I can access those folders and manually delete the Audit.csv file either from the command prompt or via Windows Explorer.\r\nI would really appreciate any suggestions on how to make this work.\r\n\r\n**Versions Report**\r\n```\r\nsalt-master:\r\nSalt Version:\r\n           Salt: 2016.3.3\r\n\r\nDependency Versions:\r\n           cffi: Not Installed\r\n       cherrypy: Not Installed\r\n       dateutil: Not Installed\r\n          gitdb: Not Installed\r\n      gitpython: Not Installed\r\n          ioflo: Not Installed\r\n         Jinja2: 2.7.3\r\n        libgit2: Not Installed\r\n        libnacl: Not Installed\r\n       M2Crypto: Not Installed\r\n           Mako: Not Installed\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.4.6\r\n   mysql-python: Not Installed\r\n      pycparser: Not Installed\r\n       pycrypto: 2.6.1\r\n         pygit2: Not Installed\r\n         Python: 2.6.6 (r266:84292, Aug 18 2016, 15:13:37)\r\n    python-gnupg: Not Installed\r\n         PyYAML: 3.11\r\n          PyZMQ: 14.5.0\r\n           RAET: Not Installed\r\n          smmap: Not Installed\r\n        timelib: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.0.5\r\n\r\nSystem Versions:\r\n           dist: centos 6.4 Final\r\n        machine: x86_64\r\n        release: 2.6.32-358.18.1.el6.x86_64\r\n         system: Linux\r\n        version: CentOS 6.4 Final\r\n\r\nwin-minion:\r\nSalt Version:\r\n           Salt: 2016.3.3\r\n```"}}
{"actor":{"display_login":"EdMosher"}}