Jump to content

Unattended Domain Joining


 Share

Recommended Posts

I am pretty new to the world of scripting and need some help. It would be greatly appreciated

What I would like to do is this

  • Get Input from a User (Username and Password) via Gui Input box.
  • Then Launch a Program call Joindom
  • Disable User Input/Mouse Control
  • Insert Domain Info (meaning I will type in the needed information)
  • Insert User's Input where (insert the username and password where needed)
  • End the Application Joindom when it is finished
  • Enable User Input/Mouse Control
  • Force a Computer Restart (With click Ok to restart) and no option to cancel or quit at that point

You can find the Joindom application I am using Here

Is there a way to package this up into One EXE File? So all the user has to do is run the EXE and not have to save two EXE and reference the joindom app?

Link to comment
Share on other sites

I am pretty new to the world of scripting and need some help. It would be greatly appreciated

What I would like to do is this

  • Get Input from a User (Username and Password) via Gui Input box.
  • Then Launch a Program call Joindom
  • Disable User Input/Mouse Control
  • Insert Domain Info (meaning I will type in the needed information)
  • Insert User's Input where (insert the username and password where needed)
  • End the Application Joindom when it is finished
  • Enable User Input/Mouse Control
  • Force a Computer Restart (With click Ok to restart) and no option to cancel or quit at that point
You can find the Joindom application I am using Here

Is there a way to package this up into One EXE File? So all the user has to do is run the EXE and not have to save two EXE and reference the joindom app?

Hi savj14

All you ask looks possible. I myself wrote a small autoit script to configure the laptop of the people, to set up the proxies for IE and FF, map the drives, and so on,...

You can find a lot of help in the Help file with exemple and so on... very cool !

In this forum we are not so.... "willing" to open exe file but much more open to help you if you put your code in your post.

EDIT: Typo

Edited by cramaboule
Link to comment
Share on other sites

Here is what I have so far.......... I am a little stumped here

It will take the user input. It will run Joindoom. It will fill in DETTEST in the first box of Joindoom. It will put DETTEST\ in the second box. But it will not follow that with the User Input. It puts the Number 4 there.

GUICreate("Enter Login Credentials :",250,90)
GUICtrlCreateLabel ("Username:",10, 10,60,21)
$E=GUICtrlCreateEdit ("",  70, 6,175,19)
$K=GUICtrlCreateButton("OK",100,60,50)
GUISetState(@SW_Show)

While 1
   $msg = GUIGetMsg()
   Select
    Case $msg=-3 
      ExitLoop
    Case $msg=$K
      Run("c:\joindom.exe")
    ExitLoop
    EndSelect
WEnd
WinActivate("Join Domain App", "")
WinWait("Join Domain App", "", 3)
Send("DETTEST")
Send("{TAB}")
Send("DETTEST\"& $E)

Also, is there a way to make sure a user inputs data and not leave it blank?? And hitting Enter is not the same as click "OK" it just returns the GUI???

Please help this newbie :)

Link to comment
Share on other sites

$E=GUICtrlCreateEdit ("",  70, 6,175,19)

; ...

Send("DETTEST\"& $E)
That is sending the ControlID of the Edit, not it's contents. Try something more like:

Send("DETTEST\" & GuiCtrlRead($E))

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

All right I am revamping completely and I am going about this in a different way.

I am going to be using the traditional way of Joining a Domain through the control panel, system, computer name, change.

I am going to be automating this process though. I really want to Use the GUI for gathering user input.

Here is what I have so far:

Do
$Username=InputBox("Credentials","Username:")
If $Username = "" Then 
MsgBox(1,"Are you Sure you want to Quit?")
Else 
    $PortalID=InputBox("Credentials", "Please Enter Your Portal ID")
EndIf
Until $Username <> ""


Run("control sysdm.cpl,,1 -1")
WinWaitActive("System Properties")
Send("!c")
Send("{BS}")
Send("K212-"& $PortalID)
Send("{TAB 2}")
Send("{UP}")
Send("{TAB}")
Send("HOME")
Send("{TAB}")
Send("{ENTER}")
Send($Username)
Send("{TAB}")
Send("password")
Send("{ENTER}")
WinWait("Computer Name Changes","Welcome to the", 5)
WinWait("Computer Name Changes","You must restart this computer for the changes to take effect.", 5)
Send("{ENTER}")

Now I'd like to have the GUI to have a box for the Username and Portal ID. Then I want a Radio button for Laptop and Desktop. And I want to check to make sure a Username and Portal ID is entered and not left blank. And a check to make sure that a Radio button is picked for either a Laptop or Desktop. If any of these are missing I want to shoot a Message box out to the user.

I have created something simialr in VB Script and Visual Studio.Net. I can't seem to convert this.

I have no idea how to do this...........Can someone help me out??

Link to comment
Share on other sites

All right I am revamping completely and I am going about this in a different way.

I am going to be using the traditional way of Joining a Domain through the control panel, system, computer name, change.

I am going to be automating this process though. I really want to Use the GUI for gathering user input.

Here is what I have so far:

Do
$Username=InputBox("Credentials","Username:")
If $Username = "" Then 
MsgBox(1,"Are you Sure you want to Quit?")
Else 
    $PortalID=InputBox("Credentials", "Please Enter Your Portal ID")
EndIf
Until $Username <> ""
Run("control sysdm.cpl,,1 -1")
WinWaitActive("System Properties")
Send("!c")
Send("{BS}")
Send("K212-"& $PortalID)
Send("{TAB 2}")
Send("{UP}")
Send("{TAB}")
Send("HOME")
Send("{TAB}")
Send("{ENTER}")
Send($Username)
Send("{TAB}")
Send("password")
Send("{ENTER}")
WinWait("Computer Name Changes","Welcome to the", 5)
WinWait("Computer Name Changes","You must restart this computer for the changes to take effect.", 5)
Send("{ENTER}")

Now I'd like to have the GUI to have a box for the Username and Portal ID. Then I want a Radio button for Laptop and Desktop. And I want to check to make sure a Username and Portal ID is entered and not left blank. And a check to make sure that a Radio button is picked for either a Laptop or Desktop. If any of these are missing I want to shoot a Message box out to the user.

I have created something simialr in VB Script and Visual Studio.Net. I can't seem to convert this.

I have no idea how to do this...........Can someone help me out??

You said you wanted a GUI but you just poked an InputBox() in there. Read the help file on GuiCreate(), GuiCtrlCreateInput(), and run the examples there. Plus check out the tutorial scripts in the help file. You'll be coding GUIs in no time!

If you get stuck post some (GUI) code for help.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...