What happens if you run the script from a Powershell console whilst logged on?

From: [email protected] [mailto:[email protected]] On 
Behalf Of Nicholas Turner
Sent: 26 June 2013 11:14
To: [email protected]
Subject: RE: [Exchange] Powershell scheduled task not running using System

They can and they do.  All the mail from scripts goes to a central relay 
regardless of whether it is running on exchange or not which is set to accept 
anonymous.

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Tony Patton
Sent: 26 June 2013 11:07
To: [email protected]<mailto:[email protected]>
Subject: Re: [Exchange] Powershell scheduled task not running using System


The non-exchange servers need to be allowed to relay through exchange, possibly 
anonymously.
On 26 Jun 2013 10:25, "Nicholas Turner" 
<[email protected]<mailto:[email protected]>> wrote:
I've recently changed our server restart notification scripts to run using 
powershell.

It's just a scheduled task calling powershell with the argument -command "& 
'C:\BatchScripts\restart.ps1'"

The notification script is pretty simple, just generates server name and time 
and date and then emails them off.  Works fine.

We always run these scripts using the local system account.  On all the 
exchange servers this works fine, but when I run it on a 2008 r2 box without 
exchange it runs, but doesn't actually send anything (tried running via a batch 
file too but that does the same)

If I run it using an ad account it works.  Executionpolicy is set to remote 
signed.

I'm probably missing something obvious, but can't for the life of me see why 
it's running fine as SYSTEM on exchange boxes but not others...

Nick

This electronic message contains information from CACI International Inc or
subsidiary companies, which may be confidential, proprietary,
privileged or otherwise protected from disclosure.  The information is
intended to be used solely by the recipient(s) named above.  If you are not
an intended recipient, be aware that any review, disclosure, copying,
distribution or use of this transmission or its contents is prohibited.  If
you have received this transmission in error, please notify us immediately
at [email protected]<mailto:[email protected]>
Viruses: Although we have taken steps to ensure that this e-mail and
attachments are free from any virus, we advise that in keeping with good
computing practice the recipient should ensure they are actually virus free.

CACI Limited. Registered in England & Wales. Registration No. 1649776. CACI 
House, Avonmore Road, London, W14 8TS.

This electronic message contains information from CACI International Inc or
subsidiary companies, which may be confidential, proprietary,
privileged or otherwise protected from disclosure.  The information is
intended to be used solely by the recipient(s) named above.  If you are not
an intended recipient, be aware that any review, disclosure, copying,
distribution or use of this transmission or its contents is prohibited.  If
you have received this transmission in error, please notify us immediately
at [email protected]<mailto:[email protected]>
Viruses: Although we have taken steps to ensure that this e-mail and
attachments are free from any virus, we advise that in keeping with good
computing practice the recipient should ensure they are actually virus free.

CACI Limited. Registered in England & Wales. Registration No. 1649776. CACI 
House, Avonmore Road, London, W14 8TS.

Reply via email to