After installing SharePoint Foundation 2010 SP1… (missing PSConfig run)

(SharePoint Foundation Search (Event ID: 70; Category: Gatherer))

Launch an elevated (Run as Administrator) SharePoint 2010 Management shell from start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Management Shell.

Run: (get-spserver $env:computername).NeedsUpgrade

If the result of this command is True:

1. Open an Administrative command prompt.
2. Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
3. Run PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Relatively time consuming, not to panic …

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

If you use IIS install after installing .NET Framework 4

You must install IIS before installing .NET Framework 4. If you installed IIS after installing .NET Framework 4, you must register ASP.NET 4.0 with IIS. Open a Command prompt window by using the Run As Administrator option and then run the following command:

%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -r 

Update: Installation of the web console stuffs requires that ISAPI and CGI Restrictions in IIS be enabled for ASP.NET 4. To enable this, select the web server in IIS, and then double-click ISAPI and CGI Restrictions.
Select ASP.NET v4.0.30319, and then click Allow.

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