Solved WMI - objprocess.create - Unable to configure

Microsoft Windows xp professional w/serv...
December 1, 2011 at 11:37:44
Specs: windows xp sp3, not an issue
I am aware that the objprocess.create method cannot be used to create interactive processes on remote machines.
However i would like run outlook.exe /importprf /pathtoprf and have this configure the remote machines outlook.
This process does not need to be interactive as it should sort everything out. however when i run my script outlook obj is created with a process ID and is visible in task manager on the remote machine. closing outlook and then opening outlook reveals that the prf settings have not been applied.

Trying to work around this problem i created a batch file which just runs the command mentioned above. I then envoke the bat file via objprocess create. I can get the .bat file to write to a text file, but cant seem to get it import the prf for outlook.


strCommand = "c:\outlook.bat"
'strCommand = chr(34) & sfilepath & chr(34) & " /importprf C:\reconfigure.prf"
strrunpath = "c:\"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strdata & "\root\cimv2")
Set objProcess = objWMIService.Get("Win32_Process")
errReturn = objProcess.Create(strCommand, strrunpath, null, intProcessID)

If errReturn = 0 Then
clienttext.value = "Outlook config started. Process ID: " & intProcessID & vbnewline & vbnewline & "Please wait for config completion message"
clienttext.value = "FATAL ERROR - Outlook.exe could not be started due to error: " & errReturn
End If

@Echo off
Echo Configuring Outlook...... >> C:\text.txt
start "C:\program files\microsoft office\office10\outlook.exe" /importprf C:\reconfigure.prf
del C:\reconfigure.prf

Any ideas welcome! looking you seen as you havethe answers to everything! :-)

See More: WMI - objprocess.create - Unable to configure

December 1, 2011 at 15:55:17
✔ Best Answer
have this configure the remote machines outlook.
There's your problem. Profiles are not, "on this machine." Profiles are, "on this user account (on this machine)." It's an important difference, and multi-user support is one of the (many) reasons Microsoft Outlook is better than Lotus Notes.

A white paper (Word / Word Viewer required) on the subject suggests putting the .prf file on a network share, add the file's path to <user hive>\Software\Microsoft\Office\11.0\Outlook\Setup\ImportPRF, and then delete <user hive>\Software\Microsoft\Office\11.0\Outlook\Setup\FirstRun.

So that's what you need to do. You can either trawl the remote PCs looking for users to update and modify their registry, or you can use Group Policy to make the change. In either case you'll probably want to update the default user settings, ensuring new users have the update applied.

EDIT: "office10"? That's, what, Office 2000? The above advice might work, but the white paper was written with the later versions in mind.

How To Ask Questions The Smart Way

Report •

December 3, 2011 at 18:29:46
cheers Razor, as always thanks for the advice.

Back at work tuesday so will have a look into it then.

Report •

December 6, 2011 at 10:20:06
Ok great the regkeys are there for office10 so looks like this idea will work.

havent actually implemented yet as diddnt have time but just had a quick further question....

can i just amend the values in hkeycurrentuser or will i need to go into the hive which has the user account SID as the name and change the values in there? (user will be logged on but just not sure if it will make a difference where the changes are applied)

Report •

Related Solutions

December 9, 2011 at 06:38:02
FYI for anyone else trying this, yes you can use hkey current user

Report •

December 9, 2011 at 06:54:30
I imagine HKCU would be your remote logon, not the guy at the console, but if it works who am I to judge.

How To Ask Questions The Smart Way

Report •

Ask Question