1

I want to open AD from a different domain. Earlier i used this to do so:

runas /netonly /user:xxxx\xxxx "mmc dsa.msc /domain=xxxx"

Which worked fine but i wanted to make it into a GUI to make it faster so in powershell ISE i did this:

$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential xxxx\$Account, $securePassword
Start-Process  mmc "dsa.msc /domain=xxxx"  -Credential $credential

I know the above bit of code works, if i try to use it to login to AD with a different user to a domain i am already logged then it works.

However when trying to use it to login to a different domain then i get the error. "The security database on the server does not have a computer account for this workstation trust relationship." Same error i would get if i tried to run the first bit of code with out Netonly in CMD/Powershell.

How can i fix this? Does the "start-process" have anything like "runas" has /netonly that i can add to fix it?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.