Hello,
Im I have two powershell scripts one to forward email and one to stop the forwarding to another address, but am trying to set up a scheduled task so that the script first script runs at a certain time to start the forwarding and another to stop it.
Both scripts when run manually work perfectly, but not as a scheduled task
The script to forward the email:
Set-Mailbox -Identity "UserA" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "forward@domain.com"
the script to turn off the forwarding:
Set-Mailbox -Identity userA@domain.com -DeliverToMailboxAndForward $false -ForwardingSMTPAddress $null
The trouble Im having is how to setup the scheduled task to get a powwershell script to run correctly. This is on an exchange 2010 environment as well
thanks for any help provided
Im I have two powershell scripts one to forward email and one to stop the forwarding to another address, but am trying to set up a scheduled task so that the script first script runs at a certain time to start the forwarding and another to stop it.
Both scripts when run manually work perfectly, but not as a scheduled task
The script to forward the email:
Set-Mailbox -Identity "UserA" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "forward@domain.com"
the script to turn off the forwarding:
Set-Mailbox -Identity userA@domain.com -DeliverToMailboxAndForward $false -ForwardingSMTPAddress $null
The trouble Im having is how to setup the scheduled task to get a powwershell script to run correctly. This is on an exchange 2010 environment as well
thanks for any help provided