I have a powershell file that looks to a directory and locks the fields on each of the Word documents that are contained in that directory. I am executing this powershell file from a SQL stored procedure using xp_cmdshell.
I have implemented this solution at several organizations without a problem.
I am currently implementing this at another organization, but am having problems. At this new organization, if I execute the powershell file manually from within a Powershell window, the script runs successfully and locks the fields on each of the documents. However, when the same PS file is attempted to be run from the SQL stored procedure via xp_cmdshell, I am getting the following error message:
I believe that this organization is on the same versions of SQL, Powershell, and Windows as the organizations where this does work successfully. I'm suspecting that this might be some sort of permissions or SQL configuration issue but am at a loss at this point. Any ideas?