<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx</link><description>Summary: Learn how to configure Windows PowerShell remoting, store credentials, and use remote commands.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3509453</link><pubDate>Tue, 17 Jul 2012 21:30:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3509453</guid><dc:creator>Peter Kelly</dc:creator><description>&lt;p&gt;Found my answer. Something like this works:&lt;/p&gt;
&lt;p&gt;Invoke-Command -ComputerName server123 -cred $Creds -Script { param($Module, $Build, &amp;nbsp;$soapuiProject) c:\TestAutomation\RunSoapUIScript.bat $Module, $Build, &amp;nbsp;$soapuiProject } -Args $Module, $Build, &amp;nbsp;$soapuiProject&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3509453" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3509441</link><pubDate>Tue, 17 Jul 2012 20:43:03 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3509441</guid><dc:creator>Peter Kelly</dc:creator><description>&lt;p&gt;The following remote command with parameters works if I hard-code the parameters as strings. By work, I mean that the batch script on the remote server can see the parms.&lt;/p&gt;
&lt;p&gt;Invoke-Command -ComputerName server123 -cred $Creds {param($p1, $p2, $p3) &amp;nbsp;c:\RunScript.bat &amp;quot;abc&amp;quot; &amp;quot;def&amp;quot; &amp;quot;ghi&amp;quot;}&lt;/p&gt;
&lt;p&gt;But if I turn the strings into variables($p1 $p2 $p3) then the remote batch script sees no parameters.&lt;/p&gt;
&lt;p&gt;$p1=&amp;quot;abc&amp;quot;&lt;/p&gt;
&lt;p&gt;$p2=&amp;quot;def&amp;quot;&lt;/p&gt;
&lt;p&gt;$p3=&amp;quot;ghi&amp;quot;&lt;/p&gt;
&lt;p&gt; Invoke-Command -ComputerName server123 -cred $Creds {param($p1, $p2, $p3) &amp;nbsp;c:\Script.bat $p1 $p2 $p3}&lt;/p&gt;
&lt;p&gt;Any ideas???&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3509441" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3507885</link><pubDate>Sat, 07 Jul 2012 00:14:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507885</guid><dc:creator>jrv</dc:creator><description>&lt;p&gt;HI Peter. &amp;nbsp;I usually don&amp;#39;t answer questions on Ed&amp;#39;s forum but this one had just come up more than once in two days. &amp;nbsp;Glad it helped and sorry for the typos. &amp;nbsp;You can&amp;#39;t edit after clicking &amp;#39;Post&amp;#39; and I keep forgetting that.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507885" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3507880</link><pubDate>Fri, 06 Jul 2012 23:06:50 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507880</guid><dc:creator>pkinoc</dc:creator><description>&lt;p&gt;Thanks JRV!! That was a big help!&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507880" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3507694</link><pubDate>Fri, 06 Jul 2012 02:42:16 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507694</guid><dc:creator>jrv</dc:creator><description>&lt;p&gt;@Peter - I already answered that. Taks the quotes off of the command.&lt;/p&gt;
&lt;p&gt;Commands wil lnot execute is conteined in quotes. &amp;nbsp;Quotes tell POwerSHell to jsut output the contents to teh shell as a string after evaluating any tokens in teh string. &amp;nbsp;This:&lt;/p&gt;
&lt;p&gt;$x=&amp;#39;Some Text&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;quot;Get-Process &amp;nbsp;$x&amp;quot;&lt;/p&gt;
&lt;p&gt;Will output:&lt;/p&gt;
&lt;p&gt;Get-Process Some Text&lt;/p&gt;
&lt;p&gt;Go to a prompt and try it.&lt;/p&gt;
&lt;p&gt;Same thing inside of a script block.&lt;/p&gt;
&lt;p&gt;$sb={&amp;quot;Get-Process &amp;nbsp;$x&amp;quot;}&lt;/p&gt;
&lt;p&gt;icm $sb&lt;/p&gt;
&lt;p&gt;This will produce the same output.&lt;/p&gt;
&lt;p&gt;Do not put quotes aroung executable statements at the commandline or in a scriptblock.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507694" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3507661</link><pubDate>Thu, 05 Jul 2012 22:26:26 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507661</guid><dc:creator>Peter Kelly</dc:creator><description>&lt;p&gt;Mr. Scripting Guy,&lt;/p&gt;
&lt;p&gt;When u run the following command:&lt;/p&gt;
&lt;p&gt;Invoke-Command -cn syddc01 -Credential $cred -ScriptBlock {gps}&lt;/p&gt;
&lt;p&gt;You get the output from the remote server.&lt;/p&gt;
&lt;p&gt;When I do the same thing, regardless of the command or script that I try to run on the remote server, all I get is the command/script outputted and nothing else. Am I doing something wrong?&lt;/p&gt;
&lt;p&gt;PS C:\Users\pekelly&amp;gt; Invoke-Command -ComputerName test003 -cred $cred -ScriptBlock {&amp;quot;gps&amp;quot;}&lt;/p&gt;
&lt;p&gt;gps&lt;/p&gt;
&lt;p&gt;PS C:\Users\pekelly&amp;gt;&lt;/p&gt;
&lt;p&gt;PS C:\Users\pekelly&amp;gt; Invoke-Command -ComputerName test003 -cred $cred -ScriptBlock {&amp;quot;c:\test.bat&amp;quot;}&lt;/p&gt;
&lt;p&gt;c:\test.bat&lt;/p&gt;
&lt;p&gt;PS C:\Users\pekelly&amp;gt; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Pete&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507661" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3496825</link><pubDate>Tue, 08 May 2012 23:52:36 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3496825</guid><dc:creator>Doug Jones</dc:creator><description>&lt;p&gt;Can you point me to a blog in which you have perhaps talked about using Powershell to retrieve some information from a Unix server?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3496825" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3496452</link><pubDate>Mon, 07 May 2012 14:40:21 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3496452</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;I cant seem to find anything about enabling remote access on remote machines. If I want to enable\configure powershell remote access on remote machines, how would I do that (if I couldnt use group policy, but the machines are all on the same domain, and users are local administrators on their machines)?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3496452" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3465534</link><pubDate>Wed, 16 Nov 2011 15:40:26 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3465534</guid><dc:creator>Klaus Schulte</dc:creator><description>&lt;p&gt;Dear Aleksandar,&lt;/p&gt;
&lt;p&gt;you are right ... and I am right :-)&lt;/p&gt;
&lt;p&gt;It depends on the meaning of the word &amp;quot;interactive&amp;quot;, I&amp;#39;m afraid!&lt;/p&gt;
&lt;p&gt;Well, if you enter a pssession, you are in fact &amp;quot;on/in the remote system&amp;quot; and you can work interactive ... true!&lt;/p&gt;
&lt;p&gt;But you won&amp;#39;t see a GUI on the remote machine!&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what I meant because I have to start interactive (=~ GUI) programs remotely and it makes no sense to do so, without the graphical interface ... even if some of the programs would begin automatically to do their work, I couldn&amp;#39;t see any progress and can&amp;#39;t pause/resume - interact them without their controls :-(&lt;/p&gt;
&lt;p&gt;Klaus.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3465534" width="1" height="1"&gt;</description></item><item><title>re: Configure PowerShell Remoting and Use Remote Commands</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/16/configure-powershell-remoting-and-use-remote-commands.aspx#3465514</link><pubDate>Wed, 16 Nov 2011 14:56:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3465514</guid><dc:creator>Aleksandar Nikolić</dc:creator><description>&lt;p&gt;PowerShell remoting supports an interactive remoting (so called 1:1 remoting) with the Enter-PSSession cmdlet. The Enter-PSSession cmdlet starts an interactive session with a single remote computer. During the session, the commands that you type run on the remote computer, just as though you were typing directly on the remote computer.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3465514" width="1" height="1"&gt;</description></item></channel></rss>