run WPF window in remote user session RRS feed

  • Question

  • i have many machines pending reboot. I want to run a powershell script to present the logged in session a window, giving them the option to click and initiate a reboot immediately, or later in the evening.

    i have written the powershell code with a wpf gui.

    I have tried to run this remotely a few different ways, but without any luck.

    If i run invoke-command on my own machine, it works, the window appears, if i add the -computername it fails.

    i have tried running it using psexec, but it tells me the XamlReader is unable to load, even on my own machine, however the code runs properly interactively.

    Any ideas?

    Wednesday, January 6, 2016 7:26 AM


  • You cannot inject code into a user session.  Your only choice is to schedule a script to run under the logged in user.


    • Marked as answer by ahdlstn Wednesday, January 6, 2016 7:47 AM
    Wednesday, January 6, 2016 7:40 AM