Script: put user picture to Active Directory

Little script in vbScript:

Function PictureToAD(szADSOBJ, szFileName)
 Dim objUser, bytesRead, adoStreamRead
 Const adTypeBinary = 1
 Set adoStreamRead = CreateObject("ADODB.Stream")
 adoStreamRead.Type = adTypeBinary
 adoStreamRead.Open
 adoStreamRead.LoadFromFile szFileName
 bytesRead = adoStreamRead.Read()
 adoStreamRead.Close
 Set objUser = GetObject(szADSOBJ)
 objUser.Put "thumbnailPhoto", bytesRead
 objUser.SetInfo
End Function

Access denied By Business Data Connectivity on Sharepoint 2010

Creating External Content types and by using it we have created external list we may see this error: Access denied By Business Data Connectivity…

Solution simply:

  • Open Central Administration site.
  • Go to Manage service applications.
  • Go to Business Connectivity Application.
  • Select the External Content Type option from dropdown.
  • Select Set Permissions from context menu.
  • Give specific permission.
  • Hit OK.