Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need a way to schedule a powershell commend to run every 10 min. Windows Server 2012.

Posted on 2016-09-25
2
Medium Priority
?
84 Views
Last Modified: 2016-09-26
I need a way to schedule a task that would run the following powershell commend every 10 min.  The commend is resume-replication *. Which should resume for all paused virtual machines. I am not familiar with scripts or scheduling a task in windows server 2012.

resume-replication *
0
Comment
Question by:netcomp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 71

Accepted Solution

by:
Qlemo earned 1000 total points
ID: 41815115
Go into the Task Scheduler and create a task. The wizard should be almost straight-forward.
You'll need to set up a starting point, e.g. each day at 08:00, then repeat every 10 minutes.
The action to run is
powershell -ExecutionPolicy ByPass -NonInteractive -Command "resume-replication *"

Open in new window

0
 
LVL 17

Assisted Solution

by:bigeven2002
bigeven2002 earned 1000 total points
ID: 41815130
If for some reason using the command parameter doesn't work, then put the resume-replication * into a ps1 file and use the -file parameter to point to the ps1 file.  Be sure it is on a local drive though and not a network drive.  Then have task scheduler run it as the administrators group.
0

Featured Post

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

604 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