Posts Tagged "Picture"

How to save a user picture in Active Directory with vbScript?

Posted by on Aug 12, 2011 in Active Directory, VBScript | 0 comments

Active Directory offers the possibility to save pictures in a user’s object. These pictures can then be used in Outlook, Sharepoint or even self-written applications. Here is how you can do it: Function SavePictureToAdFromUrl(szADsPath, szUrl) Dim objUser, bytesRead, adoStreamRead Const adTypeBinary = 1 Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", szUrl, False xml.Send If xml.status = 200 Then Set adoStreamRead = CreateObject("ADODB.Stream") adoStreamRead.Type = adTypeBinary adoStreamRead.Open adoStreamRead.Write xml.responseBody...

Read More