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

Execute process remotely with WMI (VBScript)

How can I start a process and then wait until that process quits before terminating the script?

It offers the capability to execute process with the limitation of not allowing any user interaction – the process will run in the background without showing any interface on user’s session, which is a perfect feature for running non-interactive processes.

WMI, below is the code snippet in VBScript:

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
intReturn = objWMIService.Create("command", Null, Null, intProcessID)

Reference: http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec06/hey1208.mspx