Jump to content

Script with optional login option


Recommended Posts

Hi,

I've got the following issue:

We've got like two domains over here, let's call them DC1 and DC2, on both domains we've got a different AR Admin,

so depending on which PC is joining DC1 or DC2 we should use a different Admin account to get all privileges.

So i created a script which check weither the user is joining DC1 or DC2, see below:

If @LogonDomain = "DC1" Then

            RunAsSet ("admin1","DC1","*******")

Else

            RunAsSet ("admin2","DC2","*******")

EndIf

 

RunWait ( "msiexec /i ""\\Microsoft\Visio 2003 Pro\VISPRO.MSI""  TRANSFORMS=""\\Microsoft\Visio 2003 Pro\Visio.MST""")

 

MsgBox(4160, "Finished", "Visio Installation Finished")

This script isn't working and displays the following error: "Local path cannot be found".

That can be right if the script is not working properly and the script is trying to run the installation on DC2 domain with the DC1 admin account but....

I don't know, please help me out here :)

Cheers,

Edited by UniPer
Link to comment
Share on other sites

1. Is "Microsoft" a server accessible from both domains?

If so:

a. have you tried to run your string from the command-line to see if the UNC pathname is even valid?

b. have you tried trapping the error from RunWait to see what it's saying?

before displaying a msgbox stating that the installation is finished, i'd check error messages to see if it worked or not.

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Link to comment
Share on other sites

1. Microsoft is not the servername, i removed the IP adress, the server is like \\192.168.12.1\Microsoft\ and is accessible from both pc's

2. The UNC path is valid, i tried it on the command line on both accounts, the DC1 and the DC2 account.

3. Ok....euuhm...yeah..i'm kinda new to AutoIT so...how? :)

Link to comment
Share on other sites

I've got the feeling that AutoIT is not able to run an application from another domain then the one i'm logged in to atm.

I'm trying to run the following script:

RunAsSet( "user", "dc1", "pass" )
Run( "mmc C:\windows\system32\dsa.msc" )
RunAsSet()

Sleep ( 5000 )

RunAsSet( "user", "dc2", "pass" )
Run( "mmc C:\windows\system32\dsa.msc" )
RunAsSet()

After I run the script the first Active Directory Users and Computers window for DC1 Domain pops-up and works perfect,

after a 5 sec. sleep i get the following error for the same console for the DC2 domain: "Unable to execute the program, the directory name is invalid"

while i'm using the same command line for both.

I've tested the same function with this VB script and that does work:

oShell.Run "runas /user:dc1\user ""mmc %windir%\system32\dsa.msc"""

Any ideas?

Edited by UniPer
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...