header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Using Windows Task to execute Powershell Script
Last Post 16 Jul 2010 09:32 AM by PoSherLife. 3 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
justin82User is Offline
New Member
New Member
Posts:25
Avatar

--
15 Jul 2010 09:48 AM

    Hi Folks

    I have been trying to use Windows Task Scheduler to run a script regulary to extract reports of the exchange mailbox database. This script is required to run everyday morning and send an email to stakeholders on total number of mailboxes in the database. This script works fine when executed manually, however when scheduled under scheduler, it doesnt work. I am quite not sure, what has went wrong, May be i set it up wrong. Please advise.

    Best Regards
    Justin

    AythUser is Offline
    Basic Member
    Basic Member
    Posts:232
    Avatar

    --
    15 Jul 2010 09:53 AM
    I've done this a couple of times before and usually you just point the scheduled task to Powershell.exe with the script as a argument. Set the credentials and Bob's your uncle.
    My Blog about Powershell http://poweroftheshell.blogspot.com/ Follow me on twitter @darrinhenshaw
    RyanUser is Offline
    New Member
    New Member
    Posts:16
    Avatar

    --
    15 Jul 2010 09:55 AM
    Could you provide the details of the scheduled task?
    PoSherLifeUser is Offline
    Basic Member
    Basic Member
    Posts:364
    Avatar

    --
    16 Jul 2010 09:32 AM
    Make sure your command is similar to these below.

    v2:
    powershell.exe -file "script.ps1"

    v1:
    powershell.exe &'script.ps1'
    When at first you don't succeed Step-Into

    http://theposherlife.blogspot.com
    http://www.jandctravels.com

    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer