
Vaeb
Active Members-
Posts
67 -
Joined
-
Last visited
Everything posted by Vaeb
-
it works now. no more help needed
-
Here is the link to the ad library: http://www.autoitscript.com/forum/index.ph...amp;showfile=66 What do you mean with "working code"? The code isn't working, that's the problem. Do you want me to copy&paste all the functions i use into my code?
-
you need the adfunctions.au3 library.
-
The code in the included looks like this:Func _ADGetGroupMembers(ByRef $members, $groupdn, $sort = 0) ;If _ADObjectExists($group) = 0 Then Return 0 Local $oUsr, $objCommand, $groups $objCommand = ObjCreate("ADODB.Command") $objCommand.ActiveConnection = $objConnection $objCommand.Properties ("Searchscope") = 2 Dim $members[1] $i = 0 While 1 $rangemodifier = $i * 1000 $range = "Range=" & $rangemodifier & "-" & $rangemodifier + 999 $strCmdText = "<LDAP://" & $strHostServer & "/" & $groupdn & ">;;member;" & $range & ";base" $objCommand.CommandText = $strCmdText $objRecordSet = $objCommand.Execute $membersadd = $objRecordSet.fields (0).Value If $membersadd = 0 Then ExitLoop ReDim $members[UBound($members) + 1000] For $j = $rangemodifier + 1 To $rangemodifier + 1000 $members[$j] = $membersadd[$j - $rangemodifier - 1] Next $i += 1 $objRecordSet.Close WEnd $rangemodifier = $i * 1000 $range = "Range=" & $rangemodifier & "-*" $strCmdText = "<LDAP://" & $strHostServer & "/" & $groupdn & ">;;member;" & $range & ";base" $objCommand.CommandText = $strCmdText $objRecordSet = $objCommand.Execute $membersadd = $objRecordSet.fields (0).Value ReDim $members[UBound($members) + UBound($membersadd) ] For $j = $rangemodifier + 1 To $rangemodifier + UBound($membersadd) $members[$j] = $membersadd[$j - $rangemodifier - 1] Next $objRecordSet.Close $objCommand = 0 $objRecordSet = 0 $members[0] = UBound($members) - 1 If $sort = 1 Then _ArraySort($members, 0, 1) EndIf Return 1 EndFunc ;==>_ADGetGroupMembers
-
The reason was that I included adfunctions.au3 and also copied one function. but now I get another error. this is my code: #include "adfunctions.au3" $member = "someone" _ADGetGroupMembers($member, "Standard") this is the error: C:\Program Files\AutoIt3\Include\adfunctions.au3 (418) : ==> Object referenced outside a "With" statement.: $membersadd = $objRecordSet.fields (0).Value $membersadd = $objRecordSet.fields (0)^ ERROR
-
What's wrong with this Function calling? $member = "someone" _ADGetGroupMembers($member, "Standard") Func _ADGetGroupMembers(ByRef $members, $groupdn, $sort = 0) I get this error: ERROR: _ADGetGroupMembers() already defined. Func _ADGetGroupMembers(ByRef $members, $groupdn, $sort = 0)
-
lol it works^^ sorry, i thougt that i have to change the variables
-
I'm not trying to find out if a user exists, I am just trying to use a random AD function to see if I get it working. what did I do wrong at the example i posted at the top? I am already using the AD Explorer. The SAMAccountname is correct...
-
In this case i want to see if a user exists.
-
Hello Guys I am trying to get into Active Directory changing with AutoIt. I don't really know how i have to define the variables to get it working. I just started but it doesnt work. It gets an error at this one: Global $strDNSDomain = $objRootDSE.Get ("local.area.de") Can you tell me how to i have to define the Variables to get it working? Global $objConnection = ObjCreate("ADODB.Connection") ; Create COM object to AD $objConnection.ConnectionString = "Provider=ADsDSOObject" $objConnection.Open ("Active Directory Provider") Global $objRootDSE = ObjGet("LDAP://RootDSE") Global $strDNSDomain = $objRootDSE.Get ("local.area.de") ; Retrieve the current AD domain name Global $strHostServer = $objRootDSE.Get ("server7.local.area.de") ; Retrieve the name of the connected DC Global $strConfiguration = $objRootDSE.Get ("ConfigurationNamingContext") ; Retrieve the Configuration naming context Global $loggedonusergroups ; populate this with the logged on user groups in your own app Func _ADObjectExists($object) $strQuery = "<LDAP://" & $strHostServer & "/" & $strDNSDomain & ">;(sAMAccountName=" & $object & ");ADsPath;subtree" $objRecordSet = $ObjConnection.Execute ($strQuery) ; Retrieve the FQDN for the group, if it exists If $objRecordSet.RecordCount = 1 Then $objRecordSet = 0 Return 1 Else $objRecordSet = 0 Return 0 EndIf EndFunc ;==>_ADObjectExists _ADObjectExists("umueller")
-
help pls
-
Because I want to use functions like "_WordDocFindReplace".
-
Hello guys! I used the Microsoft Word lib of this Topic: http://www.autoitscript.com/forum/index.php?showtopic=30461 My problem is, that there are opening one empty word document and the document i want to open, when i use this code: $oWordApp = _WordCreate ("") $oDoc = _WordDocOpen ($oWordApp, "H:\Documents\test.doc") How can I only open the test.doc? Greets Vaeb
-
Is there a way to open a word without open a new document?
-
*push*
-
I really have to thank you for your help! No, I get exactly the same error. When I try a script of the German forum, I get this Error: "@ERROR = 4 - Unable to create socket" Edit: I was talking about the last script here: http://www.autoit.de/index.php?page=Thread&threadID=5947
-
I changed ssl to 1. It still doesn't work. I commented the port 25 because I used the gmail port 465. Even if I use smtp port 25 it doesn't work...
-
Hi guys! I'm trying to send an email with my google account. This is the code i used (It's not the real email adress^^ but the email adresses i used exist!): $s_SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED $s_FromName = "Name" ; name from who the email was sent $s_FromAddress = "asdf@gmail.com" ; address from where the mail should come $s_ToAddress = "asdf@asdf.ch" ; destination address of the email - REQUIRED $s_Subject = "Userinfo" ; subject from the email - can be anything you want it to be $as_Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $s_AttachFiles = "" ; the file you want to attach- leave blank if not needed $s_CcAddress = "" ; address for cc - leave blank if not needed $s_BccAddress = "" ; address for bcc - leave blank if not needed $s_Username = "asdf" ; username for the account used from where the mail gets sent - Optional (Needed for eg GMail) $s_Password = "asdf" ; password for the account used from where the mail gets sent - Optional (Needed for eg GMail) ;$IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 Btw. I used this script as template: http://www.autoitscript.com/forum/index.ph...860&hl=smtp And when i run the script i get this error: Error code: 2 Rc:The transport failed to connect to the server. I hope you can help me Greets Vaeb
-
meow
-
The problem is: I really don't know, what to write as "filename" or "classname". Can anyone please make an example? I really don't get it...
-
What have i got to write into the ObjGet function? $objConnection = ObjGet("LDAP://server")
-
Hi guys! I would like to read the Attribute "Location" of a printer. This is how my script looks:
-
Can I use parts of your script for my own project? greets
-
How should the script look like when I use 2 buttons? This is my try to get two buttons: #include <GuiConstants.au3> Global $hWnd Global $Width = 400, $Height = $Width Global $Good = 1 $hWnd = GUICreate('MyButton', $Width, $Height) $og2 = GUICreate("Obergeschoss 2", 124, 32, 280, 830, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hWnd) $obg2 = GUICtrlCreatePic(@ScriptDir & "\System\Unused Buttons\GlossyRoundButton.bmp", 0, 0, 0, 0) $og1 = GUICreate("Obergeschoss 1", 124, 32, 130, 830, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hWnd) $obg1 = GUICtrlCreatePic(@ScriptDir & "\System\Unused Buttons\GlossyRoundButton.bmp", 0, 0, 0, 0) GUISetState(@SW_SHOW, $og1) GUISetState(@SW_SHOW, $og2) GUISetState(@SW_SHOW, $hWnd) While 1 $Msg = GUIGetMsg(1) Switch $Msg Case $Msg[0] = $obg1 MsgBox(0,"I want","2 buttons!",2) WinActivate('MyButton', '') Case $Msg[0] = $obg2 MsgBox(0,"I do","too!",2) WinActivate('MyButton', '') Case $Msg[0] = $GUI_EVENT_CLOSE Exit EndSwitch WEnd The script opens msgbox1 before i click on button 1... why? Thanks Valery and Valuater Greets Vaeb