twinnis Posted January 3, 2006 Share Posted January 3, 2006 Hi. Im trying to change a key in registry with credentials from a domainadmin. But it does not work. Here is the code. Dim $User, $Pass, $Domain = "domain" $User = InputBox("Inloggning ", "Username", "") $Pass = InputBox("Inloggning ", "Password","", "*") ; Set the RunAs parameters to use domain adminstrator account RunAsSet( "$User", "$Domain", "$Pass",2 ) RegWrite( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoRestartShell", "REG_DWORD", 0) If I test the script with Beta Run it never stopps executing. It seems that i dont get the domainadmin rights to do the regsitry change. I would be very happy for some help Best regards Twinnis Link to comment Share on other sites More sharing options...
BigDod Posted January 3, 2006 Share Posted January 3, 2006 This lineRunAsSet( "$User", "$Domain", "$Pass",2 )Should beRunAsSet( $User, $Domain, $Pass,2 )You do do not need the quotes round variable or they cease to be variables. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
twinnis Posted January 3, 2006 Author Share Posted January 3, 2006 Hi. Thanks for your answer. But the problem remains. So i tested to put the username, domainname and password directly i the RunAsSet line, just to be shure that it was not the inputbox that generated the problem. But it still does not work. Any suggestions? /Twinnis Link to comment Share on other sites More sharing options...
twinnis Posted January 3, 2006 Author Share Posted January 3, 2006 Hi. Thanks for your answer. I will rewrite the script and give it a test tomorrov. Best regards from Sweden. Twinnis Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now