JRSmile Posted March 3, 2009 Share Posted March 3, 2009 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #NoTrayIcon if $cmdline[0] = 1 Then ConsoleWrite(_SAM2DisplayName($cmdline[1])) Func _SAM2DisplayName($3LC) Local $strdisplayName = "not found" Local $objCommand = ObjCreate("ADODB.Command") Local $objConnection = ObjCreate("ADODB.Connection") Local $objRootDSE = ObjGet("LDAP://RootDSE") $objConnection.Provider = "ADsDSOObject" $objConnection.Open("Active Directory Provider") $objCommand.ActiveConnection = $objConnection Local $strBase = "<GC://" & $objRootDSE.Get("defaultNamingContext") & ">" Local $strFilter = "(sAMAccountName=" & $3LC & ")" Local $strAttributes = "displayName" Local $strQuery = $strBase & ";" & $strFilter & ";" & $strAttributes & ";subtree" $objCommand.CommandText = $strQuery $objCommand.Properties("Page Size") = 100 $objCommand.Properties("Timeout") = 30 $objCommand.Properties("Cache Results") = False $ADS_SCOPE_SUBTREE = 2 $objCommand.Properties("searchscope") = $ADS_SCOPE_SUBTREE Local $objRecordSet = $objCommand.Execute While Not $objRecordSet.EOF $strdisplayName = $objRecordSet.Fields("displayName").value $objRecordSet.MoveNext WEnd $objConnection.Close $objConnection = "" $objCommand = "" $objRecordSet = "" $objRootDSE = "" Return $strdisplayName EndFunc ;==>_SAM2DisplayName $a=StringSplit("547275737420796F757220546563686E6F6C75737421","") For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4) Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI" Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile; MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-) Link to comment Share on other sites More sharing options...
amokoura Posted March 26, 2009 Share Posted March 26, 2009 Works brilliantly, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now