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.Shel l")
strProgramPath = "Outlook.exe /importprf \\server.domain.local\shar e\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.
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.Shel
strProgramPath = "Outlook.exe /importprf \\server.domain.local\shar
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent response - exactly what I was looking for.
ASKER
Thats brilliant - thanks very much, I really appreciate your help. I can now see the marker file being created at c:\Users\%Username%\Outloo
I don't actually need the Windows Script Host dialogue boxes stating "\\server.domain.local\sha
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