+ Post New Thread
Page 8 of 9 FirstFirst ... 456789 LastLast
Results 106 to 120 of 123
Windows Thread, Software to shut down PC's? in Technical; Anyone have issues with shutdown scripts that sometimes leaves machines without a logon screen the next morning ? ctrl-alt-del brings ...
  1. #106

    Join Date
    May 2010
    Posts
    1,010
    Thank Post
    102
    Thanked 75 Times in 61 Posts
    Rep Power
    47
    Anyone have issues with shutdown scripts that sometimes leaves machines without a logon screen the next morning ? ctrl-alt-del brings it back. It's quite random and I can't replicate it during the holidays. (XP)
    Last edited by caffrey; 21st May 2013 at 02:47 PM.

  2. #107

    Join Date
    Apr 2010
    Posts
    2,032
    Thank Post
    82
    Thanked 187 Times in 154 Posts
    Rep Power
    83
    But if the machine is locked then someone is logged on.
    You might want to look at the GP preferences / control panel / scheduled tasks.

    It has options like 'run weather a user is logged in or not' 'run with higher privelges' Would have thought (but not tried) that it must be possible.

    Also not sure what /f = (Forces the chosen action) would do which is part of the ShutdownTool.

  3. #108

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,729
    Thank Post
    1,271
    Thanked 1,644 Times in 1,100 Posts
    Blog Entries
    22
    Rep Power
    505
    Just thinking through using the Config Manager Shutdown Utility with SCCM.

    If you advertise a shutdown at say... 5pm, aren't all the computers that were off pick up the advert the next day when they power on, and then shut down?

  4. #109
    Norphy's Avatar
    Join Date
    Jan 2006
    Location
    Harpenden
    Posts
    2,233
    Thank Post
    50
    Thanked 271 Times in 209 Posts
    Blog Entries
    6
    Rep Power
    108
    You could always set up maintenance windows and make sure that it doesn't run outside of those.

    Of course, that would bugger up anything else you've got going inside maintenance windows

  5. #110

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,729
    Thank Post
    1,271
    Thanked 1,644 Times in 1,100 Posts
    Blog Entries
    22
    Rep Power
    505
    Quote Originally Posted by Norphy View Post
    You could always set up maintenance windows and make sure that it doesn't run outside of those.

    Of course, that would bugger up anything else you've got going inside maintenance windows
    Gah! There's always something!

    Might be easier to use a scheduled task as per @edutech4schools suggestion

  6. #111

    Join Date
    Mar 2007
    Location
    Norfolk.
    Posts
    166
    Thank Post
    28
    Thanked 8 Times in 8 Posts
    Rep Power
    16
    I'm having trouble getting the gui to show on the scheduled task, even with interact with desktop ticked on task scheduler service.

    Going to play some more on this tomorrow.

  7. #112

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,703
    Thank Post
    3,235
    Thanked 1,043 Times in 965 Posts
    Rep Power
    363

  8. #113

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,729
    Thank Post
    1,271
    Thanked 1,644 Times in 1,100 Posts
    Blog Entries
    22
    Rep Power
    505
    Quote Originally Posted by mac_shinobi View Post
    Does this work with win 7? Don't think that he ever released the promised version for this.

    I'll try and catch him to find out, don't think he visits the site anymore.

  9. Thanks to sparkeh from:

    mac_shinobi (22nd May 2013)

  10. #114

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,703
    Thank Post
    3,235
    Thanked 1,043 Times in 965 Posts
    Rep Power
    363
    Quote Originally Posted by sparkeh View Post
    Does this work with win 7? Don't think that he ever released the promised version for this.

    I'll try and catch him to find out, don't think he visits the site anymore.
    Like you said although it does state partial win 7 support on the site ??

  11. #115

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,729
    Thank Post
    1,271
    Thanked 1,644 Times in 1,100 Posts
    Blog Entries
    22
    Rep Power
    505
    Quote Originally Posted by sparkeh View Post
    Just thinking through using the Config Manager Shutdown Utility with SCCM.

    If you advertise a shutdown at say... 5pm, aren't all the computers that were off pick up the advert the next day when they power on, and then shut down?
    Duh! Helps to read the arguments file. You can specify some options when not to run the shutdown, eg time past since last shutdown is greater/less then a set amount.
    That should sort the problem.

  12. #116

    Join Date
    Mar 2007
    Location
    Norfolk.
    Posts
    166
    Thank Post
    28
    Thanked 8 Times in 8 Posts
    Rep Power
    16
    I'm running that Coretech shutdown tool for logged on users.. but i'm also running a shutdown vbs script that will shutdown any computers
    left on, but logged off. Find this with a LOT of student computers where the teacher hasnt bothered to shut them down.

    Works perfect! I've added it to task scheduler to shutdown at 4pm and again later in case some are here later, but fail to shutdown.

    '* Script Name: ShutDownIfNotLoggedOn - Local.vbs
    '* Created On: 12/13/2007
    '* Author: Michael C. Panagos
    '* Website: Real solutions shouldn't be hard to find - The Grim Admin
    '* Purpose: Script to get current user logged on and perform shutdown on computer if no one is logged on
    '* History: Michael C. Panagos 12/13/2007
    '* Initial Draft.
    '* Legal: Copying and distribution of this code, with or without modification,
    '* are permitted in any medium without royalty provided the copyright
    '* notice and this notice are preserved. This code is offered as-is,
    '* without any warranty.


    'Account used to run script needs WMI permissions to shut down computer.

    'Set error capture
    On Error Resume Next

    'Get local computer name
    Set wshNetwork = WScript.CreateObject( "WScript.Network" )
    strComputerName = wshNetwork.ComputerName
    'strComputerName = "ComputerABC" 'For testing specific computer

    'Setup WMI calling for logon name and shutdown assignment
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputerName & "\root\cimv2")

    'Get currently logged on user's username
    Set colComputer = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
    For Each objComputer in colComputer
    If IsNull(objComputer.UserName) Then 'If no one is logged on
    strLoggedOn = "No"
    Else
    strLoggedOn = "Yes"
    End If
    Next

    'If no one is logged on shut down the computer
    If strLoggedOn = "No" Then
    For each objOperatingSystem in GetObject("winmgmts:{(Shutdown)}!").InstancesOf("W in32_OperatingSystem")
    objOperatingSystem.Win32Shutdown 1
    Next
    End If
    Last edited by ChrisN-0123; 23rd May 2013 at 09:33 AM.

  13. #117

    Join Date
    Apr 2010
    Posts
    2,032
    Thank Post
    82
    Thanked 187 Times in 154 Posts
    Rep Power
    83
    I thought that if you had the scheduled task set to login as an admin and with elevated perms you could run Coretech shutdown tool when not logged in. When I get a chance I will test, as that is a much simpler method.

  14. #118
    cuester's Avatar
    Join Date
    Jul 2011
    Location
    Nova Scotia, Canada
    Posts
    14
    Thank Post
    1
    Thanked 4 Times in 4 Posts
    Rep Power
    7
    I have poweroff running fine with windows 7 machines as well as locked down workstations

  15. #119

    Join Date
    Jun 2007
    Location
    Colchester, Essex, UK
    Posts
    56
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    21

    Lightbulb

    I have just set up a scheduled task via Group Policy Preferences, which detects if anyone is logged on, and if not, shuts down the machine when it is idle.

    This is all without scripting etc - performed entirely with built-in Windows tools and Windows Batch FTW!

    Code:
    Control Panel Settings/Scheduled Tasks
    	New Scheduled Task (Windows Vista and later)
    		Action: Replace (required to be able to remove it when it falls out of policy)
    		Name: Shutdown on Idle
    		When running the task, use the following user account: NT AUTHORITY\System (just enter 'System' in the selection box)
    			(Run only when user is logged on - default - works fine)
    			(No need to run with highest privileges - works fine)
    		Triggers...
    			New Trigger -> On idle
    			Repeat task every: 5 minutes
    				For a duration of: Indefinitely (catch cases where the user logon state changes while still idle)
    			(Activate: set to the time we created the task)
    		Actions...
    			New Action -> Start a program
    			Program/script: %ComSpec%
    			Add arguments: /C "for /f "tokens=* usebackq" %i IN (`%WINDIR%\system32\wbem\wmic.exe ComputerSystem GET UserName /value ^| findstr /X "UserName="`) DO "%WINDIR%\system32\shutdown.exe" -s -t 60"
    			(This command will run 'wmic.exe ComputerSystem GET UserName to detect if a user is logged on, and if the UserName field is blank, run the system shutdown)
    		Conditions...
    			Start the task only if the computer is idle for: 15 minutes
    			(Can't get the idle timeout any lower than 15 minutes, as Windows only checks the state that often - http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx)
    				Wait for idle for: Do not wait
    			Stop if the computer ceases to be idle
    		Settings...
    			(Allow task to be run on demand - for testing)
    		Common...
    			Remove this item when it is no longer applied
    Hope this might help some other people trying to achieve the same thing. As it says in the notes, it's hard to get the idle timeout any lower than 15 minutes, as Windows only checks the 'Idle' state itself that often. If you start up a machine and then wait for it to shut down, it usually takes about 26 minutes to do so - this is probably due to Windows not checking the idle state for at least 15 minutes after startup, plus the idle time itself. However if you wait it does work, and seems fine on all our computers so far.
    Last edited by Minkus; 4th November 2013 at 04:56 PM.

  16. #120

    Join Date
    Oct 2013
    Location
    Leicestershire
    Posts
    50
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    11
    Earlier in this post someone showed some PowerShell, you can do both with PS Stop-Computer will shutdown computers and along with Get-Content you could put the names of all the computers in a file and have it shutdown whole networks, or you could do something more sophisticated and create an array out of AD with the names of the workstations then I suppose you could test if they are powered up and if a users is logged in and the like (although Stop-Computer will throw an exception if a user is logged on and you don't use the -Force) all not so difficult if you spend a little time. Use along side WOL starter for 10 here Script Send WOL packet using Powershell again don't take much to make the script get MAC addresses from AD/ DHCP. PowerShell is your friend here and can save some money and I think if you give it a little thought you can make a solution that works well for your network needs rather then trying to make an off the shelf solution do what you want.
    Last edited by HPlum78; 5th November 2013 at 10:56 AM.

SHARE:
+ Post New Thread
Page 8 of 9 FirstFirst ... 456789 LastLast

Similar Threads

  1. UPS Won't Shut Up.
    By Greg_Jones in forum Hardware
    Replies: 12
    Last Post: 27th November 2007, 09:21 AM
  2. Replies: 6
    Last Post: 19th October 2007, 02:48 PM
  3. Shut Down Options
    By tomlin in forum How do you do....it?
    Replies: 9
    Last Post: 7th October 2007, 12:59 AM
  4. Script to shut down computers in a certain OU
    By tosca925 in forum Scripts
    Replies: 11
    Last Post: 25th September 2005, 09:23 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •