If a user not logged on, an update script using "Microsoft.Update.Session" will fail when the .Search method is called.
Sample Code:
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
WScript.Echo "Searching for updates..." & vbCRLF
Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software'")
%WINDIR%\WindowsUpdate.log
Misc =========== Logging initialized (build: 7.2.6001.788, tz: +0800) ===========
Misc = Process: C:\Windows\system32\cscript.exe
Misc = Module: C:\Windows\system32\wuapi.dll
COMAPI -------------
COMAPI -- START -- COMAPI: Search [ClientId = <NULL>]
COMAPI ---------
Service WARNING: GetUserTokenFromSessionId failed with error 800703f0 for session 0
COMAPI WARNING: Unable to listen to self-update/shutdown event (hr=0X800703F0)
COMAPI WARNING: Unable to establish connection to the service. (hr=800703F0)
COMAPI - WARNING: Exit code = 0x800703F0
COMAPI ---------
COMAPI -- END -- COMAPI: Search [ClientId = <NULL>]
COMAPI -------------
COMAPI FATAL: Unable to perform synchronous search. (hr=800703F0)
AU ########### AU: Uninitializing Automatic Updates ###########
Service *********
Service ** END ** Service: Service exit [Exit code = 0x240001]
Service *************