5t0n3r
Active Members-
Posts
39 -
Joined
-
Last visited
5t0n3r's Achievements
Seeker (1/7)
0
Reputation
-
Create users in AD along with custom folders
5t0n3r replied to 5t0n3r's topic in AutoIt General Help and Support
I was afraid you'd say that. Thanks for the UDF, I'm sure it'll help. I'll give it my best, but like I said, I'm no programmer. This could be a lifetime project for me. LOL -
I do like to give back... if I can. Here's the script you'd want to use. Two lines are commented out while the other two are not. The commented out lines will set the value to all 0's, while the uncommented lines will delete the key completely and allow Outlook to create them automatically. #NoTrayIcon $sPath1 = RegRead("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "FirstRun") Func _AddOutlookPrefs() RegDelete("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "FirstRun") ;Removes the key so Outlook will create it automatically on first run. RegDelete("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run") ;Removes the key so Outlook will create it automatically on first run. ; RegWrite("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "FirstRun", "REG_BINARY", "0x0000000000000000") ;Sets the key to 0's ; RegWrite("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run", "REG_BINARY", "0x0000000000000000") ;Sets the key to 0's RegWrite("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", "REG_SZ", "\\DC1\NETLOGON\PRF_FILES\DEFAULT.PRF") EndFunc If $sPath1 <> "0x000000000000000" Then _AddOutlookPrefs() Else Exit EndIf
-
I am NOT, and I stress NOT, a programmer or very good scripter, but I can modify most scripts to get the desired result. I am however at a loss on this script. I don't even know where to begin, or how to get it to the GUI stage once I do get the underlying functions working. Any help getting started would be great, and very much appreciated. Here's what I am looking to accomplish. 1) Ability to add users into Windows Active Directory based on templates stored in an OU, with basic information. - home folder (connect) - terminal services user profile - terminal services home folder (connect) - organization info 2) After user is created; - create/share home folder and assign rights for the user to it - create/share terminal services folder and assign rights to it 3) GUI front-end to manage all of this. I'm basically asking someone to write the basics of this for me. I don't know enough to start it, but once it's there I should be able to continue on with it. I would like to do this without having to use our current method of manually creating the user and then running VBS scripts that make and set permissions for the folders. Thank you for any help you can provide.
-
Script does not work if push install
5t0n3r replied to lazybum's topic in AutoIt General Help and Support
Here's something I use all the time. You need to make sure "psexec.exe" is in the same folder as the script when you compile it. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=config.ico #AutoIt3Wrapper_Outfile=PC_GUI.exe #AutoIt3Wrapper_Compression=3 #AutoIt3Wrapper_Res_Comment=Runs programs on remote computers with alternate credentials. #AutoIt3Wrapper_Res_Description=Runs programs on remote computers with alternate credentials. #AutoIt3Wrapper_Res_Fileversion=1.0.0.1 #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_File_Add=psexec.exe #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <ButtonConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <StatusBarConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <array.au3> #include <GuiListView.au3> #include <file.au3> #include <GuiTab.au3> #include <IE.au3> Opt("TrayIconHide", 1) Opt("TrayAutoPause", 0) $PS = 'psexec.exe' $TO = ' -n 60' $TOOLS = GUICreate("Remote Program GUI", 532, 420, -1, -1) $App = GUICtrlCreateInput("", 8, 24, 201, 21) $Browse1 = GUICtrlCreateButton("Browse", 218, 23, 75, 23, 0) $PL2 = GUICtrlCreateLabel("Application to run on remote PC", 8, 6, 184, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $CLO = GUICtrlCreateInput("", 8, 67, 289, 21) $PL3 = GUICtrlCreateLabel("Command line parameters", 8, 50, 148, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $PL4 = GUICtrlCreateLabel("Admin User Name", 8, 100, 124, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $PL5 = GUICtrlCreateLabel("Admin Password", 8, 120, 124, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $PL8 = GUICtrlCreateLabel("Domain/Workstation", 8, 140, 124, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $PCH8 = GUICtrlCreateCheckbox("Use Workstation ID (list mode)", 16, 158, 225, 17) $Usrnm = GUICtrlCreateInput("", 140, 96, 157, 21) $Pw = GUICtrlCreateInput("", 140, 116, 157, 21, $ES_PASSWORD) $Domain = GUICtrlCreateInput("", 140, 136, 157, 21) $Group1 = GUICtrlCreateGroup("Parameters", 8, 178, 289, 216) $PCH1 = GUICtrlCreateCheckbox("Interact with the users desktop", 16, 194, 185, 17) $PCH2 = GUICtrlCreateCheckbox("Run application in the system account", 16, 218, 225, 17) $PCH3 = GUICtrlCreateCheckbox("Copy file to remote", 16, 242, 113, 17) $Group2 = GUICtrlCreateGroup("Copy Options", 20, 265, 250, 54) $PCH4 = GUICtrlCreateRadio("Overwrite existing file", 28, 278, 121, 17) GUICtrlSetState(-1, $GUI_CHECKED) $PCH5 = GUICtrlCreateRadio("Copy file only if it is a higher version or newer", 28, 295, 241, 17) $PCH6 = GUICtrlCreateCheckbox("Don't wait for the process to terminate", 16, 325, 225, 17) $PCH7 = GUICtrlCreateCheckbox("Show output window", 16, 344, 129, 17) $PL11 = GUICtrlCreateLabel("Thread priority:", 16, 370, 74, 17) $PR1 = GUICtrlCreateRadio("Low", 96, 368, 49, 17) $PR2 = GUICtrlCreateRadio("Normal", 152, 368, 57, 17) GUICtrlSetState($PR2, $GUI_CHECKED) $PR3 = GUICtrlCreateRadio("High", 216, 368, 49, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $PT1 = GUICtrlCreateTab(304, 8, 217, 313) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) $PTS1 = GUICtrlCreateTabItem("Enter Name") $RPC = GUICtrlCreateInput("", 312, 56, 137, 21) $PL6 = GUICtrlCreateLabel("Remote PC name (or add PC to the list)", 312, 32, 188, 17) $Add = GUICtrlCreateButton("Add", 456, 54, 41, 25, 0) $List1 = GUICtrlCreateListView("", 310, 85, 200, 200, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT, $WS_VSCROLL)) _GUICtrlListView_InsertColumn($List1, 0, "Machine name or IP", 200) _GUICtrlListView_SetExtendedListViewStyle($List1, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT)) $Rms1 = GUICtrlCreateButton("Remove from list", 310, 287, 100, 25, 0) $Clr1 = GUICtrlCreateButton("Clear list", 440, 287, 70, 25, 0) $PTS2 = GUICtrlCreateTabItem("Load PC List") $PL7 = GUICtrlCreateLabel("Load text file (one pc name per line)", 312, 34, 172, 17) $CL = GUICtrlCreateInput("", 312, 56, 121, 21) $Browse2 = GUICtrlCreateButton("Browse", 435, 54, 41, 25, 0) $Load = GUICtrlCreateButton("Load", 476, 54, 41, 25, 0) $List2 = GUICtrlCreateListView("", 310, 85, 200, 200, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT, $WS_VSCROLL)) _GUICtrlListView_InsertColumn($List2, 0, "Machine name or IP", 200) _GUICtrlListView_SetExtendedListViewStyle($List2, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT)) $Rms2 = GUICtrlCreateButton("Remove from list", 310, 287, 100, 25, 0) $Clr2 = GUICtrlCreateButton("Clear list", 440, 287, 70, 25, 0) ;$PTS3 = GUICtrlCreateTabItem("Browse Net") GUICtrlCreateTabItem("") $HLP = GUICtrlCreateButton("Help", 345, 350, 75, 25, 0) $EX = GUICtrlCreateButton("Execute", 440, 350, 75, 25, 0) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $Browse1 ;If browse buttong is selected will read selection and set data to input box $browse11 = FileOpenDialog("Browse", "C:\", "All Files (*.*)") GUICtrlSetData($App, $browse11) Case $Add ;check if remote computer was specified $PC = GUICtrlRead($RPC) _GUICtrlListView_AddItem($List1, $PC) Case $Clr1 ;Clears list1 on Enter name tab if clear button is pressed Clear($List1) Case $Clr2 ;Clears list2 on Enter name tab if clear button is pressed Clear($List2) Case $Browse2 ;If load button is selected will read selection and set data to input box $Browse22 = FileOpenDialog("Browse", "C:\", "All Files (*.*)") GUICtrlSetData($CL, $Browse22) $PCL = GUICtrlRead($CL) Case $Load ;loads file for load pc list tab list2 box load($PCL) Case $Rms1 ;removes selected item _GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($List1)) Case $Rms2 ;removes selected item _GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($List2)) Case $HLP _IECreate('http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx') Case $EX ;reads app input box $AP = GUICtrlRead($App) ;sees if don't wait for process is checked $C6 = GUICtrlRead($PCH6) If $C6 = 1 Then $d = ' -d' Else $d = '' EndIf ;sees if copy file to remote pc was checked $C3 = GUICtrlRead($PCH3) If $C3 = 1 Then $c = ' -c' Else $c = '' EndIf ;sees if copy if newer version or date is checked $C5 = GUICtrlRead($PCH5) If 1 = $C5 And 1 = $C3 Then $v = ' -v' Else $v = '' EndIf ;sees if force overwrite is checked $C4 = GUICtrlRead($PCH4) If 1 = $C4 And 1 = $C3 Then $f = ' -f' Else $f = '' EndIf ;sees if run under system account is checked $C2 = GUICtrlRead($PCH2) If 1 = $C2 Then $s = ' -s' Else $s = '' EndIf ;sees if interact with desktop is checked $C1 = GUICtrlRead($PCH1) If 1 = $C1 Then $i = ' -i' Else $i = '' EndIf ;reads any command line options were specified $CO = GUICtrlRead($CLO) ;sees what priority was selected $P1 = GUICtrlRead($PR1) $P2 = GUICtrlRead($PR2) $P3 = GUICtrlRead($PR3) If $P1 = 1 Then $P = ' -low' ElseIf $P2 = 1 Then $P = ' -normal' ElseIf $P3 = 1 Then $P = ' -high' EndIf ;sees is display output was selected $C7 = GUICtrlRead($PCH7) If $C7 == 1 Then $sd = @SW_SHOW Else $sd = @SW_HIDE EndIf ;sees is workstation id was selected $C8 = GUICtrlRead($PCH8) If $C8 == 1 Then $wstn = 1 Else $wstn = '' EndIf ;Execution loop While 2 If $AP = '' Then MsgBox(0, "", "No application was specified") ExitLoop Else ;depending on what tab is selected sets the correct list box If _GUICtrlTab_GetItemState($PT1, 1) = 0 Then ;BuildArray($list1) $list = $List1 ElseIf _GUICtrlTab_GetItemState($PT1, 1) = 1 Then ;BuildArray($list2) $list = $List2 EndIf $IC = _GUICtrlListView_GetItemCount($list) For $item = 0 To $IC - 1 ;checks if alternate username was specified $USN = GUICtrlRead($Usrnm) If $USN <> '' And $wstn >= '' Then $USN = '-u ' & _GUICtrlListView_GetItemText(GUICtrlGetHandle($list), $item) & '\' & GUICtrlRead($Usrnm) $PAS = ' -p ' & GUICtrlRead($Pw) ElseIf $USN <> '' And $Domain == '' Then $USN = '-u ' & GUICtrlRead($Usrnm) $PAS = ' -p ' & GUICtrlRead($Pw) ElseIf $USN <> '' Then $USN = '-u ' & GUICtrlRead($Domain) & '\' & GUICtrlRead($Usrnm) $PAS = ' -p ' & GUICtrlRead($Pw) Else $USN = '' $PAS = '' EndIf $FL = @ComSpec & ' /c psexec.exe \\' & _GUICtrlListView_GetItemText(GUICtrlGetHandle($list), $item) & ' ' & $USN & ' (pass is not logged)' & $TO & $s & $i & $c & $v & $f & $d & $P & ' "' & $AP & '" ' & $CO _FileWriteLog(@TempDir & '\PSexec.log', $FL) RunWait(@ComSpec & ' /c psexec.exe \\' & _GUICtrlListView_GetItemText(GUICtrlGetHandle($list), $item) & ' ' & $USN & $PAS & $TO & $s & $i & $c & $v & $f & $d & $P & ' "' & $AP & '" ' & $CO & ' >>' & @TempDir & '\psexeccommand.' & _GUICtrlListView_GetItemText(GUICtrlGetHandle($list), $item) & '.log', @TempDir, $sd) Next EndIf ;asks if the user would like to execute If 6 = MsgBox(4, 'Remote Program GUI', 'Done executing, do you want to exit?') Then Exit Else ;clears both lists if users selects yes If 6 = MsgBox(4, 'Remote Program GUI', 'Do you want to clear the computer list?') Then Clear($List1) Clear($List2) ExitLoop Else ExitLoop EndIf EndIf WEnd EndSwitch WEnd ;load pc list from text file Func Load($list) $file = FileOpen($list, 0) If $file = -1 Then MsgBox(0, 'Error', 'Unable To open file') EndIf While 2 $FRPCL = FileReadLine($file) If @error = -1 Then ExitLoop _GUICtrlListView_AddItem($List2, $FRPCL) WEnd EndFunc ;==>Load ;clears array and list Func Clear($listview) _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview)) EndFunc ;==>Clear -
Is there a work-around to Norton Antivirus
5t0n3r replied to dew's topic in AutoIt General Help and Support
Sounds like the av is seeing the file as a virus. What does the log file in norton AV say it detects it as? Also, it could be from the UPX packing that AutoIt does. You can try setting an exclusion in norton AV to exclude that file from AV scanning. Other than that... you can try removing parts of your code to see where norton is picking it up as a virus. It'll take awhile but you'll be able to find out what exactly is triggering norton to see your code as a virus and then maybe work around it by rewriting it another way. Sorry, that's the best I can suggest. -
RunAs / Add and Remove Printers
5t0n3r replied to Jbrad95706's topic in AutoIt General Help and Support
Best thing to do is download the full version of SciTe editor from the download page and in it there's a (Ctrl + F7) Build option that give you the ability to specify an icon. If you want to modify the tray icon and it's text, here's a bit of code for that. Opt("TrayMenuMode",1) TraySetIcon("path to file.ico") TraySetToolTip("Tool Tip Popup Text") TraySetState() -
Here's a quick and dirty way of doing what you want. #include <guiconstantsex.au3> $gui = GUICreate("Test", 270, 100) $Input = GUICtrlCreateInput("", 50, 25, 150, 20) $Button1 = GUICtrlCreateButton("Button 1", 50, 50, 50, 20) $Button2 = GUICtrlCreateButton("Button 2", 100, 50, 50, 20) $Button3 = GUICtrlCreateButton("Button 3", 150, 50, 50, 20) $Exit = GUICtrlCreateButton("Exit", 200, 75, 50, 20) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Exit Exit Case $Button1 GUICtrlSetData($Input, "Button 1") Case $Button2 GUICtrlSetData($Input, "Button 2") Case $Button3 GUICtrlSetData($Input, "Button 3") EndSwitch WEnd
-
Pass a variable to DOS and unzip with 7zip
5t0n3r replied to Willow's topic in AutoIt General Help and Support
Hi there... Give this a try, maybe it'll be usefull. #include <guiconstantsex.au3> $def_browse_in = "C:\" $def_browse_out = "C:\" $gui = GUICreate("Select Archive", 270, 150) GUICtrlCreateLabel("Choose Input File", 25, 10) GUICtrlCreateLabel("Choose Output Location", 25, 55) $Input = GUICtrlCreateInput("", 25, 25, 155, 20) $Output = GUICtrlCreateInput("", 25, 70, 155, 20) $Browse_In = GUICtrlCreateButton("Browse", 190, 25, 50, 20) $Browse_Out = GUICtrlCreateButton("Browse", 190, 70, 50, 20) $Execute = GUICtrlCreateButton("Execute", 135, 110, 60, 30) $Exit = GUICtrlCreateButton("Exit", 200, 110, 60, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Exit Exit Case $Browse_In $message_in = "Select a file to unzip" $aName = FileOpenDialog($message_in, $def_browse_in, "Archives (*.zip)") GUICtrlSetData($Input, $aName) Case $Browse_Out $message_out = "Select a destination" $dName = FileSelectFolder($message_out, "C:\", "", $def_browse_out) GUICtrlSetData($Output, $dName) Case $Execute Run(@ComSpec & " /k c:\daily\7z e -o " & $Input & " " & $Output) EndSwitch WEnd -
The reason why it didn't work is the quotes. You need to use a different quote to encapsulate something within quotes. Notice the double quote around the MSIEXEC command and the single quote around the long filename. Here's the updated code. $user="Administrator" $pass="password" $comp=@ComputerName RunAs($user,$comp,$pass,0,"msiexec.exe /i '\\server01\Users\New Folder\filename.msi'")
-
RunAs / Add and Remove Printers
5t0n3r replied to Jbrad95706's topic in AutoIt General Help and Support
Try this. A little simplier, but works. $comp=@ComputerName RunAs("Administrator",$comp,"TheLocalAdminPassword",0,"rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter") -
RunAs / Add and Remove Printers
5t0n3r replied to Jbrad95706's topic in AutoIt General Help and Support
Here's a modified version of the script. You'll need to make sure you have the latest version of AutoIt for it to work and compile properly. $user="Administrator" $pass="Password" $comp=@ComputerName RunAs($user,$comp,$pass,0,"rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter") -
Okay, here's the whole script. If I use $gui = GUICreate("test") within the function, it messes up the original script. Sorry, I'm learning as I go and this is stumping me. #include <ButtonConstants.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("TrayMenuMode",1) TraySetToolTip("Add / Remove Employee") TraySetState() $gui = GUICreate("Add / Remove Employee Process", 650, 700) $tab = GUICtrlCreateTab(-10, -22, 665, 725) ; Main Menu Page $main1Page1 = GUICtrlCreateTabItem("mainmenu1") $main1Btn1 = GUICtrlCreateButton("New Employee", 125, 100, 150, 60) $main1Btn2 = GUICtrlCreateButton("Terminated Employee", 350, 100, 150, 60) GUICtrlCreateLabel("Choose this option for the" & @CRLF & "New Employee checklist.", 130, 200) GUICtrlCreateLabel("Choose this option for the" & @CRLF & "Terminated Employee checklist.", 355, 200) GUICtrlCreateLabel("Save output file to: ", 130, 355) $savepath = GUICtrlCreateInput("",130,370,300,20) $browse = GUICtrlCreateButton("Browse", 432,369,50,22) GUICtrlCreateLabel("Report created by:", 130, 400) $reported_by = _reported_by() ; End Main Menu page Func _reported_by() $sName = GUICtrlCreateCombo("", 130, 415, 160, "", -1) GUICtrlSetData(-1, "Tech 1|Tech 2|Tech 3|Tech 4", "Tech 1") Return GUICtrlRead($sName) EndFunc ; New Employee Page 1 $new1Page1 = GUICtrlCreateTabItem("new_employee_p1") $newGroup1 = GUICtrlCreateGroup("New Employee - Network Permissions - Page [1/7]", 8, 10, 635, 645) $new1Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new1Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) ; Option 1 Data GUICtrlCreateLabel("1) Has the user been added to Active Directory?", 30, 50) $new1Radio1 = GUICtrlCreateRadio("Yes", 50, 80, 120, 20) $new1Radio2 = GUICtrlCreateRadio("No", 50, 100, 120, 20) $new1Radio3 = GUICtrlCreateRadio("N/A", 50, 120, 120, 20) $new1Label1 = GUICtrlCreateLabel ("Date Added?", 180, 80, 200, 20) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetFont (-1,10) $new1Input1 = GUICtrlCreateDate("", 180, 100, 150, 20) GUICtrlSetState(-1, $GUI_HIDE) $new1Label2 = GUICtrlCreateLabel ("Click the button to add the user to Active Directory.", 180, 80, 400, 20) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetFont (-1,10) $new1Input2 = GUICtrlCreateButton ("Active Directory Users and Computers", 180, 100, 200, 30) GUICtrlSetState(-1, $GUI_HIDE) ; End Option 1 Data ; End New Employee Page 1 ; New Employee Page 2 $new2Page1 = GUICtrlCreateTabItem("new_employee_p2") $newGroup1 = GUICtrlCreateGroup("New Employee - [2/7]", 8, 10, 635, 645) $new2Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new2Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("New Employee Page 2", 100, 200) ; End New Employee Page 2 ; New Employee Page 3 $new3Page1 = GUICtrlCreateTabItem("new_employee_p3") $newGroup1 = GUICtrlCreateGroup("New Employee - [3/7]", 8, 10, 635, 645) $new3Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new3Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("New Employee Page 3", 100, 200) ; End New Employee Page 3 ; New Employee Page 4 $new4Page1 = GUICtrlCreateTabItem("new_employee_p4") $newGroup1 = GUICtrlCreateGroup("New Employee - [4/7]", 8, 10, 635, 645) $new4Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new4Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("New Employee Page 4", 100, 200) ; End New Employee Page 4 ; New Employee Page 5 $new5Page1 = GUICtrlCreateTabItem("new_employee_p5") $newGroup1 = GUICtrlCreateGroup("New Employee - [5/7]", 8, 10, 635, 645) $new5Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new5Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("New Employee Page 5", 100, 200) ; End New Employee Page 5 ; New Employee Page 6 $new6Page1 = GUICtrlCreateTabItem("new_employee_p6") $newGroup1 = GUICtrlCreateGroup("New Employee - [6/7]", 8, 10, 635, 645) $new6Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new6Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("New Employee Page 6", 100, 200) ; End New Employee Page 6 ; New Employee Page 7 $new7Page1 = GUICtrlCreateTabItem("new_employee_p7") $newGroup1 = GUICtrlCreateGroup("New Employee - [7/7]", 8, 10, 635, 645) $new7Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $new7Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) $new7Finish1 = GUICtrlCreateButton("Finish", 260, 195, 75, 25) $final_exit = GUICtrlCreateButton("Exit", 560, 600, 75, 25) GUICtrlCreateLabel("New Employee Page 7", 100, 200) ; End New Employee Page 7 ;================================================================== ; Terminated Employee Page 1 $ter1Page1 = GUICtrlCreateTabItem("ter_employee_page1") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [1/7]", 8, 10, 635, 645) $ter1Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter1Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) ; Option 1 Data GUICtrlCreateLabel("1) Has the user been disabled or removed from Active Directory?", 30, 50) $ter1Radio1 = GUICtrlCreateRadio("Yes", 50, 80, 120, 20) $ter1Radio2 = GUICtrlCreateRadio("No", 50, 100, 120, 20) $ter1Radio3 = GUICtrlCreateRadio("N/A", 50, 120, 120, 20) $ter1Label1 = GUICtrlCreateLabel ("Date Disabled/Removed?", 180, 80, 200, 20) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetFont (-1,10) $ter1Input1 = GUICtrlCreateDate("", 180, 100, 150, 20) GUICtrlSetState(-1, $GUI_HIDE) $ter1Label2 = GUICtrlCreateLabel ("Click the button to disable/remove the user from Active Directory.", 180, 80, 400, 20) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlSetFont (-1,10) $ter1Input2 = GUICtrlCreateButton ("Active Directory Users and Computers", 180, 100, 200, 30) GUICtrlSetState(-1, $GUI_HIDE) ; End Option 1 Data ; End Terminated Employee Page 1 ; Terminated Employee Page 2 $ter2Page1 = GUICtrlCreateTabItem("ter_employee_page2") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [2/7]", 8, 10, 635, 645) $ter2Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter2Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("Terminated Employee Page 2", 100, 200) ; End Terminated Employee Page 2 ; Terminated Employee Page 3 $ter3Page1 = GUICtrlCreateTabItem("ter_employee_page3") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [3/7]", 8, 10, 635, 645) $ter3Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter3Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("Terminated Employee Page 3", 100, 200) ; End Terminated Employee Page 3 ; Terminated Employee Page 4 $ter4Page1 = GUICtrlCreateTabItem("ter_employee_page4") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [4/7]", 8, 10, 635, 645) $ter4Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter4Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("Terminated Employee Page 4", 100, 200) ; End Terminated Employee Page 4 ; Terminated Employee Page 5 $ter5Page1 = GUICtrlCreateTabItem("ter_employee_page5") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [5/7]", 8, 10, 635, 645) $ter5Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter5Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("Terminated Employee Page 5", 100, 200) ; End Terminated Employee Page 5 ; Terminated Employee Page 6 $ter6Page1 = GUICtrlCreateTabItem("ter_employee_page6") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [6/7]", 8, 10, 635, 645) $ter6Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter6Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) GUICtrlCreateLabel("Terminated Employee Page 6", 100, 200) ; End Terminated Employee Page 6 ; Terminated Employee Page 7 $ter7Page1 = GUICtrlCreateTabItem("ter_employee_page7") $terGroup2 = GUICtrlCreateGroup("Terminated Employee - [7/7]", 8, 10, 635, 645) $ter7Back1 = GUICtrlCreateButton("< Back", 400, 660, 75, 25) $ter7Next1 = GUICtrlCreateButton("Next >", 475, 660, 75, 25) $ter7Finish1 = GUICtrlCreateButton("Finish", 260, 195, 75, 25) GUICtrlCreateLabel("Terminated Employee Page 7", 100, 200) ; End Terminated Employee Page 7 ;================================================================== GUICtrlCreateTabitem ("") $cancel = GUICtrlCreateButton("Cancel", 560, 660, 75, 25) GUICtrlSetState($main1Page1, $GUI_SHOW) GUICtrlSetState($new7Next1, $GUI_DISABLE) GUICtrlSetState($ter7Next1, $GUI_DISABLE) GUISetState() Func _FileSaveDialog ($sTitle, $sInitDir, $sFilter = "Text Files (*.txt)|All Files (*.*)", $iOpt = 0, $sDefaultFile = "", $sDefaultExt = "", $mainGUI = 0) Local $iFileLen = 65536 Local $iFlag = BitOR(BitShift(BitAND($iOpt, 2), -10), BitShift(BitAND($iOpt, 16), 3)) Local $asFLines = StringSplit($sFilter, '|'), $asFilter[$asFLines[0] * 2 + 1] Local $i, $iStart, $iFinal, $suFilter = '', $ret $asFilter[0] = $asFLines[0] * 2 For $i = 1 To $asFLines[0] $iStart = StringInStr($asFLines[$i], '(', 0, 1) $iFinal = StringInStr($asFLines[$i], ')', 0, -1) $asFilter[$i * 2 - 1] = $asFlines[$i] $asFilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asFLines[$i], $iStart), StringLen($asFLines[$i]) - $iFinal + 1), 3) $suFilter = $suFilter & 'byte[' & StringLen($asFilter[$i * 2 - 1]) + 1 & '];byte[' & StringLen($asFilter[$i * 2]) + 1 & '];' Next Local $uOFN = DllStructCreate('dword;int;int;ptr;ptr;dword;dword;ptr;dword' & ';ptr;int;ptr;ptr;dword;short;short;ptr;ptr;ptr;ptr;ptr;dword;dword') Local $usTitle = DllStructCreate('byte[' & StringLen($sTitle) + 1 & ']') Local $usInitDir = DllStructCreate('byte[' & StringLen($sInitDir) + 1 & ']') Local $usFilter = DllStructCreate($suFilter & 'byte') Local $usFile = DllStructCreate('char[' & $iFileLen & ']') Local $usExtn = DllStructCreate('byte[' & StringLen($sDefaultExt) + 1 & ']') For $i = 1 To $asFilter[0] DllStructSetData($usFilter, $i, $asFilter[$i]) Next DllStructSetData($usTitle, 1, $sTitle) DllStructSetData($usInitDir, 1, $sInitDir) DllStructSetData($usFile, 1, $sDefaultFile) DllStructSetData($usExtn, 1, $sDefaultExt) DllStructSetData($uOFN, 1, DllStructGetSize($uOFN)) DllStructSetData($uOFN, 2, $mainGUI) DllStructSetData($uOFN, 4, DllStructGetPtr($usFilter)) DllStructSetData($uOFN, 7, 1) DllStructSetData($uOFN, 8, DllStructGetPtr($usFile)) DllStructSetData($uOFN, 9, $iFileLen) DllStructSetData($uOFN, 12, DllStructGetPtr($usInitDir)) DllStructSetData($uOFN, 13, DllStructGetPtr($usTitle)) DllStructSetData($uOFN, 14, $iFlag) DllStructSetData($uOFN, 17, DllStructGetPtr($usExtn)) DllStructSetData($uOFN, 23, BitShift(BitAND($iOpt, 32), 5)) $ret = DllCall('comdlg32.dll', 'int', 'GetSaveFileName', 'ptr', DllStructGetPtr($uOFN)) If $ret[0] Then Return StringStripWS(DllStructGetData($usFile, 1), 3) Else SetError(1) Return "" EndIf EndFunc While 1 $Msg = GUIGetMsg() Switch $Msg case $new1Radio1 GUICtrlSetState($new1Label1, $GUI_SHOW) GUICtrlSetState($new1Input1, $GUI_SHOW) GUICtrlSetState($new1Label2, $GUI_HIDE) GUICtrlSetState($new1Input2, $GUI_HIDE) $new1Output1 = "Yes" case $new1Radio2 GUICtrlSetState($new1Label1, $GUI_HIDE) GUICtrlSetState($new1Input1, $GUI_HIDE) GUICtrlSetState($new1Label2, $GUI_SHOW) GUICtrlSetState($new1Input2, $GUI_SHOW) $new1Output1 = "No" case $new1Radio3 $new1Output1 = "N/A" case $ter1Radio1 GUICtrlSetState($ter1Label1, $GUI_SHOW) GUICtrlSetState($ter1Input1, $GUI_SHOW) GUICtrlSetState($ter1Label2, $GUI_HIDE) GUICtrlSetState($ter1Input2, $GUI_HIDE) case $ter1Radio2 GUICtrlSetState($ter1Label1, $GUI_HIDE) GUICtrlSetState($ter1Input1, $GUI_HIDE) GUICtrlSetState($ter1Label2, $GUI_SHOW) GUICtrlSetState($ter1Input2, $GUI_SHOW) case $new1Input2 If FileExists(@SystemDir & "\dsa.msc") Then Run("mmc " & @SystemDir & "\dsa.msc", '',@SW_MAXIMIZE) Else MsgBox(0x30, "Unable to Launch Program", "Active Directory Users and Computers" & @CRLF & @CRLF & "This program was not found on this computer, please install the" & @CRLF & "Windows Server Administration Tools Pack to be able to have this functionality.") EndIf case $ter1Input2 If FileExists(@SystemDir & "\dsa.msc") Then Run("mmc " & @SystemDir & "\dsa.msc", '',@SW_MAXIMIZE) Else MsgBox(0x30, "Unable to Launch Program", "Active Directory Users and Computers" & @CRLF & @CRLF & "This program was not found on this computer, please install the" & @CRLF & "Windows Server Administration Tools Pack to be able to have this functionality.") EndIf Case - 3 $answer = MsgBox(32 + 4, "Exit Program", "Are you sure you want to EXIT the program?" & @CRLF & "Any unsaved information will be lost.") Switch $answer Case 6; Yes Exit Case 7; No EndSwitch Case $cancel $answer = MsgBox(32 + 4, "Exit Program", "Are you sure you want to EXIT the program?" & @CRLF & "Any unsaved information will be lost.") Switch $answer Case 6; Yes Exit Case 7; No EndSwitch Case $final_exit $answer = MsgBox(32 + 4, "Exit Program", "Are you sure?") Switch $answer Case 6; Yes Exit Case 7; No EndSwitch Case $browse $sFile = _FileSaveDialog("Browse for file location", @DesktopDir) GUICtrlSetData($savepath, $sFile) ;================================================================== Case $main1Btn1 GUICtrlSetState($new1Page1, $GUI_SHOW) Case $main1Btn2 GUICtrlSetState($ter1Page1, $GUI_SHOW) Case $new1Back1 GUICtrlSetState($main1Page1, $GUI_SHOW) Case $new1Next1 GUICtrlSetState($new2Page1, $GUI_SHOW) Case $new2Back1 GUICtrlSetState($new1Page1, $GUI_SHOW) Case $new2Next1 GUICtrlSetState($new3Page1, $GUI_SHOW) Case $new3Back1 GUICtrlSetState($new2Page1, $GUI_SHOW) Case $new3Next1 GUICtrlSetState($new4Page1, $GUI_SHOW) Case $new4Back1 GUICtrlSetState($new3Page1, $GUI_SHOW) Case $new4Next1 GUICtrlSetState($new5Page1, $GUI_SHOW) Case $new5Back1 GUICtrlSetState($new4Page1, $GUI_SHOW) Case $new5Next1 GUICtrlSetState($new6Page1, $GUI_SHOW) Case $new6Back1 GUICtrlSetState($new5Page1, $GUI_SHOW) Case $new6Next1 GUICtrlSetState($new7Page1, $GUI_SHOW) Case $new7Back1 GUICtrlSetState($new6Page1, $GUI_SHOW) Case $new7Finish1 GUICtrlSetState($main1Page1, $GUI_SHOW) $label1 = "Has the User been added to Active Directory?" $label2 = "Reported By?" $sep1 = "===================================================" $nFO = FileOpen($sFile, 2) ; 1 appends, 2 will overwrite FileWriteLine($nFO, $sep1) FileWriteLine($nFO, $label1 & " = " & $new1Output1) FileWriteLine($nFO, $sep1) FileWriteLine($nFO, $label2 & " = " & $reported_by) FileWriteLine($nFO, $sep1) FileCLose($nFO) Case $ter1Back1 GUICtrlSetState($main1Page1, $GUI_SHOW) Case $ter1Next1 GUICtrlSetState($ter2Page1, $GUI_SHOW) Case $ter2Back1 GUICtrlSetState($ter1Page1, $GUI_SHOW) Case $ter2Next1 GUICtrlSetState($ter3Page1, $GUI_SHOW) Case $ter3Back1 GUICtrlSetState($ter2Page1, $GUI_SHOW) Case $ter3Next1 GUICtrlSetState($ter4Page1, $GUI_SHOW) Case $ter4Back1 GUICtrlSetState($ter3Page1, $GUI_SHOW) Case $ter4Next1 GUICtrlSetState($ter5Page1, $GUI_SHOW) Case $ter5Back1 GUICtrlSetState($ter4Page1, $GUI_SHOW) Case $ter5Next1 GUICtrlSetState($ter6Page1, $GUI_SHOW) Case $ter6Back1 GUICtrlSetState($ter5Page1, $GUI_SHOW) Case $ter6Next1 GUICtrlSetState($ter7Page1, $GUI_SHOW) Case $ter7Back1 GUICtrlSetState($ter6Page1, $GUI_SHOW) Case $ter7Finish1 GUICtrlSetState($main1Page1, $GUI_SHOW) EndSwitch WEnd