Link to home
Start Free TrialLog in
Avatar of meepmaker
meepmaker

asked on

Outlook.exe /Importprf only run once via logon script

Hi,

I have Win7 users located in DomainB Active Directory who access their mailbox which is located in DomainA.  The mailboxes are getting migrated onto an exchange server in DomainB.  Therefore I needed to run the outlook.exe /importprf for the existing users to update the outlook profile (these are not users who haven't logged on before).  I did this by using a small vbs script execute at user logon via Group Policy (user policy):

Dim objShell : Set objShell = CreateObject("Wscript.Shell")
strProgramPath = "Outlook.exe /importprf \\server.domain.local\share\new.prf"
objShell.Run strProgramPath

This works really well & the user is then pointed to the mailbox on DomainB.  My only problem is that this script runs on every user logon, but I only need this to run once for all the users.

Is anyone aware of the syntax I need to add into my script so that this updates the FirstRun / First-Run reg key so that it won't run again after initial execution?

Sorry - I'm not a scripter so you may have to tell me the actual lines I need to add.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of meepmaker
meepmaker

ASKER

Hi  Robberbaron,

Thats brilliant - thanks very much, I really appreciate your help.  I can now see the marker file being created at c:\Users\%Username%\Outlook_profile.Update

I don't actually need the Windows Script Host dialogue boxes stating "\\server.domain.local\share\new.prf" & "Already process profile update" & as I don't want the end user to see these - on relection I can see the wscript.echo at lines 29 & 32 - I guess you just need to comment these lines out?  I've done that now & I'm no longer presented with the Windows Script Host dialogue boxes.

Unfortuntely the importprf function within the script didn't work - this was simply due to line 33 being commented out.  After removing this comment - it works perfectly.

Thanks,
M
Excellent response - exactly what I was looking for.