active directory - How to run PowerShell script from a computer to untrusted domain? -
i have powershell scripts update data in active directory. want run these scripts domain joined computer, user logged in not have admin rights ad run scripts. how can pass credentials first connect domain administrator , run script?
i know command get-credentials
don't want manual intervention. there batch file runs script , want put credentials once. don't want show password logged in user. there possibility can save password in encrypted format?
hope there trust between 2 domains
$server = 'xxxxxxxxxx' $username = 'domain\xxxxxxxxxx' $password = 'xxxxxxxxxx' $securepassword = convertto-securestring $password -asplaintext -force $cred = new-object system.management.automation.pscredential -argumentlist ($username,$securepassword) get-adcomputer -identity $server -credential $cred
you can change entire script in exe file using powergui , use credentials save being opened.
or
use script brenton j.w. blawat encryption located @ http://gallery.technet.microsoft.com/scriptcenter/powershell-script-410ef9df
or
use simple script mentioned in below article http://www.interworks.com/blogs/trhymer/2013/07/08/powershell-how-encrypt-and-store-credentials-securely-use-automation-script
Comments
Post a Comment