>From here http://technet.microsoft.com/en-us/library/hh849719.aspx
My problem is this requirement - On Windows Vista, and later versions of Windows, to use the *ComputerName* parameter of *Invoke-Command* to run a command on the local computer, you must open Windows PowerShell with the "Run as administrator" option. On Wednesday, September 24, 2014 9:33:42 AM UTC-5, Michael Perzel wrote: > > I am working to automate our deployment process with ansible but am > running into a permissions issue. I have a playbook that uses the raw > module to call a deploy.ps1 file that is on a remote windows server. This > deploy.ps1 file does some work and then calls an install.ps1 command using > the following syntax "Invoke-Command -ComputerName $server -filepath > $from\install.ps1 -argumentlist $version,$siteName" The problem is > install.ps1 needs to be run as administrator in order to work (it makes > some changes to IIS). I can run deploy.ps1 (and install.ps1) from an > administrator powershell window but they fail when I run them from a > non-admin powershell window. > > Is there a way to tell the raw command to run the powershell as admin? > > Copied below is the error message. > > "stderr": "[localhost] Connecting to remote server localhost failed with > the following \r\nerror message : Access is denied. For more information, > see the \r\nabout_Remote_Troubleshooting Help topic.\r\n + CategoryInfo > : OpenError: (localhost:String) [], PSRemotingTran \r\n > sportException\r\n + FullyQualifiedErrorId : > AccessDenied,PSSessionStateBroken\r\n", > "stdout": "\nDeploying EdgeTestTool version:532 to servers: > localhost\n\tCopying files to localhost\n\nFile copy complete. Starting > install\n\tInstalling on remote server localhost in site Default Web > Site\nC:\\surescripts\\edge\\532\\archive\\EdgeTestTool.Web\\obj\\x64\\Debug\\Package\\PackageTmp, > > 532, Default Web Site\r\n\nDone Deploying EdgeTestTool version:532 to > servers: localhost\n\n", > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/292dd8e7-49e7-4cb4-8826-1df1bd11c245%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
