Valnurat

Read of an AD attribute of Octet String syntax

5 posts in this topic

How do you read AD attribute: thumbnailPhoto and show the picture? It is a syntax of octet string.

I have no code for this.


Yours sincerely

Kenneth.

Share this post


Link to post
Share on other sites



Maybe this and the following posts help:

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-05-09 - Version 1.2.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I read it and I could see some code to retrive data, but how do I show the picture?

 

#include <AD.au3>
#include <File.au3>

_AD_Open()
If @error Then Exit
$ThumbNailPhoto = _AD_GetObjectAttribute(@UserName, "thumbnailPhoto")
If @error Then $ThumbNailPhoto = ""
_AD_Close()

 


Yours sincerely

Kenneth.

Share this post


Link to post
Share on other sites

No idea :(
But there are a lot of C# or PowerShell examples available on the web. Maybe one of them fits your needs.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-05-09 - Version 1.2.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

From what I was reading, the file format is jpg, so I would think it would be possible to either write to a file and/or use GDI+ to display it...but I also don't have the know-how to create a script (to do the GDI+ part at least.)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • jmstubiera
      Toggle a form state
      By jmstubiera
      Hello team,
      Any ideas on how I can have a combo box change it's guistate. Below is my code:
      $comboBox = GUICtrlCreateCombo("-- Select Type --", 280, 104, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_DISABLED)) GUICtrlSetData(-1, "One|Two|Three|Four") So basically, once I click on a button, the $combo box's state will change from being disabled to being active again.
       
      Thanks in advance.
    • FMS
      XML search get change settings.
      By FMS
      Hello ,
      I've the following problem and hope somebody can push me in the right direction or have a good example on how to do it.
      The problem is :I want to search / select / change /check a XML setting in a XML file.
      The example XML file is as following :
      <Configuration> <Categories> <Category Name="default"> <SubCategories> <SubCategory Name="defaultsettings"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="defaultname" /> <Setting Name="cpuspeed" TypeName="System.String" Value="false" /> <Setting Name="cmptemp" TypeName="System.String" Value="false" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="" /> </Settings> </SubCategory> </SubCategories> </Category> <Category Name="settings"> <SubCategories> <SubCategory Name="comp1"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="comp1" /> <Setting Name="cpuspeed" TypeName="System.String" Value="true" /> <Setting Name="cmptemp" TypeName="System.String" Value="false" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="12" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="" /> </Settings> </SubCategory> <SubCategory Name="comp2"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="comp2" /> <Setting Name="cpuspeed" TypeName="System.String" Value="false" /> <Setting Name="cmptemp" TypeName="System.String" Value="true" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="9" /> </Settings> </SubCategory> </SubCategories> </Category> </Categories> </Configuration> In this XML file I want to :
      -search if subcategory whit the name "comp3" exists
      -if exist change of setting "cpuspeed" value to false
      -if not exist make a new subcategory "comp3" whit the default settings from subcategory "default settings"
      what i have this far is :
      Func xml_test1() Dim $return[0] Local $file = @ScriptDir & "\test.xml" FileOpen($file, $FO_READ) _FileReadToArray($file,$return) FileClose($file) msg("",$return[28]) msg("",$return[29]) EndFunc func xml_test2() Local $file = @ScriptDir & "\test.xml" Local $oXML = ObjCreate("Microsoft.XMLDOM") ;~ $oXML.load("D:\___BUILDS___\___SRMT___\test.xml") $oXML.load($file) $oOther= $oXML.SelectSingleNode("//Configuration/Categories/Category/SubCategories/SubCategory/Settings/Setting") ; or //other ConsoleWrite("$oOther.text=[" & $oOther.text & "]" & @CRLF) EndFunc i know it is not enough what I'm trying to do but I'm realy stuk in what to do next.
      I've searched in the XML.udf but could not find in the examples what to do what i want to do.
      The things what i found are about <settings>false</settings> writing style of XML and not the way I've the XML.
      (or I'm reading it wrong)
      Is there somebody who can help me on mine way or has a good example script?
      Thanks in advanced
       
    • genius257
      Is it possible to throw an error in a ScriptControl object, via AutoIt
      By genius257
      First of all I've been searching on the forum, and while there's been done something like this with: https://www.autoitscript.com/forum/topic/141004-comobject-proxy-seamless-windows-script-control-autoitobj/
      I could not find any solution to my predicament.
       
      Is it possible to throw an error in a ScriptControl object, via AutoIt?
      I have a script, where AutoIt calls ScriptControl:JavaScript which in turn calls AutoIt.
      However i would like to be able to make AutoIt invoke an exception within ScriptControl, if the called functionality fails.
      Here's some code for reference:
      #AutoIt3Wrapper_Run_AU3Check=n #include-once #include "AutoitObject.au3" #include <WinAPIDiag.au3> $oJS = ObjCreate("ScriptControl") $oJS.Language = "JScript" $oJS.TimeOut = 0; A value of 0 means that the ScriptControl will monitor the execution of the script and will trigger the Timeout event if it determines that the script is hung. _AutoItObject_Startup() $oAutoIt = _AutoItObject_Create() _AutoItObject_AddMethod($oAutoIt, "Execute", "_Execute", False) $oJS.AddObject("AutoIt", $oAutoIt, True) OnAutoItExitRegister("_CleanUp") $_AutoItError = ObjEvent("AutoIt.Error", "_AutoItError") Func _CleanUp() ConsoleWrite("Cleaning up..."&@CRLF) $oJS = 0 $oAutoIt = 0 _AutoItObject_Shutdown() EndFunc Func _Execute($oSelf, $sString) $vReturn = Execute($sString) If @error<>0 Then Return $oJS.Eval("throw new SyntaxError();"); Does invoke exception, but not within the try/catch Return $vReturn EndFunc Func _AutoItError($oError) $oError2 = $oJS.Error ConsoleWrite( _ "Column: " & $oError2.Column & @CRLF & _ "Description: " & $oError2.Description & @CRLF & _ "HelpContext: " & $oError2.HelpContext & @CRLF & _ "HelpFile: " & $oError2.HelpFile & @CRLF & _ "Line: " & $oError2.Line & @CRLF & _ "Number: " & $oError2.Number & @CRLF & _ "Source: " & $oError2.Source & @CRLF & _ "Text: " & $oError2.Text & @CRLF _ ) $oError2.Clear() EndFunc $oJS.Eval("(function(){"& _ "try{"& _ "AutoIt.Execute('MsgBox(0,\'\', \'a\')');"& _ "AutoIt.Execute('a.b');/*error should occur here*/"& _ "AutoIt.Execute('MsgBox(0,\'\', \'b\')');"& _ "}catch(e){"& _ "AutoIt.Execute('ConsoleWrite(\'Error\'&@CRLF)');"& _ "}"& _ "})()")  
    • PELock
      Legal AutoIt
      By PELock
      Hi, I'm asking here because I can't get an answer at the official contact mail.
      Is it legal to name software products using "AutoIt" word in it. I saw some 3rd party tools with "AutoIt" word that's why I'm asking.
      So is it legal to name something e.g.:
      "AutoIt Extractor"
      "AutoIt Editor"
      etc.
      ?
    • Miliardsto
      Timers Crashing
      By Miliardsto
      I do my timers like this by clicking checkbox function is called and timer is set up.
      There is a trouble cause I got so many Timers, 20 like this below and I can see if they is launched 5 timers program starts freezing and often crashing.
      I know it takes memory but is is right way to do timers like that or what should i do?
      Case $checkerSS If GUICtrlRead($CheckerOne) = 1 Then $ss = _Timer_SetTimer($Form1,4000,"checkScreen") Else _Timer_KillTimer ($Form1,$ss) EndIf Case $checkerPos If GUICtrlRead($DiscAlert) = 1 Then $disc = _Timer_SetTimer($Form1,20000,"checkPosition") Else _Timer_KillTimer ($Form1,$disc) EndIf Case $checkerVars If GUICtrlRead($AlertPlayerPos) = 1 Then $ap = _Timer_SetTimer($Form1,15000,"checkVars") Else _Timer_KillTimer ($Form1,$ap) EndIf