Solved

Starting Outlook from Powershell

Posted on 2012-03-22
3
598 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
  • 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
Synchronize a new Active Directory domain with an existing Office 365 tenant
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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 …

705 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

18 Experts available now in Live!

Get 1:1 Help Now