Works as intended. SYSTEM _is_ an AD account - it is the computer account of the domain joined computer.
Except for members of "Exchange Servers" (which may be named something slightly different depending on your version of Exchange), computer accounts don't have permission to send email. Local Service or Network Service are not AD accounts. They are local accounts. So when connecting to an Exchange server they appear as Anonymous. From: [email protected] [mailto:[email protected]] On Behalf Of Nicholas Turner Sent: Wednesday, June 26, 2013 6:27 AM To: '[email protected]' Subject: RE: [Exchange] Powershell scheduled task not running using System Works just fine, only seems to not work when running as SYSTEM From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Sobey, Richard A Sent: 26 June 2013 11:20 To: [email protected]<mailto:[email protected]> Subject: RE: [Exchange] Powershell scheduled task not running using System What happens if you run the script from a Powershell console whilst logged on? From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Nicholas Turner Sent: 26 June 2013 11:14 To: [email protected]<mailto:[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
