Saturday, December 27, 2008

Bare Metal Restore of Windows 2008 Server from Remote WBADMIN Backups

As most users of Windows 2008 Server know you can easily use the WBADMIN command as a backup solution. WBADMIN allows to use remote shares as storage locations for backup sets. Below are the steps to perform a bare metal restore using a backup sets located on a remote share. In order for this to work you will need to have a DHCP server running on your network that will give out an IP address to the host being recovered.

  1. Boot from the Windows 2008 CD. Click Next

  2. On the Install Now Window, Click the Repair Your Computer link

  3. Click Next again to move to the next window

  4. Choose Windows Complete PC Restore

  5. When the error message about not finding a valid backup comes up, click Cancel

  6. On the Restore Your Entire Computer for a Backup window, select Restore a Different Backup and click Next

  7. On the Select the Location of the Backup window, click the Advanced button

  8. Click Search for a Backup on the Network

  9. Click Yes when prompted

  10. Type in the network location of the backup and click OK

  11. Enter in your AD Admin account credentials (domain\userid) when connecting to server hosting the backup sets and click

  12. Highlight the backup set location for the computer you want restored and clickNext

  13. Highlight the backup point you want to recover and click Next

  14. Click Next. Depending upon the type of restore you might have to check the "Format and repartition disks" checkbox

  15. On the Summary page, click Finish

  16. Check the I confirm that I want to format the disks and restore the backup checkbox. Then click
    OK to start the recovery process

Monday, December 15, 2008

VBScript: Preventing Logon After Hours

Last week I received a request asking if I could prevent a certain user from logging into a system after normal business hours.

I thought it would be easy using AD and just setting the login hours for her account; however, since the user's email is routed to my Exchange server, it caused her to be locked out of her email after hours. The solution I came up with is a simple VBScript.

The script checks the day and time. If they are out of the acceptable range then using the shutdown command I reboot the box in 60 seconds. Both the system and the script will present a popup window notifying the user of the situation. I configured a group policy to run the script at logon and only for a specific AD group (which the user is a member of).

So that covers logging in but what if the user is already logged onto the system. Another group policy, with a preference setting for a scheduled task running the shutdown /r /t 60 command at 6 PM everyday does the trick.


on error resume next

dim vday, vhour

vday = weekday(now)
vhour = hour(now)

set wshshell = wscript.createobject("")

if vday >= 2 and vday <= 6 then

if vhour < 8 or vhour > 17 then "C:\WINDOWS\system32\shutdown.exe /r /t 60"
wshshell.popup "Your Account is Only Permitted to Login Between 8AM" _
& " and 6PM" & vbCrLf & "Monday through Friday", 20, "Account Logoff"

end if

else "C:\WINDOWS\system32\shutdown.exe /r /t 60"
wshshell.popup "Your Account is Only Permitted to Login Between 8AM" _
& " and 6PM" & vbCrLf & "Monday through Friday", 20, "Account Logoff"

end if