Solved

Powershell execution

Posted on 2013-05-24
8
407 Views
Last Modified: 2015-04-21
I have a powershell script that generates daily and monthly reports for an application. I'm finding that I need to keep the powershell window opened in order to run the application. This creates a problem as I have to reboot the server often.

Is there a way I can run the script silently?
0
Comment
Question by:Maquinaloca
8 Comments
 
LVL 19

Accepted Solution

by:
Peter Hutchison earned 168 total points
ID: 39194593
You can set up a Scheduled task using the followning command line:
powershell.exe -command "Myscript.ps1"

I also find that enabling use high priviledges in the task. for some admin rights.
1
 

Assisted Solution

by:krxx
krxx earned 166 total points
ID: 39194649
There is also a -windowstyle parameter that can be set to "Hidden".



PowerShell.exe -windowstyle hidden { your script.. }
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
ID: 39195166
Guess the -WindowsStyle in combination with a scheduled task is your best choice. That way, your PowerShell task will only run whenever you need it.
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39462174
Recommendation:
http:#a39194593  250
http:#a39194649  250
as both together will work best (as I suggested in http:#a39195166 ).
0
 

Author Comment

by:Maquinaloca
ID: 40737238
Thanks. I accept
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
The goal of this Micro Tutorial is to help navigate beginning users with the app store on Windows 8. It will explain exciting features how to maximize your PC through these apps. This will be demonstrated using Windows 8 operating system.

820 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