I am using Robocopy command to copy some files/directory from a pullserver to target node in DSC. When I run the same command in powershell it works fine, but when I am using the same in Script resource , it gives me Access Denied error.(I tried using xRobocopy module, but got the same error).
All other DSC scripts running fine with the same credential(Even some file resource written to copy some file also work fine).Here is the robocopy command
In event viewer Robocopy doesn’t throw any error, it simply gets executed correctly only the error comes in log.
So, What might be the issue with Robocopy not working in DSC for a credential , but works fine in powershell with same credential?
I checked with the process monitor for both the powershell and DSC in the server. The process for Robocopy is run by the same Admin credential provided.
While opening the powershell window, I am opening it explicitly with the Admin credential and for DSC execution I am providing Credential parameter in Script resource.
I tried this UNC path also, but looks like it throws the same Access Denied error for this when run using ScriptResource, but if I run the same from powershell console it works fine.
I also tried giving full permission to a credential for both folders, but nothing clicked.
Did anybody face the same issue with Robocopy and please let me know if the robocopy is working for anybody in DSC.