Script to shutdown the computer

Is there script available that can be deployed to collection to shutdown the machines. If someone is logged on to the machine they get a prompt and can cancel the shutdown.
We should be able to depoy the script through SCCM 2012 R2.

Probably not prewritten, but that should be easy to write.
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing)

Similar Messages

  • Hey Dears, I was working with my Macbook pro 2011, then i have some flash light in the screen, so i shutdown the computer, when i try to open it again i had a black screen, so any one of you have any idea about what should i have to do ?

    Hey Dears, I was working with my Macbook pro 2011, then i have some flash light in the screen, so i shutdown the computer, when i try to open it again i had a black screen, so any one of you have any idea about what should i have to do ?

    Can you start Firefox in [[Safe mode]] ?
    You can also do a clean reinstall and download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You can initially skip the step to create a new profile, that may not necessary for this issue.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • Hibernation does not shutdown the computer

    Hello,
    the hibernation was working perfectly until one of the last updates. I can not say exactly when things get broken since I didn't rebooted my computer for weeks (it was in hibernation only) and so the last kernel updates were probably not applied... However, after a real reboot, when I hibernate now, everything works fine except that I have to "shutdown" the computer manually pressing the on/off button myself. When I start the computer again, it resumes from hibernation perfectly without doing the whole start sequence...
    Does someone have an idea where I could look for to avoid pressing the on/off button myself to close the computer?
    Thanks for your help,
    Salvatore
    PS: I am working with KDE and have an ATI graphic card.

    I investigate the polkit area... arrived to the file "/usr/share/polkit-1/actions/org.freedesktop.login1.policy" that I modified frw time ago (to enable my wife to hibernate when my session was open). I thought the problem may come from here... so I reinstalled systemd and other small package to recover the original configuration of the files in the directory /usr/share/polkit-1/actions/.
    But it is still not working... I start to loose my hope
    You can find below the end of /var/log/pm-powersave.log :
    /usr/lib/pm-utils/power.d/laptop-mode false: success.
    Running hook /usr/lib/pm-utils/power.d/pcie_aspm false:
    /usr/lib/pm-utils/power.d/pcie_aspm: ligne 9 : echo: erreur d'écriture : Opération non permise
    /usr/lib/pm-utils/power.d/pcie_aspm false: success.
    Running hook /usr/lib/pm-utils/power.d/readahead false:
    Setting readahead for /dev/sdb1 to 256...Done.
    Setting readahead for /dev/sda1 to 256...Done.
    Setting readahead for /dev/sdb6 to 256...Done.
    Setting readahead for /dev/sdb7 to 256...Done.
    Setting readahead for /dev/sdb8 to 256...Done.
    /usr/lib/pm-utils/power.d/readahead false: success.
    Running hook /usr/lib/pm-utils/power.d/sata_alpm false:
    Setting SATA APLM on host2 to max_performance...Done.
    Setting SATA APLM on host3 to max_performance...Done.
    Setting SATA APLM on host4 to max_performance...Done.
    Setting SATA APLM on host5 to max_performance...Done.
    /usr/lib/pm-utils/power.d/sata_alpm false: success.
    Running hook /usr/lib/pm-utils/power.d/sched-powersave false:
    **sched policy powersave OFF
    /usr/lib/pm-utils/power.d/sched-powersave false: success.
    Running hook /usr/lib/pm-utils/power.d/wireless false:
    /usr/lib/pm-utils/power.d/wireless false: success.
    Running hook /usr/lib/pm-utils/power.d/xfs_buffer false:
    /usr/lib/pm-utils/power.d/xfs_buffer false: success.
    Running hook /usr/lib/pm-utils/power.d/hal-cd-polling false:
    /usr/lib/pm-utils/power.d/hal-cd-polling false: success.
    Running hook /usr/lib/pm-utils/power.d/intel-audio-powersave false:
    Setting power savings for snd_hda_intel to 0...Done.
    /usr/lib/pm-utils/power.d/intel-audio-powersave false: success.
    Running hook /usr/lib/pm-utils/power.d/journal-commit false:
    Setting journal commit time for / to 0...Done.
    Setting journal commit time for /media/BACKUP to 0...Done.
    Setting journal commit time for /media/DIVERS to 0...Done.
    Setting journal commit time for /media/MEDIA to 0...Done.
    Setting journal commit time for /media/DATA to 0...Done.
    /usr/lib/pm-utils/power.d/journal-commit false: success.
    Running hook /usr/lib/pm-utils/power.d/laptop-mode false:
    Laptop mode disabled.
    /usr/lib/pm-utils/power.d/laptop-mode false: success.
    Running hook /usr/lib/pm-utils/power.d/pcie_aspm false:
    /usr/lib/pm-utils/power.d/pcie_aspm: ligne 9 : echo: erreur d'écriture : Opération non permise
    /usr/lib/pm-utils/power.d/pcie_aspm false: success.
    Running hook /usr/lib/pm-utils/power.d/readahead false:
    Setting readahead for /dev/sdb1 to 256...Done.
    Setting readahead for /dev/sda1 to 256...Done.
    Setting readahead for /dev/sdb8 to 256...Done.
    Setting readahead for /dev/sdb7 to 256...Done.
    Setting readahead for /dev/sdb6 to 256...Done.
    /usr/lib/pm-utils/power.d/readahead false: success.
    Running hook /usr/lib/pm-utils/power.d/sata_alpm false:
    Setting SATA APLM on host2 to max_performance...Done.
    Setting SATA APLM on host3 to max_performance...Done.
    Setting SATA APLM on host4 to max_performance...Done.
    Setting SATA APLM on host5 to max_performance...Done.
    /usr/lib/pm-utils/power.d/sata_alpm false: success.
    Running hook /usr/lib/pm-utils/power.d/sched-powersave false:
    **sched policy powersave OFF
    /usr/lib/pm-utils/power.d/sched-powersave false: success.
    Running hook /usr/lib/pm-utils/power.d/wireless false:
    /usr/lib/pm-utils/power.d/wireless false: success.
    Running hook /usr/lib/pm-utils/power.d/xfs_buffer false:
    /usr/lib/pm-utils/power.d/xfs_buffer false: success.
    Running hook /usr/lib/pm-utils/power.d/hal-cd-polling false:
    /usr/lib/pm-utils/power.d/hal-cd-polling false: success.
    Running hook /usr/lib/pm-utils/power.d/intel-audio-powersave false:
    Setting power savings for snd_hda_intel to 0...Done.
    /usr/lib/pm-utils/power.d/intel-audio-powersave false: success.
    Running hook /usr/lib/pm-utils/power.d/journal-commit false:
    Setting journal commit time for / to 0...Done.
    Setting journal commit time for /media/BACKUP to 0...Done.
    Setting journal commit time for /media/DATA to 0...Done.
    Setting journal commit time for /media/MEDIA to 0...Done.
    Setting journal commit time for /media/DIVERS to 0...Done.
    /usr/lib/pm-utils/power.d/journal-commit false: success.
    Running hook /usr/lib/pm-utils/power.d/laptop-mode false:
    Laptop mode disabled.
    /usr/lib/pm-utils/power.d/laptop-mode false: success.
    Running hook /usr/lib/pm-utils/power.d/pcie_aspm false:
    /usr/lib/pm-utils/power.d/pcie_aspm: ligne 9 : echo: erreur d'écriture : Opération non permise
    /usr/lib/pm-utils/power.d/pcie_aspm false: success.
    Running hook /usr/lib/pm-utils/power.d/readahead false:
    Setting readahead for /dev/sdb1 to 256...Done.
    Setting readahead for /dev/sda1 to 256...Done.
    Setting readahead for /dev/sdb6 to 256...Done.
    Setting readahead for /dev/sdb7 to 256...Done.
    Setting readahead for /dev/sdb8 to 256...Done.
    /usr/lib/pm-utils/power.d/readahead false: success.
    Running hook /usr/lib/pm-utils/power.d/sata_alpm false:
    Setting SATA APLM on host2 to max_performance...Done.
    Setting SATA APLM on host3 to max_performance...Done.
    Setting SATA APLM on host4 to max_performance...Done.
    Setting SATA APLM on host5 to max_performance...Done.
    /usr/lib/pm-utils/power.d/sata_alpm false: success.
    Running hook /usr/lib/pm-utils/power.d/sched-powersave false:
    **sched policy powersave OFF
    /usr/lib/pm-utils/power.d/sched-powersave false: success.
    Running hook /usr/lib/pm-utils/power.d/wireless false:
    /usr/lib/pm-utils/power.d/wireless false: success.
    Running hook /usr/lib/pm-utils/power.d/xfs_buffer false:
    /usr/lib/pm-utils/power.d/xfs_buffer false: success.
    There is a strange line with an error (in French):
    /usr/lib/pm-utils/power.d/pcie_aspm: ligne 9 : echo: erreur d'écriture : Opération non permise
    that means : line 9: write error - operation not allowed.
    Any idea how can I allow pcie_aspm to shutdown my computer ?

  • I can't shutdown the computer.

    Can't shutdown the computer.

    I am having the same trouble. Windows 8 is operating system. It's a pavillion g6

  • My MacBook Air constantly freezes when surfing the Internet and I keep having to restart or shutdown the computer. Any advice on what could be wrong?

    My MacBook Air constantly freezes when surfing the Internet and I keep having to restart or shutdown the computer. Any advice on what could be wrong?

    My MacBook Air constantly freezes when surfing the Internet and I keep having to restart or shutdown the computer. Any advice on what could be wrong?

  • How do I run an Apple Script only when the computer is awake at the specified time and NOT upon waking after the specified time?

    I've been using Steve Lambert's SelfControl to block myself from certain time-sucking internet sites for a certain period of time every day. I've automated the program launch using an AppleScript that runs based on an iCal alarm, but the problem is that if my computer has been asleep or shut off, the script will run as soon as I wake it up or start it up, and that can be very inconvenient if I'm intending to use my computer not during the hours when I intended to restrict access to such websites.
    So, is there any way to schedule an AppleScript to run *only* if the computer is running at the designated time and not upon waking/starting up after the alarm has passed if the computer was asleep/off?
    I started investigating launchd, as I understand this is the successor to cron/crontab in OS X Lion, but it appears that launchd has the same behavior I dislike in the iCal alarm approach--the script will run upon waking even if the time when it was supposed to run has already passed...unless there is a way to change this behavior?

    The obvious/easy solution would be to add some logic to the script to see what the time is.
    If you expect the script to run at, say, 1pm, but the script checks the time and sees that it's 5pm then you can assume the machine was asleep at the time and thefore you can bail out gracefully.
    if (hours of (get current date)) = 13 then
      -- it's sometime in the 1pm hour...
    end if
    You can fine-tune the check as much as you like

  • Poweshell script for adding the computer object in to SCOM 2012 group.

    Hi Team,
    Is there any way to add the computer object ( csv file) to SCOM 2012 manually created  group.

    Hi,
    In addition, hope the links below be helpful for you:
    Creating and Updating Groups
    http://blogs.msdn.com/b/jakuboleksy/archive/2006/11/15/creating-and-updating-groups.aspx
    Programmatically Creating Groups
    http://blogs.technet.com/b/brianwren/archive/2008/11/18/programmatically-creating-groups.aspx
    Modifying Explicit Group Membership in SCOM 2012 with PowerShell
    http://blogs.msdn.com/b/rslaten/archive/2013/06/27/modifying-explicit-group-membership-in-scom-2012-with-powershell.aspx
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • I can't shutdown the computer without using force shutdown when firefox is active

    Firefox prevents my computer from shutting down. I have to use "Force shutdown".
    In case I am canceling the shutdown, Firefox freezes and then crashes.

    Hello,
    I second this. Programs should close gracefully when asked by windows during a system shutdown. Firefox crashes instead. This happens with full version 4 also, not just beta.
    When asking Firefox to close after initiating a shutdown (and it not happening), you find that it has crashed, become unresponsive, and one must close it thru the task manager.
    I hope this is fixed in an update soon! Firefox 4 looks to be the best yet!

  • "Program Not Responding" and cannot shutdown the computer? Help?

    I have a TouchSmart tx2, upgraded from Vista to Win 7 Ultimate, 32-bit.  The BIOS version is F.03, Released 2008 11 25.  My computer will not shut down...I get a blank screen and the constant whirrrrrr of the hard drive but it will not shut down and I am forced to do a hard shut down and restart in SAFE mode.   Further, I get the "Program not responding"  problem 6 to 7 times a day while running Outlook, and several other programs.  I'm not sure what to do at this point?  Help?

    Same problem here since an upgrade to the recent xbmc version.
    - hal removed
    - udisks and upower installed
    - my user is in the 'power' group
    I start X via /etc/inittab:
    x:5:respawn:/bin/su lynix -l -c "/bin/bash --login -c 'startx xbmc'>/dev/null 2>&1"
    and my .xinitrc is:
    #!/bin/sh
    nvidia-settings -l
    if [ "$2" == "xbmc" ]; then
    # start XBMC
    exec ck-launch-session /usr/bin/dbus-launch --exit-with-session /usr/bin/xbmc --standalone -fs --debug &>$HOME/.xsession-errors
    else
    # start openbox session
    exec ck-launch-session openbox-session &>$HOME/.xsession-errors
    fi
    Any hints what could be wrong?

  • Cannot shutdown the computer via XBMC

    I cannot shutdown my HTPC via XBMC. When I try to shut it down, I just ends up back in the shell. Im not running any WM and I autostart XBMC via .xinitrc so I have to make a hard shutdown everytime.
    Dunno what to do?
    Last edited by Hund (2011-01-04 23:52:54)

    Same problem here since an upgrade to the recent xbmc version.
    - hal removed
    - udisks and upower installed
    - my user is in the 'power' group
    I start X via /etc/inittab:
    x:5:respawn:/bin/su lynix -l -c "/bin/bash --login -c 'startx xbmc'>/dev/null 2>&1"
    and my .xinitrc is:
    #!/bin/sh
    nvidia-settings -l
    if [ "$2" == "xbmc" ]; then
    # start XBMC
    exec ck-launch-session /usr/bin/dbus-launch --exit-with-session /usr/bin/xbmc --standalone -fs --debug &>$HOME/.xsession-errors
    else
    # start openbox session
    exec ck-launch-session openbox-session &>$HOME/.xsession-errors
    fi
    Any hints what could be wrong?

  • My Macbook pro keeps quitting Safari while browsing. I have to shutdown the computer and restart to access the internet or my email. I t works for about 5 minutes then quits

    My Macbook Pro cannot sustain Safari for more than 5 minutes. Once I hit return the "working" icon just keeps going round and round. The only way to access the internet or my email is to totally shut down and then restart.
    Is there something I can check to see if there is a virus or is this a common problem. I just returned from a trip to the states and had no problem using my laptop there. I have had no problems until about 6 hours ago.
    Help!!!!

    Mac Basics: Time Machine
    Resetting your keychain in Mac OS X

  • Safari blocks, shutdown the computer, all files lost.

    I'm new to Mac's and I was simply ecstatic till yesterday.
    Safari went down during normal internet activity. Since I didn't now what to do and Safari wasn't responding to anything, I just closed all others applications and shut down the Mac (it is a knock-out, but it usually works with Windows).
    After restarting, all my files that were created or modificated till the previous day were gone. Also, some things like dock preferences were changed to default.
    I can only be happy to the fact I had the Mac for just one week, so i didn't lost too many things. But it's a problem that makes me really uncomfortable in doing anything with my MacBook.
    So, what happened?
    MacBook   Mac OS X (10.4.9)  

    To properly close an app that is not responding use:
    Command-OPtion-Escape keys
    A window will open showing all running apps (and those not responding). Highlight the offender and "Force Quit".

  • Is it possible to shutdown the computer using java?

    If any of you knows, please tell me thanks!

    Anione who can answer me with an example will get 10 Duke Dollars. plssss.... tell me...

  • Script to completely shutdown the concurrent manager

    Use this script to shutdown the concurrent manager completely. It will wait till all processes die.
    #!/bin/sh
    # Author: Praveen Gattu
    # Created: June 2007
    # Figure out how you want to pass the variables DB_USER (username
    # for APPS schema) and DB_PSWD (password for APPS). You can
    # hardcode in this script (not recommended), prompt the user
    # to enter them, etc.
    # stop the concurrent manager
    $SCRIPTS_TOP/adcmctl.sh stop $DB_USER/$DB_PSWD
    # check if the processes are alive
    SPOOL_FILE="$APPLTMP/stop_cm_$TWO_TASK.tmp"
    while [ "$RETURN_VALUE" != "0" ]; do
    sqlplus -silent $DB_USER/$DB_PSWD << EOF
    spool $SPOOL_FILE
    select concurrent_queue_name, running_processes
    from fnd_concurrent_queues
    where running_processes > 0;
    spool off
    EOF
    egrep --silent "no rows selected" $SPOOL_FILE
    RETURN_VALUE=$?
    if [ $RETURN_VALUE -ne 0 ]; then
    echo "Concurrent manager processes are still active. Sleeping for 10 seconds..."
    sleep 10
    fi
    done
    rm $SPOOL_FILE
    echo "** Concurrent Manager and its processes are stopped **"

    Far as I know DSH exist by default in AIX env, but you can create it on Linux\Unix env.
    Creating DSH in a Linux Env.
    1 - Configure passwordless SSH between Nodes using root user.
    2 - Create a file /etc/dsh.conf with all hostsname separated with space in a line ( ex. node1 node2 node3)
    3-  Create a script "/usr/local/scripts/dsh" as follow:
    #!/bin/bash
    COMANDO=$*
    NODES=`cat /etc/dsh.conf`
         for NODE in $NODES
         do
         echo $NODE:
    ssh $NODE $COMANDO
         done
    exit 0
    4 - Change permission of file /usr/local/scripts/dsh to 775
    Just run
    # /usr/local/scripts/dsh date
    or
    # /usr/local/scripts/dsh /u01/app/grid/bin/crsctl stop crs

  • When we shutdown the pc,it showing force to close application and how to avoid this.

    Hi Support,
    Whenever i am shutting down the computer,every time it is showing " force to close the application" YES or NO.If we click on YES,it is closing the application and shutting down.
    Even i have checked, none of the applications are running but it is showing force to close the applications.If we click on Yes,it is shutting down.
    Please let me know how what are the checklist to be checked in the computer before shutting down the computer.
    Regards
    Pradeep.R

    Hi Pradeep,
    Method one:
    You could use the command to force shutdown:
    1. Open the command prompt with administrator.
    2. Type shutdown /f /s /t 00
    3. Press Enter.
    It would shutdown the Windows immediately.
    Method two:
    Create a shortcut of shotdown that would work immediately
    1. Right click desktop, select New-> Shortcut
    2. Type as below:
    3. Click Next and then create the shortcut name to finish it.
    4. You also could pin it to taskbar as other application(optional).
    Every time you need to shutdown the computer, run this shortcut.
    Method three:
    You could add an entry to registry to change this behavior. For more information, please refer to this thread:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/how-to-premantly-stopprevent-the-force-close/b5634d40-eb31-44ae-8b34-bbd68ba412f5
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for