title: How to run powershell script against domain?
body: <p>I am trying to run the following powershell command through my application using <code>C#</code></p>
  
  <pre><code>Get-ADUserResultantPasswordPolicy user1
  </code></pre>
  
  <p>It returns the values for user1 on domain1 which is my current domain. </p>
  
  <p>when I try to read the values for a user2 on domain2:</p>
  
  <pre><code>Get-ADUserResultantPasswordPolicy domain2\user2
  </code></pre>
  
  <p>its throwing exception</p>
  
  <pre><code>"Cannot find an object with identity:'user2' under:'DC=domain2,DC=com'.
  </code></pre>
  
  <p>Is there away to point powershell to the other domains and read the data on that domain?</p>