Solved

How to execute powers he'll script using task scheduler in windows 2008 r2 sp1 server!

Posted on 2013-10-22
3
316 Views
Last Modified: 2013-11-01
Hello there,

I am trying to run the following power shell command  via task scheduler in windows 2008 r2 server. But it us not getting executed.

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command “C:\temp\NowVDI2.ps1”

Please advise if I am missing any parameters in the above command line.

Thanks and regards
0
Comment
Question by:goprasad
  • 2
3 Comments
 

Author Comment

by:goprasad
ID: 39593291
Please advise
0
 

Author Comment

by:goprasad
ID: 39593309
Please if someone could assist?
0
 
LVL 14

Accepted Solution

by:
Raj-GT earned 500 total points
ID: 39593670
Change the "-command" option to "-file" when calling a script file. See the link below for some step by step instructions.

http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

777 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