
rikho
Active Members-
Posts
40 -
Joined
-
Last visited
About rikho
- Birthday 05/22/1973
rikho's Achievements

Seeker (1/7)
1
Reputation
-
JiBe reacted to a post in a topic: Connect a AD from a computer of an other domain
-
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
Below the debug message error ======================================================== COM Error Encountered in Auditgroup_OK.au3 AD UDF version = 1.3.0 @AutoItVersion = 3.3.8.1 @AutoItX64 = 0 @Compiled = 0 @OSArch = X64 @OSVersion = WIN_7 Scriptline = 632 NumberHex = 80020009 Number = -2147352567 WinDescription = Description = La propriété répertoire n’est pas présente dans le cache. Source = Active Directory HelpFile = HelpContext = 0 LastDllError = 0 ======================================================== What does that mean ? -
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
no problem with all groups with description if no desciption C:\Program Files (x86)\AutoIt3\Include\AD.au3 (632) : ==> The requested action with this object has failed.: Local $sAD_Result = $oAD_Object.Get($sAD_Attribute) Local $sAD_Result = $oAD_Object.Get($sAD_Attribute)^ ERROR Do you know how to test description attribute ? -
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
i did it cause when i pass hem to _AD_Open i got somes error. but it's now ok it work's perfectly regard"s Rikho -
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
Do you set variable $sAD_UserId anywhere in your script? Yes i defined it in the AD.AU3 64 bits OS Global $sAD_HostServer = 'MYDC.MY.DOMAIN' Global $sAD_Configuration Global $sAD_UserId = 'myuser@my.domain' Global $sAD_Password = '@Mypassword1234' i've change this with Global $sAD_DNSDomain = @LogonDNSDomain Global $sAD_HostServer = @LogonServer Global $sAD_Configuration Global $sAD_UserId Global $sAD_Password To use current credential actually i haven't got any error , anyway i can not _arraydisplay ($groupdescription) i'm so stupid it mean the result is not an array ... am i tired ? -
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
WATER wrote : It would be interesting to know wich function triggers the error. --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop C:\Program Files (x86)\AutoIt3\Include\[color=#ff0000][b]AD.au3 (4378) : ==> Variable must be of type "Object".:[/b][/color] Return $__oAD_OpenDS.OpenDSObject($sAD_FQDN, $sAD_UserId, $sAD_Password, $__bAD_BindFlags) Return $__oAD_OpenDS^ ERROR ->10:19:39 AutoIT3.exe ended.rc:1 Which version of the UDF do you use (can be found in the header lines?) ; #INDEX# ======================================================================================================================= Title .........: Active Directory Function Library ; AutoIt Version : 3.3.9.2 or later (because of _Date_Time_SystemTimeToDateTimeStr and the latest in COM error handling) ; UDF Version ...: 1.3.0.0 ; Language ......: English Can you remove $sAD_DNSDomain, $sAD_HostServer, $sAD_Configuration from your script? They are defined and used in the UDF itself. Done. but same error appear. another question how to get the error return value is the Function Returns value section of the help test : ; Return values .: Success - Value for the given attribute ; Failure - "", sets @error to: ; |1 - $sAD_Object does not exist ; |2 - $sAD_Attribute does not exist for $sAD_Object. @Extended is set to the error returned by LDAP unfortunaltly, if got a error message, before i can do a msgbox of @error Grrr.... -
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
First of all thank you for responding Water check my AD.AU3 version here ; #INDEX# ======================================================================================================================= ; Title .........: Active Directory Function Library ; AutoIt Version : 3.3.9.2 or later (because of _Date_Time_SystemTimeToDateTimeStr and the latest in COM error handling) ; UDF Version ...: 1.3.0.0 ; Language ......: English Desctiption => doesn't exist anyway $groupe = FileReadLine($fopen) $groupeFQDN = _ad_SamAccountNameToFQDN($groupe) $result = _AD_GetGroupMembers($groupeFQDN) Local $groupdescription = _AD_GetObjectAttribute($groupeFQDN, 'description') Same error --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop C:\Program Files (x86)\AutoIt3\Include\AD.au3 (4378) : ==> Variable must be of type "Object".: Return $__oAD_OpenDS.OpenDSObject($sAD_FQDN, $sAD_UserId, $sAD_Password, $__bAD_BindFlags) Return $__oAD_OpenDS^ ERROR is there something wrong ? -
Howto get group description with AD.AU3
rikho replied to rikho's topic in AutoIt General Help and Support
desctiption or description ? i mean my error is ==> Variable must be of type "Object".: What does that mean ? i call it with bad arguments or i can't call this argument ? -
Hello, i would like to get some AD information i get a csv file with the group list to proceed my audit. i want to generate an csv file with : AD.AU3 groupname;descriptiongroup;user0;user1,user2,user3... etc... i can give more information if requierd ; #FUNCTION# ============== ; Name...........: _AD_GetObjectAttribute ; Description ...: Returns the specified attribute for the named object. ; Syntax.........: _AD_GetObjectAttribute($sAD_Object, $sAD_Attribute) SOURCE CODE : #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=AEP\Auditgroup_OK.exe #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <AD.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <file.au3> #include <TreeViewConstants.au3> #include <GuiListView.au3> #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 365, 147, 192, 114) $Button1 = GUICtrlCreateButton("fichier", 280, 8, 75, 25) $Label1 = GUICtrlCreateLabel("--", 8, 48, 172, 17) $Label2 = GUICtrlCreateLabel("--", 192, 48, 164, 17) $Label3 = GUICtrlCreateLabel("click scan => ", 196, 112, 75, 25) $Progress2 = GUICtrlCreateProgress(8, 88, 350, 16) $Button2 = GUICtrlCreateButton("open", 8, 112, 75, 25) $Button3 = GUICtrlCreateButton("Scan", 280, 112, 75, 25) $listgroup = GUICtrlCreateInput(@ScriptDir & '\listgoup.csv', 8, 8, 265, 21) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### Dim $aRecords Global $GetFolerpath, $ListeTable1, $SUserId, $sPassword, $sAD_DNSDomain, $sAD_HostServer, $sAD_Configuration, $liste Dim $hListView While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 getfile() Case $Button3 scan() EndSwitch WEnd Func getfile() Local $message = "Selectionner un fichier contenant la liste des groupes" Local $var = FileOpenDialog($message, @ScriptDir & "\", "Grouplist (*.csv)", 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else GUICtrlSetData($listgroup, $var) EndIf EndFunc ;==>getfile Func scan() FileDelete(@ScriptDir & '\audit_groupe.csv') _AD_Open() GUICtrlSetData($Label3, 'EN COURS') Local $groupesamaccount, $countlogline $tt = 0 $countline = _FileCountLines(@ScriptDir & '\listgoup.csv') $fopen = FileOpen(@ScriptDir & '\listgoup.csv', 0) While 1 $groupe = FileReadLine($fopen) If @error = -1 Then ExitLoop $tt = $tt + 1 $p2 = ($tt * 100) / ($countline) GUICtrlSetData($Progress2, $p2) GUICtrlSetData($Label1, $groupe) $groupeFQDN = _ad_SamAccountNameToFQDN($groupe) $result = _AD_GetGroupMembers($groupeFQDN) ;~ _ArrayDisplay($result) GUICtrlSetData($Label2, $result[0]) $filetemp = FileOpen(@ScriptDir & '\audit_groupe.csv', 1) Local $description = 'description' ;~ MsgBox(64, '$groupe & $tt & $result[0] ', $groupeFQDN & ' ' & $tt & ' ' & $result[0], 1000) Local $groupdescription = $sAD_Object($groupeFQDN, 'desctiption') MsgBox(64, '$groupedescription', $groupdescription, 1000) If $result[0] = 0 Then FileWriteLine($filetemp, $groupeFQDN & '; no member') Else For $x = 1 To $result[0] ;~ MsgBox(64, '$result[$x] ', $result[$x], 1000) ;~ local $FQDN = $result[$x] ;~ $usertowrite = _AD_FQDNToDisplayname($FQDN) ;~ MsgBox(64,'',$usertowrite,1000) If $x = 1 Then FileWriteLine($filetemp, $groupe & ';' & $result[$x]) Else FileWriteLine($filetemp, ' ' & ';' & $result[$x]) EndIf Next EndIf FileClose($filetemp) Sleep(500) WEnd _AD_Close() GUICtrlSetData($Label3, 'TERMINE') EndFunc ;==>scan ERROR >Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\DEV\deleteuserlist\AEP\Auditgroup_OK.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop C:\Program Files (x86)\AutoIt3\Include\AD.au3 (4378) : ==> Variable must be of type "Object".: Return $__oAD_OpenDS.OpenDSObject($sAD_FQDN, $sAD_UserId, $sAD_Password, $__bAD_BindFlags) Return $__oAD_OpenDS^ ERROR ->19:07:09 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 6.205
-
Function RunAsSet unknown in autoit v3.3.4.0
rikho replied to rikho's topic in AutoIt General Help and Support
i'm so noob... Thank's forget about it plz... -
Function RunAsSet unknown in autoit v3.3.4.0
rikho posted a topic in AutoIt General Help and Support
Hi all, this RunAsSet as disapear...? This is my old code, i need to translate it to launch my program with another user. with 3.3.4.0 i got an error on compilation to RunAsSet call... -> unknown function...(strange) is someone can explain to me, why, i will be less idiot tomorrow Regards Rikho #include <GUIConstants.au3> #include <Array.au3> #Region $Form1 = GUICreate("ActiveDirectory_usertool_v0.1", 282, 108, 193, 125) $Combo1 = GUICtrlCreateCombo("Selection", 80, 40, 121, 125) GUICtrlSetData(-1, "DOMAIN1|DOMAIN2|DOMAIN3") $Label1 = GUICtrlCreateLabel("Plz select a domain", 8, 8, 268, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Run", 72, 64, 137, 33, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 launch() EndSwitch WEnd func launch() ;~ if $cmdLine[0] > 0 then ;~ $domain = $cmdLine[1] ;~ else ;~ msgbox( $domain = GUICtrlRead($Combo1) If $domain = 'DOMAIN1' Then RunAsSet('%username%', '%domain%', '%password%', 2) Run(@ScriptDir & '\ActiveDirectory_usertool_v0.1.exe %selected_domain%', "", @SW_MAXIMIZE) Else MsgBox(4096, '', "Wrong domain", 10000) EndIf EndFunc -
program with command line parameter
rikho replied to rikho's topic in AutoIt General Help and Support
Thx to all ^^ -
Hello, i want to run a program i've made with a command line parameter but i don't know wich function use to do it my program allow you to "unlock or reset password" for user domain account on different domain. I get : run.exe and Ad_unlocker.exe run.exe (it ask you : user, password, domain) then it runas Ad_unlocker.exe with Ad_unlocker.exe ask to confirm the domain at start i want to make it more easy to use, i want to launch run.exe with domain argument ex : run.exe -domain NTDOM but how Ad_unlocker.exe can understand that ? is there a function to do this ? regards.
-
Run it with a user of an other domain...
rikho replied to rikho's topic in AutoIt General Help and Support
There is absolutly no problem it work's if u let all file on local drive >_< -
Hi all This script work's perfectly #include <Array.au3> Dim $strDomain Do $strDomain = inputbox( "Information", "Domain : " ) until $strDomain <> "" ListUsers( $strDomain ) Func ListUsers( $strDomain ) $objComputer = ObjGet("WinNT://" & $strDomain ) $objComputer.Filter = _ArrayCreate( "User" ) For $objUser In $objComputer $1 = 'Name: ' & $objUser.Name & @CRLF & "Fullname: " & $objUser.Fullname & @CRLF & 'IsAccountLocked: ' & $objUser.IsAccountLocked $2 = "AccountDisabled: " & $objUser.AccountDisabled $report = $1 & @CRLF & $2 msgbox(4096,'pause',$report,10000) Next EndFunc Now it is compiled, and i need to run it from my computer in the Domain A but i need to query the AD on Domain B... i use this script to run it : RunAsSet($usr, $Domain, $pass) Run(@ScriptDir & "\ad_devtest_2.exe", "", @SW_MAXIMIZE) unfortunaltly i can not run this program with an account from another domain. is there a system to do that ?
-
how to get all attribute of an object
rikho replied to rikho's topic in AutoIt General Help and Support
Thank you ^^