title: PowerShell Remoting giving "Access is Denied" error
body: <p>I am trying to use PowerShell Remoting to check some disk sizes from a Server in a remote domain, but the commands I am running are failing to work.</p>
  
  <p>The situation is like this:</p>
  
  <ul>
  <li>Source Server is in Domain A</li>
  <li>Destination Server is in Domain B</li>
  <li>There is no trust in place between these domains</li>
  </ul>
  
  <p>The Server in Domain B is running Exchange 2010, and I can run Exchange 2010 Specific commands against it from Server A using this command:</p>
  
  <pre><code>$Session = New-PSSession -ConfigurationName Microsoft.Exchange –ConnectionUri $ConnectionURI -Credential $Credentials -Authentication Basic
  Import-PSSession $Session
  </code></pre>
  
  <p>The problem is that I can't run any non Exchange commands against this server using this session, if I try then it says that it can't understand the commands. I've checked and running Get-Command with Invoke-Command and the -Session variable set to my established session only returns Exchange commands.</p>
  
  <p>So I thought i'd try to use Invoke-Command and the relevant ComputerName, Authentication type and Credentials, but this is failing:</p>
  
  <pre><code>Invoke-Command -ScriptBlock {Get-Service} -ComputerName "Servername.destination.com" -Credential $Credentials -Authentication "Basic"
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>[servername.destination.com] Connecting to remote server failed with the following error message : The WinRM client can
  not process the request. The authentication mechanism requested by the client is not supported by the server or unencry
  pted traffic is disabled in the service configuration. Verify the unencrypted traffic setting in the service configurat
  ion or specify one of the authentication mechanisms supported by the server.  To use Kerberos, specify the computer nam
  e as the remote destination. Also verify that the client computer and the destination computer are joined to a domain.
  To use Basic, specify the computer name as the remote destination, specify Basic authentication and provide user name a
  nd password. Possible authentication mechanisms reported by server:     Negotiate Kerberos For more information, see th
  e about_Remote_Troubleshooting Help topic.
      + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
      + FullyQualifiedErrorId : PSSessionStateBroken
  </code></pre>
  
  <p>So I go into the WSMAN config on the Target server and set the relevant settings for allowing Basic Auth and an unencrypted connection:</p>
  
  <pre><code>cd WSMan:\localhost\Service
  Set-Item AllowUnencrypted $True
  cd .\Auth
  Set-Item Basic $True
  </code></pre>
  
  <p>I also have added the Destination server into the Trusted Hosts of the Source domain server:</p>
  
  <pre><code>cd WSMan:\localhost\Client
  Set-Item TrustedHosts servername.destination.com
  </code></pre>
  
  <p>After doing so, the error changes, but it's not very helpful:</p>
  
  <pre><code>PS WSMan:\localhost\Client&gt; Invoke-Command -ScriptBlock {Get-Service} -ComputerName "servername.destination.com" -Creden
  tial $Credentials -Authentication "Basic"
  [servername.destination.com] Connecting to remote server failed with the following error message : Access is denied. Fo
  r more information, see the about_Remote_Troubleshooting Help topic.
  + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
  + FullyQualifiedErrorId : PSSessionStateBroken
  </code></pre>
  
  <p>I have also tried using Domain Admin credentials, via -Credential (Get-Credential), but this is failing with the same problem.</p>
  
  <p>The user I am trying to use is a member of the local Admins users on the server in question, so the permissions should already be set on the PSSessionConfiguration containers.</p>
  
  <p>I would love any further pointers with this! I would just use WMI but it's not enabled through the firewalls at the moment.</p>