Solved

Starting Outlook from Powershell

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 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