locked
Stop-Computer and Restart-Computer fails for Windows XP when in logon screen RRS feed

  • Question

  • Hi!

    I have 10 computers, 9 of which use Windows 7 SP1 and 1 uses Windows XP SP3. They all exist in the same workgroup (no domain) with identical accounts and passwords and I use an administrative account.

    I can successfully use Stop-Computer and Restart-Computer in all computers (Stop-Computer -ComputerName <name> -Force), but both commands fail with Windows XP only when the login screen is active with a message "Device is not ready". If I login to any user, these commands work. With Windows 7 these commands work even when the login screen is active. Is this some limitation with Windows XP or do I need to tweak a setting?

    Tuesday, October 17, 2017 6:28 PM

All replies

  • You need to fix the XP systems.  XP is no longer supported by MS and the expertise here is long gone.  XP is very unsecure do to lack of updates and really should not be used.


    \_(ツ)_/

    Wednesday, October 18, 2017 1:11 AM
  • Yes, I am aware of the age of XP. This system is very old with 512MB RAM and I just can't upgrade it or replace it. It's for little kids who use some installed educational software. I have installed Powershell 2.0 in this system which is XP SP3 compatible. The only way I found to restart it and power it off is with psshutdown from PStools, but it would be nice if I could do it with powershell too.

    • Edited by Wizard270 Wednesday, October 18, 2017 4:47 AM
    Wednesday, October 18, 2017 4:46 AM
  • Sorry but you will have to fix the system to get it to work.

    Since XP and PS2 are no longer supported by MS there is a high likelihood that the code on XP for PS no longer works.

    You can try WIn32_OperatingSystem "Win32ShutDoown(8)" from WMI.


    \_(ツ)_/


    • Edited by jrv Wednesday, October 18, 2017 4:55 AM
    Wednesday, October 18, 2017 4:53 AM
  • If there's really no other way and you have with psshutdown a way it works you can even use this from within Powershell. Powershell is a command line interface and able to start tools.

    Best regards (79,108,97,102|%{[char]$_})-join''

    Wednesday, October 18, 2017 6:29 AM
  • Psshutdown works by itself, I don't need to use it through powershell. The funny thing is that psshutdown doesn't support XP!

    Anyway, I tried (gwmi win32_operatingsystem -ComputerName <name>).Win32Shutdown(12) and it works to power it off, but (gwmi win32_operatingsystem -ComputerName <name>).Win32Shutdown(6) doesn't work to restart it.

    Thanks for your help!

    Wednesday, October 18, 2017 12:52 PM
  • Hi,

    Thanks for your sharing and support.

    Best Regards,
    Frank


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, October 24, 2017 3:39 PM