Office activation with a proxyserver
I'm trying to activate Office 2010 by running the OSPP.VBS script. I'm using the following command : cscript OSPP.VBS /act in the correct directory. This works fine but when I'm trying to run the same script as a postinstallation task, the following error occurs : 0x80072EE2 a timeout error.
The computers are all in a domain and they're accesing the internet over a proxyserver. We've added several exceptions in the proxyserver but it still doesn't work. Is there any of you guys who knows an answer?
Answers (3)
I've just wrestled this one to the ground.
The issue appears to be that ospp.vbs ignores the WINHTTP proxy settings. Instead, it uses the proxy settings defined under Internet Options for the current user. If you're doing stuff from a startup script or something else that runs as the SYSTEM user, there's no obvious way to define those settings so ospp.vbs will attempt to connect directly and time out.
Here's the script fragment I use to activate Office 2010, which gets called from startup and shutdown scripts:
set return=goto :eof call :setproxy set ospp=cscript /nologo "%ProgramFiles%\Microsoft Office\Office14\ospp.vbs"
set ospplog="%temp%\ospp.log"
%ospp% /osppsvcrestart >%ospplog% || %return%
%ospp% /act >>%ospplog% || %return%
findstr /c:"Product activation successful" %ospplog% || %return%
%setflag% office-2010
%return% :setproxy
setlocal enabledelayedexpansion
set key=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
set val=DefaultConnectionSettings
set type=REG_BINARY
set setting=09
rem settings: 01 = none, 03 = use proxy, 05 = use script, 09 = auto detect; bitwise OR as needed
for /f "tokens=1-3" %%A in ('reg query "!key!" /v "!val!"') do if "%%A %%B"=="!val! !type!" set data=%%C
set data=!data:~,16!!setting!!data:~18!
reg add "!key!" /v "!val!" /t !type! /d !data! /f
endlocal
%return%
The /osppsvcrestart step is there to prevent the intermittent failures I saw, apparently caused by the OSPP service already having been started before the proxy settings are changed.
My site is set up to push out proxy settings using WPAD. If you're using a statically defined proxy instead, :setproxy will be much less unreasonable because there will be no need for the REG_BINARY foolery needed to turn on proxy auto-detection. Something like this should work:
:setproxy
setlocal enabledelayedexpansion
set ProxyServer=http=proxy.example.lan:3128;https=proxy.example.lan:3128
set ProxyOverride=localhost;*.admin.lan;127.*.*.*
set key=HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings
reg add "!key!" /v "ProxyServer" /d "!ProxyServer!" /f
reg add "!key!" /v "ProxyOverride" /d "!ProxyOverride!" /f
reg add "!key!" /v "ProxyEnable" /t REG_DWORD /d 1 /f
endlocal
%return%
Here's a link to the Microsift kb of the error.
http://support.microsoft.com/kb/836941/en
These errors may be caused by any of the following issues:
- Applications or processes that interfere with Internet communications
- Resource issues on your computer
- High Internet activity
- Recoverable database errors
Comments:
-
I think a proxy server probably counts as "applications or processes that interfere with Internet communications". - flabdablet 11 years ago