Tag: Windows Server 2008 R2

Reboot your Windows server at a specified time

We’ve all run up against a scenario where a newly installed application will not work properly unless you reboot the server. The problem with that is you are probably working on the app during business hours and a reboot is out of the question right now. There are 2 easy ways to schedule a reboot of your Windows server to happen during off hours with no late night RDP sessions required.

*disclaimer*

Please test these procedures on a test box before using them on your production server. Also, there are several ways to do this, just Google them and you’ll see what I mean. This was performed on Windows 2008 R2 SP1.

Option #1 Using Task Scheduler and a batch file

To prepare your server for a late night/early morning reboot, do the following:

Open notepad and enter the following:
@echo off
echo rebooting the server
ping yahoo.com
shutdown /r /f /d p:4:1 /c "Planned restart by Techmom"

I inserted the ping to slow down the command just a bit so I can test it abort the shutdown with a shutdown /a at a command line.
/r = restart
/f= force running apps closed without warning users
/d = Provide reason for restart
p:4:1= Planned:Major:Minor = Application: Maintenance (Planned)
/c = Comment on the reason of the restart or shutdown

Event Properties

This is what you’ll see in the event log regarding the reboot. The comment is a good place to make a note of why the reboot must occur.

Once you know it works, time to create a task.

Open Task Scheduler. In the Actions Panel, click create task. Click each tab and choose the options that will allow you to perform your reboot. My settings are as follows:

createtask-general

General Tab

reboot-sched

Trigger Tab, click New.

action-tab

Action Tab, click new and browse to the batch script.

Conditions & Settings Tabs are with the default options selected.

Test the schedule to confirm the system will reboot.

If you are logged in during the test, you will see the warning popup informing you of the impending reboot.

popup-plannedrestartr

Your server will reboot on the schedule you set. Review the event logs and the task scheduler library to confirm the reboot was successful.

reboot-successful

Option #2 Use PSShutdown

PSShutdown is a Systernals utility that you can download from Microsoft to reboot local and remote machines. Follow the installation instructions before use.

This tool allows you to issue a psshutdown command from the command line, specify the reboot time as well as add parameters. To get a full list of the switches issue a PsShutdown /? at the prompt.

Open the command prompt and enter the command.  In this example, I’ve chosen  the following:

psshutdown2

-r = reboot

-f = Force apps close

-t = Time to start shutdown

-m = Message

Upon reboot, review the event log for more information on your reboot.

psshutdown-event

Adding AD Users and Computers to Windows 2008R2

I’m human. Someone asked me how to get to Active Directory Users and Computers (ADUC) on a 2008 R2 and my first response was, look under Administrative Tools.  Well, as luck would have it, it’s not there. Where is it, MMC? admintools? adminpak?  I wasn’t sure. This is a new server and not under my purview so I just assumed it was there.   Sometimes I think I’ve forgotten more that I remember, but then, It dawned on me, this is 2008R2 and EVERYTHING is either a role or a feature.

Problem

How to add Active Directory Users and Computers to a Windows 2008 R2 Server

Solution

  • Launch Server Manager
  • Click on/Expand Features
  • Click Add Features
  • Scroll down and expand Remote Server Administration Tools
    • Expand Role Administration Tools + AD DS and AD LDS Tools
    • Select AD DS Snap-Ins and Command-line Tools

    Add Remote Server Administration Tools

  • Click Next. Confirm installation selections and Click install.
  • Click Close when the installation succeeds.

aduc-installed

 

 

 

 

Social media & sharing icons powered by UltimatelySocial