Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Services and scripts with task

Posted on 2015-01-13
2
Medium Priority
?
145 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 2000 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
 
LVL 4

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

688 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