Solved

help with logon script setup and execution

Posted on 2013-05-15
9
635 Views
Last Modified: 2013-05-16
Greetings,

I need to set a login script that runs locally on a 2008 R2 server running remote desktop services. It should import an Outlook 2007 PRF, then close outlook, then run the next command to install our doc management system add in for outlook 2007. I only need this to run once per user, at first login.

I wanted to run it locally, rather than in the domain login script, since it only needs to happen on the terminal server, not all domain computers.

I have the script and it does load the PRF. However, users are prompted to enter their username / initials, answer if they want online help, and then asked about updates, before being allowed to finish the outlook wizard. Even if this info is entered manually, which I want to avoid, it does not proceed with the next part of the script to add the doc mgt system add in. It doesn't close outlook automatically either.

I appreciate any help getting this to run. Script below, edited from what I got from FarrellFritz here:

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_27261784.html

____________________________________________________________________________________________
IF EXIST C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\ GOTO SKIP_PRF

"C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe" /importprf C:\OutlookTerm.PRF

PING localhost -n 30 > NUL

TASKKILL /IM OUTLOOK.EXE /f

REM PING localhost -n 10 > NUL

"C:\Program Files\Interwoven\WorkSite\addiman.exe" Filesite

:SKIP_PRF

:EXIT

_____________________________________________________________________________________________

and this one just to add PRF

"C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe" /importprf C:\OutlookTerm.PRF
0
Comment
Question by:rpliner
  • 5
  • 2
  • 2
9 Comments
 
LVL 82

Accepted Solution

by:
oBdA earned 450 total points
Comment Utility
OK, I'll bite as far as the script part is concerned.
For the configuration of the Outlook profile to avoid the initial prompts, you should ask a dedicated question in the appropriate TAs, Outlook and Exchange:
http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/
http://www.experts-exchange.com/Microsoft/Applications/Outlook/
To your script: it doesn't proceed because it's waiting for Outlook to close.
You need to start Outlook using "start" so that Outlook will be started in the background, and the script can continue.
Then you should never use "C:\Users\%username%" in a script; this is not necessarily the user's profile folder. To access the user's profile root, use "%UserProfile%", and in this case, use "%AppData%" to access the user's AppData folder.
In the same way, you should use %ProgramFiles% instead of "C:\Program Files" (and/or "%ProgramFiles(x86)%"). Finally, a possible issue (according to the respective installation folders)) with your add-in is that your Outlook seems to be the 32bit version, while the plugin comes from a 64bit folder.
@echo off
if exist "%AppData%\Microsoft\Outlook" goto :eof
start "" "%ProgramFiles(x86)%\Microsoft Office\Office12\Outlook.exe" /importprf C:\OutlookTerm.PRF
ping.exe localhost -n 30 >NUL
taskkill.exe /im OUTLOOK.EXE /f
REM ping.exe localhost -n 10 >NUL
"%ProgramFiles%\Interwoven\WorkSite\addiman.exe" Filesite

Open in new window

0
 
LVL 32

Assisted Solution

by:nappy_d
nappy_d earned 50 total points
Comment Utility
You can you Active directory and permit only one computer or user to be able to read and apply your script.

Launch your group policy MMC
From the left-hand pane, click on your GPO(see pic)
In the right-hand pane, click on the delegation tab(see pic)
In the bottom right-hand area, click on advanced
Click on Authenticated users
In the permissions lists, locate the permission Apply Policy and uncheck it
Click on Add
Add the user group, user, computer group or computer to the permission list
Make sure the Apply and Read permission are given to the object(s)
Save your settings and test
Now make sure this GPO exists at an OU level that contains your computer and your user, by linking it.

  GPO MMC
0
 
LVL 7

Author Comment

by:rpliner
Comment Utility
thanks for biting oBdA, I can really use the help. I will apply your edits to the script and test it out. I will also ask a new question regarding the wizard install of outlook 2007 and the subsequent prompts I would like to skip. I will post the link here so you can check it out, if you like.

thanks nappy_d. I will check out the GPO settings.
0
 
LVL 7

Author Comment

by:rpliner
Comment Utility
I just checked and the add-in is actually in the %ProgramFiles (x86)% folder. Also, the REM is a typo of sorts, I copied the incorrect file. Still, it's only the add-in path and REM that are different so your direction is still valid.

thanks again.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 7

Author Comment

by:rpliner
Comment Utility
here is a link to the other question regarding skipping user prompts. thx

http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_28130142.html
0
 
LVL 7

Author Comment

by:rpliner
Comment Utility
so this worked for me, kinda. Still get the RSS pop-up but I can definitely live with that. Not sure why but when I put "%ProgramFiles%\Interwoven\WorkSite\addiman.exe" Filesite, it doesn't work. When I put what is below, it works.

thanks again for the help.

@echo off
if exist "%AppData%\Microsoft\Outlook" goto :eof
Reg Add HKCU\Software\Microsoft\Office\Common\UserInfo /v UserName /d "%username%"
Reg Add HKCU\Software\Microsoft\Office\Common\UserInfo /v UserInitials /d %username:~0,2%
Reg Add HKCU\Software\Microsoft\Office\12.0\Common\General /v ShownOptIn /t REG_DWORD /d 1 /f
start "" "%ProgramFiles(x86)%\Microsoft Office\Office12\Outlook.exe" /importprf C:\BRtermPRFv2.PRF
ping.exe localhost -n 60 >NUL
taskkill.exe /im OUTLOOK.EXE /f
ping.exe localhost -n 30 >NUL
"C:\Program Files (x86)\Interwoven\WorkSite\addiman.exe" Filesite
ping.exe localhost -n 15 >NUL
start "" "%ProgramFiles(x86)%\Microsoft Office\Office12\Outlook.exe"

Open in new window

0
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
Since it's a 32bit application after all, you'll need "%ProgramFiles(x86)%" to access the Interwoven program folder.
0
 
LVL 32

Expert Comment

by:nappy_d
Comment Utility
Thanks for the points but I thought my answer was worth more as it directly answered your question. Hope it all works for you ;)
0
 
LVL 7

Author Comment

by:rpliner
Comment Utility
you are correct oBdA. It works now that I have edited it.

nappy_d - I am sorry you feel that way. While I do appreciate your help with this issue, you demonstrated how to set it in GPO to run per group, user, or machine. That addressed the one-sentence second paragraph. The major portion of my question had to do with the script itself not running past opening outlook and importing the PRF. So, while helpful in that I learned something, it was essentially useless until the script actually worked. The script now works, but I am running it locally. So your suggestion wasn't even put to use. The code I was given was most helpful in this situation, especially since I have very little experience with coding anything, hence the point distribution. I hope this doesn't prevent you from helping me in the future should I need it, and should you have relevant info.

Thanks to both of you.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now