Solved

Starting Outlook from Powershell

Posted on 2012-03-22
3
855 Views
Last Modified: 2012-03-26
I have a server 2008 powershell script to start outlook:

# PowerShell script to start outlook
$Result = get-process -EA “SilentlyContinue” outlook | where {$_.ProcessName -eq “OUTLOOK”}
if (-not $Result) {& 'C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE'}

This works fine if I'm logged in as administrator and manually run the script or run it via a batch file.

I have set it up as a scheduled task and in order to do that have specified that it be run as ADDomain\net since ADDomain\net is the user with privilege to run scheduled tasks.  When run this way, the outlook process starts, but the application window does not come up.

Is there a way I can correct this?

Thanks.
0
Comment
Question by:dspace
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
markdmac earned 500 total points
ID: 37755792
No, this is a security feature that was introduced back in SP1 of Windows 2000.  You can't start a process with alternate credentials and have it be interactive with the user session.  If you were logged on as ADDOMAIN\NET then you would see it.
0
 
LVL 24

Expert Comment

by:DBAduck - Ben Miller
ID: 37761990
You should look here:
http://blogs.msdn.com/b/powershell/archive/2009/04/23/v2-quick-tip-starting-a-new-elevated-process-from-a-powershell-script.aspx

In PowerShell v2 you can start a process with Elevated permissions.  If you don't have Administrative permissions on the machine with your user, then you need to run it as someone elses account like you have a task.

So look at this post and that should help you get around not being able to start it.
0
 
LVL 15

Expert Comment

by:markdmac
ID: 37762131
I would just follow up with running elevated is not the same as running with alternate credentials as requested.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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