• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 910
  • Last Modified:

Auto start and shutdown of windows domain workstation

I have a Windows 2000 workstation on a Windows 2000 domain that is designated as the 'Internet Workstation'...

It is requested that we configure this workstation to boot up at 7am and shutdown at 7pm.. It is requested that this workstation be inaccessable durring the other hours of the day..
0
maliksephur
Asked:
maliksephur
  • 5
  • 4
  • 2
  • +2
6 Solutions
 
techhealthCommented:
Auto shutdown is easy.  You can set a scheduled task to run shutdown.exe.  Auto boot can probably be accomplished by using Wake-on-LAN, if your workstation supports it.
0
 
maliksephurAuthor Commented:
How do you make it so the workstation can not be turned on and accessed durring the off hours..?
0
 
techhealthCommented:
You mean physically?  There's nothing to prevent someone from pushing the power button unless you lock it up in a box that only exposes K/M and monitor.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
CrashDummy_MSCommented:
If you're having it auto-login, you can set that user's account to only be allowed to log on during those hours, or you could write a script that checks the time when Windows starts up, and shuts down if it isn't in the allowed hours.

Or you could go lower tech and use something like this:
http://www.petsolutions.com/default.aspx?ItemId=47450299&EID=47450299&SID=FROOGLE
(if you can have the power outlet out of reach)
0
 
pzozulkaCommented:
However, who tried to login to it? If this is a shared computer, I imagine it is using 1 account. If this is a domain account, you can go to active directory, go to properties of the user account, and then go to the "Account" tab. Once there, you should see a button called "Logon Hours".

You can actually set this up for any domain user accounts that login to that machine. Examples of WakeOnLan/Shutdown scripts are below.

You can download the command line "WakeOnLan" utility here:
http://www.4shared.com/file/64290961/d8ec004/WolCmd.html

The 1st script below can be put into a batch file and ran as a Scheduled Task from the server. Same thing goes for the 2nd script. Put it in a batch file, and put it into a Schedule Task.

*Replace "MAC-Address" with the mac address of the machine in question.

*Replace \\ComputerName with \\ws123456 <--- example
wolcmd MAC-Address 255.255.255.255 255.255.255.255
 
shutdown.exe /m \\ComputerName /s /f /t 300 /c "This machine will Shut Down in 5 minutes. You can either wait for the machine to restart, or save your work now, then select Shut Down and Restart."

Open in new window

0
 
maliksephurAuthor Commented:
crashdummy,

How would one go about writing a script that checks the server time and shuts down the workstation if it is not in the allowable hours?

pzozulka,

The above item describes the scheduled shutdown.. how does one schedule the bootup..?

I downloaded the wolcmd.exe but I am unsure how to use it..?
0
 
CrashDummy_MSCommented:
Save this as a .vbs file and put it in startup or as a scheduled task to run at startup. It checks that the day of week is higher than Sunday (1), less than Saturday (7), and the hour is between 7 AM and 7 PM, and shuts down if it fails any of those.



intTime = Hour(Now)
intWeekday = Weekday(Date)
 
 
if intWeekday > 1 then
   if intWeekday < 7 then
      if intTime > 7 then
         if intTime < 19 then
            wscript.quit
         end if
      end if
   end if
end if
 
strComputer = "."
Set objWMIService = GetObject_
    ("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & _
        strComputer & "\root\cimv2")
 
Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
 
For Each objOperatingSystem in colOperatingSystems
    objOperatingSystem.Win32Shutdown(1)
Next

Open in new window

0
 
CrashDummy_MSCommented:
Also, for the scheduled boot, most PCs have an option in the BIOS to set a power on time.

And if you wanted it to be a 7 day thing and not Monday to Friday, the If statements would be:

if intTime > 7 then
   if intTime < 19 then
      wscript.quit
   end if
end if
0
 
maliksephurAuthor Commented:
what is the method to boot the machine at 7 am without using the bios... (e.g. wol) we would like this to be domain controllable as the machine(s) will change
0
 
CrashDummy_MSCommented:
You'll still need to go into the BIOS on the PC and make sure wake on LAN is enabled. Then you will need the MAC address of the network card it uses. For that, open a command prompt on the PC and type "ipconfig /all"
The physical address listed is your MAC address. Write it down without the dashes or colons and shut down the PC
Now get your copy of wolcmd that pzozulka posted and from another PC or server go to a command prompt and enter:
wolcmd YOURMACADDRESS

0
 
pzozulkaCommented:
The script below should be put into a batch file (saved as a .bat file), somewhere on a server share. Usually kept on a DC in \\domain.local\netlogon.

Create a Scheduled Task on the server, and call your .bat file.

The command line tool wolcmd is run from a dos prompt. The syntax is as follows:

wolcmd [mac address] [ip address] [subnet mask] [port number]

you can also do a local broadcast if you are running on an internal network thus

wolcmd [macaddress] 255.255.255.255 255.255.255.255

where mac address is the unique address of the network card. To find the mac address of a card you can either open the computer and read the address on the sticker on the card or much easier is, if you are using TCP/IP, ping the machine from a dos prompt (ping [machine name or ip number] i.e. ping delphi or ping 10.43.43.43) then issue an arp command (arp -a) which will list the ip number and physical address of the card.

If the port number is not specified it will default to port 7

Please take a look at this link, it explains a lot:
http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx
wolcmd 0017a4df6aa6 255.255.255.255 255.255.255.255

Open in new window

0
 
tankergoblinCommented:
where can i  set scheduled task to run shutdown.exe
0
 
CrashDummy_MSCommented:
Start, Programs, Accessories, System Tools, Task Scheduler.
Shutdown.exe should be in the Windows\system32 directory.
0
 
tankergoblinCommented:
the vbs script you given can be runned
0
 
maliksephurAuthor Commented:
Ultimately did this..

Set user to have logon hours set on domain server.

Set the machine to auto-login when windows starts.. http://support.microsoft.com/kb/315231

set the BIOS to boot the machine just after the login allowed time...

done.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now