Solved

Services and scripts with task

Posted on 2015-01-13
2
122 Views
Last Modified: 2015-01-15
I need assistance of the following

Every Friday Stop a service
Change service from automatic to manual
The service will remain stopped,
During this time specified reboots may be encountered.

Then another script that resets the service back to automatic
And reboots server

Example Friday stop.... change...   Saturday reset/start and reboot.

can be powershell, vbscript, or batch... add to task scheduler.

Thanks
0
Comment
Question by:Indyrb
[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 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 40547134
This is very easy to accomplish with powershell. 2 different commands...
Friday Code
Get-Service -Name <service name> | Stop-Service
Set-Service -Name <service name> -StartupType "Manual"

Open in new window


Saturday Code
Set-Service -Name <service name> -StartupType "automatic" | shutdown -r -t 01

Open in new window


Then create 2 scheduled tasks for each script. Set the parameters accordingly.

Program to Launch should look like below...
 Program = powershell.exe
Arguments = -file c:\scriptslocation\script.ps1

Will.
0
 

Author Comment

by:Indyrb
ID: 40551920
thanks for the info, I will close this request and test it out. I appreciate the feedback and info.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Master DC completely died 15 75
VMWare Server 2.0 virtual machine won't start 30 66
CMD VB Script: remove empty rows 12 14
Powershell: Combining a where statement with contains 2 21
This article explains how to install and use the NTBackup utility that comes with Windows Server.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

710 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