1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. gmmg

Beiträge von gmmg

  • Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

    • gmmg
    • 6. November 2013 um 12:07

    Hallo Zusammen,

    habe hier ein Script, welches ein internes Umfragetool mit Radiobuttons und Edit Feldern werden soll! (ist gob fertig)
    Diese Werte sollen dann in eine Excel Datei oder DB geschrieben werden! (sollte auch nicht das problem sein :))
    Nun komme ich nicht auf die Lösung, wie man alle Felder prüft, dass diese auch ausgefüllt sind ...

    Kann mir da bitte einer von euch einen Tipp geben :)

    Eventuell auch beim erstellen der Radio Button .....

    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 110
    $left_s2 = 530

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness 1 ", 90, 150, 400, 200)
    $radio11 = GUICtrlCreateRadio("1",$left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $radio12 = GUICtrlCreateRadio("2",$left_s1 + 30,$top_1, 30, 20)
    $radio13 = GUICtrlCreateRadio("3",$left_s1 + 60,$top_1, 30, 20)
    $radio14 = GUICtrlCreateRadio("4",$left_s1 + 90,$top_1, 30, 20)
    $radio15 = GUICtrlCreateRadio("5",$left_s1 + 120,$top_1, 30, 20)
    $radio16 = GUICtrlCreateRadio("6",$left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 110, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Objektivität / Fairness 2 ", 90, 380, 400, 200)
    $radio21 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio22 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $radio23 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $radio24 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $radio25 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $radio26 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 110, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Objektivität / Fairness 3 ", 90, 610, 400, 200)
    $radio31 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio32 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $radio33 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $radio34 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $radio35 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $radio36 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 110, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Objektivität / Fairness 4 ", 510, 150, 400, 200)
    $radio41 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio42 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $radio43 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $radio44 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $radio45 = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $radio46 = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 530, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Objektivität / Fairness 5 ", 510, 380, 400, 200)
    $radio51 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio52 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $radio53 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $radio54 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $radio55 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $radio56 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 530, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Objektivität / Fairness 6 ", 510, 610, 400, 200)
    $radio61 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio62 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $radio63 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $radio64 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $radio65 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $radio66 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 530, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton("Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    $wert1 = GUICtrlRead($TL_Combo)

    [/autoit] [autoit][/autoit] [autoit]

    _radio_edit($radio11, $radio12, $radio13, $radio14, $radio15, $radio16, $edit11)

    [/autoit] [autoit][/autoit] [autoit]

    $f1 = $x & "|" & $wert_edit
    ;_radio_edit($radio21, $radio22, $radio23, $radio24, $radio25, $radio26, $edit21)
    ;MsgBox(0,"",$x & @CRLF & $wert_edit)
    ;$f2 = $x & "|" & $wert_edit
    ;_radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)
    ;MsgBox(0,"",$x & @CRLF & $wert_edit)
    ;$f3 = $x & "|" & $wert_edit
    ;MsgBox(0,"",$wert1 & @crlf & $f1 & @CRLF & $f2 & @CRLF & $f3)
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    $x = ""
    $wert_edit = ""

    [/autoit] [autoit][/autoit] [autoit]

    $wert_edit = GUICtrlRead($edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    ; Group mit $radio1 bis $radio6
    For $i = $radio_x1 To $radio_x6
    If GUICtrlRead($i) = $GUI_CHECKED Then
    Switch $i
    Case $radio_x1
    $x = 1
    Case $radio_x2
    $x = 2
    Case $radio_x3
    $x = 3
    Case $radio_x4
    $x = 4
    Case $radio_x5
    $x = 5
    Case $radio_x6
    $x = 6
    EndSwitch
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $x & $wert_edit

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit]

    Danke

    Gruß gmmg ;)

  • Einlog Verfarhen auf ein Portal

    • gmmg
    • 8. August 2013 um 15:11

    probiere mal das ...

    [autoit]


    _IECreate ("https://user:passwort@sxx.xxxxwagxxx.de/portal01/myxxx/kbp") ;link geändert

    [/autoit]


    eventuell muss in der registry noch das "FEATURE_HTTP_USERNAME_PASSWORD_DISABLE" aktiviert werden ...

    ;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE]
    ;"iexplore.exe"=dword:00000000

    gruß gmmg

  • AD Ausgabe der Gruppenmitglieder mit Namen und User ID

    • gmmg
    • 8. August 2013 um 13:50

    Hallo,

    anbei ein Script welches ich öfters zum auslesen benutze!

    [autoit]


    #include <D:\Data\scripte\AD_1.3.0.0_Functions\AD.au3> ;Pfad zur AD.au3 muss angepasst werden

    [/autoit][autoit][/autoit][autoit]

    Global $aGroups[1], $aMembers[1], $aProperties[1][2]

    [/autoit][autoit][/autoit][autoit]

    ; Open Connection to the Active Directory
    _AD_Open()
    If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)

    [/autoit][autoit][/autoit][autoit]

    ; Get a sorted list of members for the first group the currently logged on user is a member of
    $aMembers = _AD_GetGroupMembers("team-it") ; hier den AD gruppennamen eintragen AD-Gruppenname
    If @error > 0 Then
    MsgBox(64, "Active Directory Functions - Example 1", "The group has no members")
    Else
    _ArraySort($aMembers, 0, 1)
    _ArrayDisplay($aMembers, "Active Directory Functions - Example 1 - List of members for group")
    EndIf

    [/autoit][autoit][/autoit][autoit]

    For $i = 1 to $aMembers[0]

    [/autoit][autoit][/autoit][autoit]

    $sFQDN = _AD_SamAccountNameToFQDN()

    [/autoit][autoit][/autoit][autoit]

    $aMembers01 = _AD_FQDNToDisplayname($aMembers[$i])
    $sSamAccountName = _AD_FQDNToSamAccountName($aMembers[$i])

    $aProperties = _AD_GetObjectProperties($sSamAccountName)

    For $x = 1 to $aProperties[0][0]
    If $aProperties[$x][0] = "mail" then $mail = $aProperties[$x][1];MsgBox(0,"",$aProperties[$x][1])
    If $aProperties[$x][0] = "objectSid" then $sid = $aProperties[$x][1]
    Next

    [/autoit][autoit][/autoit][autoit]

    ;MsgBox(0,"", $aMembers01)
    ConsoleWrite($aMembers01 & ";"& $sSamAccountName & ";" & $mail & ";" & $sid & @CRLF)

    [/autoit][autoit][/autoit][autoit]

    Next

    [/autoit][autoit][/autoit][autoit]

    ; Close Connection to the Active Directory
    _AD_Close()

    [/autoit]

    gruß gmmg

  • Registry ändern

    • gmmg
    • 29. April 2013 um 13:38

    das heißt, ein supportmitarbeiter startet das script, sonst bräuchtest du das admin nicht!

    gruß gmmg

  • Registry ändern

    • gmmg
    • 26. April 2013 um 15:08

    da kann der user doch aber den drucker, über das tool, selbst setzen! euer support hat doch bestimmt wichtigere sachen zu tun :)
    machst du eine schöne gui und alles läuft!

    das wäre ja der pfad in der registry (als Beispiel PDFCreator)

    [autoit]


    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\"Device"="PDFCreator,winspool,Ne00:"

    [/autoit]

    hier wäre mal ein kleiner ablauf ...

    1. gui mit dropdownmenü erstellen
    2. vorhandene drucker in der registry auslesen (HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices oder Printer Ports)
    3. wert zum setzen in die registry anpassen und ausführen ..

    gruß gmmg

  • Registry ändern

    • gmmg
    • 25. April 2013 um 15:40

    kannst die registry änderung doch aber auch über das logonscript, autostart oder gruppenrichtlinie beim user machen!

    gruß gmmg

  • Combobox Problem

    • gmmg
    • 25. Februar 2013 um 14:49

    auch wenn es schon paar tage her ist!!!

    du kannst im autoit code hier klicken um den zu kopieren!

    gruß gmmg

  • Projekt: CSV-Datei von Homepage downloaden, bearbeiten und in SQL-DB schreiben

    • gmmg
    • 21. Februar 2013 um 10:21

    es wird doch sicherlich ein downloadlink erzeugt oder?

    diesen brauchst du doch nur mit IEAction zu steuern ...

    $oSubmit=_IEGetObjByName($oIE,"submitExample")
    _IEAction($oSubmit,"click")

    eventuell den namen des elementes auch mal mit firefox und dem plugin firebug auslesen!

    gruß gmmg

  • (Excel.au3) Zellenhintergrund und Rahmen formatieren?

    • gmmg
    • 15. Februar 2013 um 10:02

    es gibt da auch die folgende möglichkeit!

    [autoit]


    $oExcel.Columns("A:A").ColumnWidth = "30" ;setze spaltenbreite
    $oExcel.Columns("B:B").ColumnWidth = "50" ;setze spaltenbreite
    $oExcel.Columns("C:C").ColumnWidth = "50" ;setze spaltenbreite
    $oExcel.Range("A1:C1") .Font.Bold = TRUE ; setze schriftgrad
    $oExcel.Range("A1:C1") .Font.Size = 14 ; setze schriftgröße
    $oExcel.Range("A1:D1") .Font.Color = 0xffffff ; setze schriftfarbe
    $oExcel.Range("A1:C1") .Interior.ColorIndex = 43 ; setze Farbe
    $oExcel.Range("A"& $zeile &":C"& $zeile) .Interior.ColorIndex = 27 ; setze Farbe gelb
    $oExcel.Range("A1:C"&$zeile).Borders.LineStyle = 1 ; setze einen Rahmen um die Zellen

    [/autoit]

    gruß gmmg

  • Autoit in eine Zip Datei packen

    • gmmg
    • 8. Februar 2013 um 11:19

    gmmg

    Zitat von Seppi123

    Ja ich werde es mir mal anschauen =)
    War das mit 7Zip nicht so, dass man einfach die EXE in's ScriptDir kopieren kann, und mitliefern kann
    ohne dass der User 7Zip Installiert haben muss?

    ja, die kannst du direkt ins scriptdir packen!

    supi, das es so geklappt hast!
    vlt postet du den scriptabschnitt nochmal für andere, die eventuell auch das problem haben!

    gruß gmmg

  • Autoit in eine Zip Datei packen

    • gmmg
    • 7. Februar 2013 um 16:02

    schau dir mal 7Zip an!

    hier kannst du eventuell die consolen parameter benutzen!
    7z.exe -? da gibts einen parameter -u

    hier ein beispiel zum entpacken
    ;---------unpack-------
    RunWait(@ComSpec & " /c " & $Scriptdir & "\TEMP\7z.exe x " & '"' & $Archive1 & '"' & " -aoa -y -o" & '"' & $Output1 & '"')

    vielleicht hilft dir das weiter ...

    beispiele

    gruß gmmg

  • Zip im Temp Ordner entpacken

    • gmmg
    • 9. Januar 2013 um 12:14

    hier hast du mal ein beispiel wie man mit 7zip was entpackt

    [autoit]


    $Archive = "c:\test.zip"
    $Output = "C:\"
    ;---------unpack-------
    RunWait(@ComSpec & " /c " & @ScriptDir & "\7z.exe x " & '"' & $Archive & '"' & " -aoa -y -o" & '"' & $Output & '"') ; die 7z.exe muss im script verzeichnis liegen

    [/autoit]

    gruß gmmg

  • AD Kennwort freischalten / ändern / Kontooption setzen

    • gmmg
    • 13. Dezember 2012 um 16:20

    water
    das stimmt ... ich benutze das script aber nicht mehr :)

    gruß gmmg

  • AD Kennwort freischalten / ändern / Kontooption setzen

    • gmmg
    • 12. Dezember 2012 um 14:08

    folgend mal ein script, zum ändern des passwortes, aus den funktionen der AD.au3

    die option, "der user muss das pwd beim ersten login ändern", wird immer gesetzt, weil ein default passwort vergeben wird ...

    Spoiler anzeigen
    [autoit]


    #include <D:\Data\scripte\AD_1.2.0_Functions\AD.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <File.au3>
    #include <array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    dim $ans
    $a = 0

    [/autoit] [autoit][/autoit] [autoit]

    ; Open Connection to the Active Directory
    _AD_Open()
    $member01 = _AD_IsMemberOf("team-it",@UserName) ;abfrage, ob user in der gruppe admin ist
    If $member01 = 1 Then
    Else
    MsgBox(0,"","keine Rechte ---> Exit")
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)

    [/autoit] [autoit][/autoit] [autoit]

    Global $iReply = MsgBox(308, "Info", "This script sets the password for a user you specify." & @CRLF & @CRLF & _
    "Are you sure you want to change the Active Directory?")
    If $iReply <> 6 Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    ; Enter user and password to change
    #region ### START Koda GUI section ### Form=

    [/autoit] [autoit][/autoit] [autoit]

    Global $Form1 = GUICreate("Reset Password", 414, 124, 251, 112)
    GUICtrlCreateLabel("User account (sAMAccountName or FQDN):", 8, 10, 231, 17)
    GUICtrlCreateLabel("New password:", 8, 42, 121, 17)
    Global $IUser = GUICtrlCreateInput("", 241, 8, 159, 21)
    Global $IPassword = GUICtrlCreateInput("defaultpwd", 241, 40, 159, 21, 0x0800)
    Global $BOK = GUICtrlCreateButton("Change Password", 8, 72, 121, 33)
    $label = GUICtrlCreateLabel("4444", 170, 83, 150, 100)
    Global $check_name = GUICtrlCreateButton("Check Name", 328, 72, 73, 33, BitOR($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON)) ; prüft den namen im AD
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1

    [/autoit] [autoit][/autoit] [autoit]

    Global $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $check_name
    Global $sUser = GUICtrlRead($IUser)
    $sDisplayName = _AD_FQDNToDisplayname($sUser)
    GUICtrlSetData($label, $sDisplayName)
    Case $BOK
    Global $sUser = GUICtrlRead($IUser)
    $ans = Random(10000000,99999999,1)
    ;MsgBox (0,"",$ans)
    $aUser = _AD_GetUserGroups($sUser) ;abfrage der ad gruppe
    ;_ArrayDisplay($aUser)
    For $i = 1 to $aUser[0]
    ;MsgBox(0,"", $aMembers01)
    ;MsgBox(0,"",_AD_FQDNToSamAccountName($aUser[$i]))
    $result = StringInStr(_AD_FQDNToSamAccountName($aUser[$i]), "DP_all_user") abfrage ob der user der gruppe "DP_all_user" angehört, wenn ja, kann pwd geändert werden!
    ;MsgBox(0, "Search result:", $result)

    If $result <> 1 Then
    $a = 0
    Else
    $a = 1
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    If $a <> 1 Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    ;MsgBox(0,"",$bcode & " " & $ans)
    If _AD_IsObjectLocked($sUser) Then
    MsgBox(64, "Active Directory Functions", "User account '" & $sUser & "' is locked")
    ; unlock Object
    Global $iValue = _AD_UnlockObject($sUser)
    If $iValue = 1 Then
    MsgBox(64, "Active Directory Functions - Example 1", "Object '" & $sUser & "' successfully changed")
    ElseIf @error = 1 Then
    MsgBox(64, "Active Directory Functions - Example 1", "Object '" & $sUser & "' does not exist")
    Else
    MsgBox(64, "Active Directory Functions - Example 1", "Return code '" & @error & "' from Active Directory")
    EndIf
    Else
    MsgBox(64, "Active Directory Functions", "User account '" & $sUser & "' is not locked")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $sUser = _AD_SamAccountNameToFQDN($sUser)
    ;MsgBox(0,"2","test")
    Global $sPassword = GUICtrlRead($IPassword)
    ExitLoop
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ; Set the password
    Global $iValue = _AD_SetPassword($sUser, $sPassword, 1)
    If $iValue = 1 Then
    MsgBox(64, "Active Directory Functions - Example 1", "Password for user '" & $sUser & "' successfully changed")
    ElseIf @error = 1 Then
    MsgBox(64, "Active Directory Functions - Example 1", "User '" & $sUser & "' does not exist")
    Else
    MsgBox(64, "Active Directory Functions - Example 1", "Return code '" & @error & "' from Active Directory")
    EndIf
    Exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; Close Connection to the Active Directory
    _AD_Close()

    [/autoit]

    gruß gmmg

  • MySQL UDF - mit libmySQL.dll (kein ODBC)

    • gmmg
    • 2. Oktober 2012 um 09:40

    Taz77

    lass dir den insert befehl mal mit consolewrite ausgeben und dann führe das ergebnis der ausgabe mal mit dem query browser testweise aus!

    gruß gmmg

  • Software aus Registry auslesen, in Textdatei schreiben und filtern

    • gmmg
    • 21. September 2012 um 16:30

    daten ins array schreiben und aus dem array dann gefiltert in die textdatei ...

  • mstsc / rdp tool

    • gmmg
    • 21. September 2012 um 11:53

    und wie connectest du auf ggf die admin bzw. consolen session?

  • mstsc / rdp tool

    • gmmg
    • 20. September 2012 um 15:27

    das stimmt natürlich, weil solche parameter in der rdp file gespeichert werden ...

    na du wirst dir schon was basteln :) kannst aber auch den "Remote Desktop Connection Manager" von microsoft benutzen!
    http://www.microsoft.com/en-us/download…s.aspx?id=21101

    gruß gmmg

  • mstsc / rdp tool

    • gmmg
    • 20. September 2012 um 13:10

    @jNizM
    damit kannst du auch alle clients auslesen!
    ist ja nur ein filter den man anpassen oder hinzufügen muss!

    ich weiß ja nicht ob ihr das active directory benutzt!
    theoretisch kannst du das so dynamisch auch mit gruppen steuern!
    alle clients in einen gruppe, diese auslesen und dann hast du deine auflistung :)

    oder die server oder pc namen in eine datei speichern, und diese auslesen, da ist es überflüssig, da für jede verbindung eine eigene rdp datei zu speichern! die parameter kannst du auch übergeben!

    gruß gmmg

  • mstsc / rdp tool

    • gmmg
    • 19. September 2012 um 15:43

    hallo jNizM,

    folgend mal ein script, welches die server dynamisch aus dem Active Directory ausliest und dann dem RDP Tool hinzufügt! in meinem beispiel nur die aus einer bestimmten OU!

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>
    #include <AD.au3>
    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $avArray [1], $sString

    [/autoit] [autoit][/autoit] [autoit]

    TrayTip("", "Search for Server", 5, 1)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _AD_Open()

    [/autoit] [autoit][/autoit] [autoit]

    $sOU = "OU=standort1,DC=domäne,DC=int"

    [/autoit] [autoit][/autoit] [autoit]

    $aObjects = _AD_GetObjectsInOU($sOU, "(objectcategory=Computer)", 2, "cn,operatingsystem")

    [/autoit] [autoit][/autoit] [autoit]

    If @error > 0 Then
    MsgBox(64, "", "Nichts gefunden")
    Else

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $aObjects[0][0]
    ;MsgBox(0,"", $aObjects[$i][1])
    $server = StringLeft ($aObjects[$i][1],14)
    ;MsgBox(0,"",$server)
    IF $server = "Windows Server" Then
    ;MsgBox(0,"",$aObjects[$i][0])
    _ArrayAdd($avArray, $aObjects[$i][0])
    _ArraySort($avArray)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Next
    ;_ArrayDisplay($avArray)
    ;MsgBox(0,'Max Index String value', _ArrayMaxIndex($avArray, 0, 1))

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;_ArrayDisplay($aObjects)
    EndIf
    _AD_Close()

    [/autoit] [autoit][/autoit] [autoit]

    ;TrayTip("", "", 5, 1)
    TrayTip("clears any tray tip","",0)

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $GUI = GUICreate("RDP Tool 1.0", 190, 439, 235, 163)
    ;$ServerList = GUICtrlCreateList("", 20, 20, 150, 383)
    $ServerList = _GUICtrlListBox_Create($GUI,"", 20, 20, 150, 383)
    ;GUICtrlSetData($ServerList, $sString)
    $Connect = GUICtrlCreateButton("Connect", 30, 402, 60, 20) ;Button Connect
    $Checkbox1 = GUICtrlCreateCheckbox("Console", 105, 412, 193, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Admin", 105, 396, 193, 17)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To _ArrayMaxIndex($avArray, 0, 1)
    ;MsgBox(0,"",$avArray[$i])
    ;$sString &= $avArray[$i] & "|"
    ; --- Add files---
    _GUICtrlListBox_BeginUpdate($ServerList)
    _GUICtrlListBox_InsertString($ServerList, $avArray[$i],0)
    _GUICtrlListBox_EndUpdate($ServerList)
    _GUICtrlListBox_Sort($ServerList)
    ;-----------------
    Next

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Connect

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;$Server = GUICtrlRead($ServerList)
    $Selected = _GUICtrlListBox_GetCurSel($ServerList)
    $Server = _GUICtrlListBox_GetText($ServerList, $Selected)

    [/autoit] [autoit][/autoit] [autoit]

    IF $Selected = -1 Then
    MsgBox(64,"", "please, select server!")
    Else

    [/autoit] [autoit][/autoit] [autoit]

    $console = GUICtrlRead($Checkbox1) ;connect as console yes/now
    ;MsgBox(0, "gewählt", $console)
    $admin = GUICtrlRead($Checkbox2) ;connect as console yes/now
    ;MsgBox(0, "gewählt", $admin)

    [/autoit] [autoit][/autoit] [autoit]

    If $console = 4 Or $admin = 4 Then
    Run ("mstsc.exe /v:" & $Server)
    Else
    If $console = 1 Then
    ;%SystemRoot%\system32\mstsc.exe /console
    Run ("mstsc.exe /Console /v:" & $Server)
    Else
    If $admin = 1 Then
    ;%SystemRoot%\system32\mstsc.exe /admin
    Run ("mstsc.exe /Admin /v:" & $Server)
    EndIf
    EndIf
    EndIf
    ;-----------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Case $Checkbox1

    [/autoit] [autoit][/autoit] [autoit]

    ;checkbox überprüfen und anhand des rückgabewertes sms freischalten oder auch nicht
    If GUICtrlRead($Checkbox1, $GUI_CHECKED)= $GUI_CHECKED Then
    $cb1 = GUICtrlRead($Checkbox1, $GUI_CHECKED)
    ;$cb2 = GUICtrlRead($Checkbox2, $GUI_UNCHECKED)
    ;GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
    Else
    $cb1 = GUICtrlRead($Checkbox1, $GUI_UNCHECKED)= $GUI_UNCHECKED
    ;$cb2 = GUICtrlRead($Checkbox2, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
    EndIf
    Case $Checkbox2

    [/autoit] [autoit][/autoit] [autoit]

    ;checkbox überprüfen und anhand des rückgabewertes sms freischalten oder auch nicht
    If GUICtrlRead($Checkbox2, $GUI_CHECKED)= $GUI_CHECKED Then
    $cb2 = GUICtrlRead($Checkbox2, $GUI_CHECKED)
    ;$cb2 = GUICtrlRead($Checkbox2, $GUI_UNCHECKED)
    ;GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
    Else
    $cb2 = GUICtrlRead($Checkbox2, $GUI_UNCHECKED)= $GUI_UNCHECKED
    ;$cb2 = GUICtrlRead($Checkbox2, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    gruß gmmg

    Bilder

    • rdp_tool.gif
      • 14,59 kB
      • 196 × 464

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™