<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/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>PowerShell for Exchange</title><link>http://powershell.com/cs/forums/203.aspx</link><description>Moderated by PowerShell MVP &lt;a href="http://powershell.com/cs/content/experts.aspx#shay-levy"&gt;Shay Levy&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Re: Run a test-mailflow within the invoke-command?</title><link>http://powershell.com/cs/forums/thread/18184.aspx</link><pubDate>Wed, 08 Aug 2012 22:25:56 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:18184</guid><dc:creator>Don Jones</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/18184.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=203&amp;PostID=18184</wfw:commentRss><description>&lt;p&gt;Welcome to tricky.&lt;/p&gt;
&lt;p&gt;So, Remoting - which is what Invoke-Command uses - can connect to one of many different endpoints (&amp;quot;session configurations&amp;quot;) on a remote server. The one you&amp;#39;re connecting to is configured with restrictions, including - based on the error message - turning off the PowerShell scripting language. So whatever you&amp;#39;ve remoted into doesn&amp;#39;t support variables.&lt;/p&gt;
&lt;p&gt;You&amp;#39;ve got some choices.&lt;/p&gt;
&lt;p&gt;First, connect to a different endpoint. Run Get-PSSessionConfiguration on the server to see what it&amp;#39;s got. If it has a default &amp;quot;Microsoft.PowerShell&amp;quot; endpoint, connect to that - use the -ConfigurationName parameter of Invoke-Command.&lt;/p&gt;
&lt;p&gt;Second, don&amp;#39;t use a variable. Try using (nested) commands in parentheses instead, if you can construct your command that way. Happy to help if you want to show me what you&amp;#39;re up to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Run a test-mailflow within the invoke-command?</title><link>http://powershell.com/cs/forums/thread/18039.aspx</link><pubDate>Tue, 31 Jul 2012 23:44:39 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:18039</guid><dc:creator>jwhite</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/18039.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=203&amp;PostID=18039</wfw:commentRss><description>&lt;p&gt;
&lt;p&gt;I&amp;#39;m trying to run the test-mailflow cmdlet, within the invoke-command cmdlet. &amp;nbsp;I&amp;#39;m on a Client Access Server and I can issue the test-mapiconnectivity cmdlet against a user. &amp;nbsp;However in order to run the test-mailflow cmdlet, I need to be on the mailbox server that the user is on.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m referencing this article:&amp;nbsp;&lt;a href="http://technet.microsoft.com/en-us/library/hh849719.aspx"&gt;http://technet.microsoft.com/en-us/library/hh849719.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The problem is I keep getting the error:&lt;/p&gt;
&lt;p&gt;A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that&lt;br /&gt;can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, and &amp;nbsp;$null.&lt;br /&gt;&amp;nbsp; &amp;nbsp; + CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ParserError: (data:Token) [], ParseException&lt;br /&gt;&amp;nbsp; &amp;nbsp; + FullyQualifiedErrorId : VariableReferenceNotSupportedInDataSection&lt;/p&gt;
&lt;p&gt;Anyone know what I&amp;#39;m missing or how I can get the invoke-command to run the mailflow test remotely?&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>