Need help sending dialog to remote computer and saving results

As the title states, what I want to do is send a dialog box to all remote computers listed in the array $compnames where I can receive a yes or no and either save this as a file or array to pass back to my local computer to shutdown the ones where either
a yes or no answer is received. I have the following code segment and I am missing the no answer received part and I am not sure how to receive the responses form each computer.
Invoke-Command -ComputerName $element -scriptblock {
[system.reflection.assembly]::LoadWithPartialName("system.windows.forms")
$useOutput = [System.Windows.Forms.MessageBox]::Show("The Lab is being shut down. Press YES to abort.", "WARNING", 'YesNo', 'Exclamation')
if ($useOutput -eq [Windows.Forms.DialogResult]::Yes)
$sendBack = 0
Write-Output $sendBack
else
$sendBack = 1
Write-Output $sendBack
<# TODO: 1) write computer name and whether a user clicked yes to abort to a csv file (save just no's for logs)
1.1) maybe add computer name to
2) immediately shut down any computer where user allows shutdown
3) after 30 seconds, add remaining computers with no action to csv file to shut down
4) Open messagebox popup on host computer to ask if want to shutdown remaining computers
5) Shut down remaining computers
#>
if ($sendBack -eq 1)
#if the computer is ready to turn off
#shut it down
else
#add to array or file to be shut down later
Any guidance or advice would be great! 
-------Edit 1-----------
In accordance with what this first two commenters have posted. I am thinking of a quirky solution.
What if I have a script on the remote computer that I call with the Invoke-Command that opens a message box and then depending on the response uses the msg.exe cmdlet to send either a 1 or a 0 back. The host computer then takes these answers and creates
two arrays, one for yeses and one for nos. I guess the only issue with this would be is receiving the messages in an orderly manner over the course of 30seconds and having the messages be 'silent' so the script picks them up but there is no explicit message
pop up on my computer.
I have found the following from the invoke-command section of ss64.com:
"Run the Test.ps1 script on the Server64 computer. The script is located on the local computer. The script runs on the remote computer and the results are returned to the local computer:PS C:\> invoke-command -filepath c:\scripts\test.ps1 -computerName
Server64"
So could I not send a message box through this and have the result returned to me?

Actually, it might be doable (albeit not all that ... cleanly):
Create a task on the remote computer that will run under any currently logged in user which displays a messagebox that returns values and writes the result to a file. (Which will of course require a folder where all users have write permissions to to write
the files in)
Trigger the task
Check for result files
Cheers,
Fred
There's no place like 127.0.0.1

Similar Messages

  • Need help with my Toshiba remote control and receiver for Qosmio G30 161

    Hello to all
    I have a Toshiba Qosmio G30-161 and with it I have a Toshiba remote control and a Toshiba remote control receiver, this is the first time I have used it (tried to that is), my problem is the remote is not working on the computer when I press any program buttons the computer does nothing.
    I have installed four brand new AA batteries and the remote works fine its sending signals to the receiver, the receiver the detecting the remote as a red light appears every time you press a button and as for the computer I have checked the drivers and the USB is picking up the receiver as a E-home remote receiver which I have checked with Toshiba and that is correct, so all in all the remote is working, the receiver is picking up signals and the pc has detected the receiver but nothing works, I have installed remote control manager but this still has done anything. I have spoken to Toshiba help and support and the end result is they are not sure what the problem is. Can anyone help I require the remote for slideshows for customers as I??m a photographer.
    Also to confirm I am running Windows XP MCE addition.
    Anthony Worlock

    Hi there,
    this remote contol works, if you use it without any special drivers and special software, only in the Media Center.
    But if you install such stuff like [WinLirc|winlirc.sourceforge.net] then you should be able to get some functions for your presentation.
    Please try this tool and check if it works.
    By the way: If I were you I would first read the Manual and FAQ of WinLirc before starting because its a little bit tricky to handle the program. :) (Too many settings :D)
    Greets

  • I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??

    I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??

    Try
    iOS: Device not recognized in iTunes for Windows
    or
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X

  • I need help with the iPad Remote app to connect to apple TV 2

    I need help with the iPad Remote app to connect to apple TV 2 I have the app already on my ipad and when I open it only shows my itunes library and not the small black Apple TV 2 icon! How do i fix this and i know it's something 

    Get the manual at http://manuals.info.apple.com/en_US/AppleTV_SetupGuide.pdf
     Cheers, Tom

  • Need help coping project from one computer to another.

    I need help coping project from one computer to another.  I loaded all video on computer 1, copied events and project folder to computer 2.  I was told I only needed to copy the project folder back to computer 1 since the events folder is already there.   I copied project folder back to computer 1 but the files wont open.  I dont have computer 2 available. 
    Please help!!!

    Hi
    No that's not the way to do it - iMovie gets confused and in some cases the problems might be un-repairable.
    You've got several problems
    • iMovie'08 - CAN NOT MOVE PROJCTS - You NEED iMovie'09 or iMovie'11 - I see no other working solution
    • Never MOVE or alter any folder named
    iMovie Projects - or -
    iMovie Events
    on DeskTop/Finder - This might be very harmful
    • Moving (Projects) and Events - HAS TO be done within the iMovie Application.
    You've got an Evets window and here You can view Your Events in two ways - Yearly - or - Yearly per Hard disk
    Here You can move within this "window" to another location
    • Projects - NO they do not contain Your full movie - only a document on howto use the material in Event folder
    and there might be worse if You added Photos from iPhoto and Audio from iTunes/Garageband - then You have
    to get this over to the second Mac too, to be able to continue editing.
    So to move Your projects to another Mac You need
    • iMovie'09 or 11
    • an external hard disk -
    MUST BE Mac OS Extended formatted - as UNIX/DOS/FAT32/Mac OS Exchange will not work for VIDEO
    Should be a FireWire one - as UBS/UBS2 performs badly when used for video
    • Then move/copy over within Project resp Events window in iMovie Application
    Hopefully I've been not to confusing or badly structured to be followed.
    Yours Bengt W

  • I've tried reseting my sync accounts the way all of the help articles say, but my computer and two android devices just will not sync with this new FF Sync vers

    I've tried reseting my sync accounts the way all of the help articles say, but my computer and two android devices just will not sync with this new FF Sync version.
    I've tried unregistering the device sync accounts, removing the accounts, reinstalling FF on all devices, etc.
    Nothing works. Please help.

    Hi mongoose00318,
    On the android devices in the Account section of your OS settings, please make sure that the account is not listed under "Firefox Sync (deprecated)" this is the old sync. Firefox for Android may need to be reinstalled and the Firefox Sync (depricated) account removed from the device.
    NOTE: DO NOT do this if there is data on the devices that have not obviously synced yet. An alternative is to visit accounts.firefox.com to see if you are logged into the device on the new sync sign in page.
    Does this help?

  • How to send PublicKey to remote computer ?

    How to send PublicKey to remote computer ?
    And how to get PublicKey from remote computer?
    Will PublicKey generated by Microsoft RSA Base Cryptographic Provider work in jdk 1.3.1?
    Thanks for your attention!

    Certificate is like a container which holders the information of user and his public key.
    Put it into a certificate and sent it.

  • Need help my window is in thai and i dont understand at all.how to convert to english?

    need help my window is in thai and i dont understand at all.
    how to convert to english? i been trying for days but still cannot change it.
    because i cannot read thai..please help me step by step..
    my pc is touchsmart 9100 windows 7 professional.
    Not a single word is in english if i go to  'region and language' to change it.
    Everthing is in thai in the system.
    This question was solved.
    View Solution.

    Hi,
    OK. That means the default display lange of the OS is Thai. That is what was purchased. 
    You can try downloading  and using the  language appropriate LIPS (language interface package software) from Microsoft to change the  display language.
    Best regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook.......

    need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook? removal of cmos, resetting laptop, using cccleaner, windows password recovery and hiren's was noneffective, any help is appreciated. thanks

    Hi,
    As your notebook is a business class machine, security is more stringent - the password is stored in non-volatile memory and there are no 'backdoor' passwords.  Your best option would be to contact HP regarding this.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • I have tried everything I know to retrieve the iPhoto Library app.  I detest this new Photo app, which obviously wasn't designed with photographers in mind.  I desperately need help in retrieving the old app and have not been able to do it so far.

    I have tried everything I know to retrieve the iPhoto Library app.  I detest this new Photo app, which obviously wasn't designed with photographers in mind.  I desperately need help in retrieving the old app and have not been able to do it so far.  I have gone to my app folder and tried to update my iPhoto Library.  I have gone to my trash and brought it over to my desktop and still cannot use it.  Please help!

    Try this fix discovered by User photosb189:
    From Finder, hold down the option key on your keyboard and click on the Go menu at the top of the screen
    Select Library from the drop down menu
    Then navigate to Application Support > iLifeAssetManagement > assets
    Right click on the 'sub' folder and choose Compress
    Drag the resulting zip file to your Desktop (as a backup)
    Go to your System Preferences and choose iCloud
    Turn OFF the iCloud Photos option
    Go back to Library > Application Support and DELETE the iLifeAssetManagement folder
    Now, in System Preferences, turn the iCloud Photos option ON
    iPhoto should now be able to launch. Give it enough time to re-download your Photo Stream content. if you are missing any of your My Photo Stream photos (more than 30 days old), unzip the sub folder on your desktop and drag that into iPhoto.

  • I Need help. I Change My Number and now imessage don t work.

    I Need help. I Change My Number and now imessage don t work.

    Hi Ivonka88,
    Here are some steps to try troubleshooting your issue with, depending on your specific symptoms:
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Cheers!
    - Ari

  • I need help syncing my contacts between Outlook and iPhone using iTunes. I followed the steps given and ended up with just email addresses showing in my contacts even though I have phone numbers and snail mail in my Outlook Contacts. Using  Windows 7

    I need help syncing my contacts between Outlook and iPhone using iTunes. I used the knowldge document and set it up to transfer my Outlook contacts to the iphone using itunes.
    In contacts on the iphone I only see the email addresses.
    Yet in Outlook I have email, snail mail and phone numbers.
    I followed the knowledge document from iphone.
    I did it once, didn't work so deleted all the contacts from the phone and tried again. Same result. I have a PC using Windows 7 64 bit.

    You can't access an Exchange account via ActiveSync with the Address Book and iCal on your Mac.
    You can access a MM account with Outlook on your PC at work and keep your MM email account server stored mailboxes synced between your PC at work, your iPhone, and the MM "cloud". Not sure about syncing MM contact info and calendar events with Outlook at the same time with an Exchange account.
    This will not provide for syncing your Exchange account contact info and calendar events with the Addresss Book and iCal on your Mac because the accounts are separate.
    You can access an Exchange account and a MM account at the same time with the iPhone's mail client, and sync contact info and calendar events over the air with both accounts at the same time. You can view combined contact info or separately for each account, and the same for calendar events.

  • Need help on transportable tablespace, after convert and move datafile over

    I need help on transportable tablespace, after convert and move datafile over the target server, How do I plug them in to the ASM instance?
    And How do I start the database ? what controlfile I should use?
    Thanks.

    I got error like this:
    RMAN> copy datafile '/oracle_backup/stage/ar.269.775942363' to '+RE_DAT';
    Starting backup at 29-MAY-12
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 05/29/2012 17:46:21
    RMAN-20201: datafile not found in the recovery catalog
    RMAN-06010: error while looking up datafile: /oracle_backup/stage/ar.269.775942363
    How to deal with this?
    I deleted all the current target tablespaces including contents. Do I have to do anything to make the database recognize those converted datafiles?

  • Need help trying to use close button and i really like to know why it off

    need help trying to use close button and i really like to know why it off

    And in English? You need to explain better.
    Mylenium

  • Need help to Settings Apple iMAC 2012 and HP LaserJet 1100.

    Need help to Settings Apple iMAC 2012 and HP LaserJet 1100.
    I purchased a imac, 2012, before there was Windows 7. I have the HP LaserJet 1100 and Print Servers Trendnet TE100 P21, with Windows 7 it ​​worked, but with MAC OSX 10.8 does not want to, do not go printing. Could help with the setting?
    Нужна помощь в настроке Apple iMAC 2012 и HP LaserJet 1100.
    Я купил imac 2012, до этого был Windows 7. У меня есть принтер HP LaserJet 1100 и принтсервер Trendnet TE100 P21, с Windows 7 все работало, но с MAC OSX 10.8 работать не хочет, не идет печать. Могли бы помочь с настройкой?

    привет Roman,
    Mac OS X: About the Reset Printing System feature ...
    http://support.apple.com/kb/HT1341?viewlocale=en_US
    10.5/10.6/10.7/10.8 instructions...
    In System Preferences>Fax & Print, Right click or Control+click on the Printers list Sidebar, choose Reset Printing System.
    if you hold option and click the "-" tab it resets the printing system.
    http://www.macosxhints.com/article.php?story=20031215144430486
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions.
    Any devices that previously appeared in your Printer List and Fax List will need to be added again after resetting the printing system.
    Resetting the printing system in Mac OS X 10.5.x+++
        1.    To use the Reset Printing System feature in Mac OS X 10.5.x, follow these steps:
        2.    Choose System Preferences from the Apple menu.
        3.    Choose Print & Fax from the View menu.
        4.    Control-click on list of printers on the left side of the window, then choose "Reset printing system" from the contextual menu. If you don't see a list of printers, Control-click on the text "Click + to add a printer or fax" and select "Reset printing system..." 
   
  As an alternative, if you currently have one or more printers listed, you can Option-click the "-" (Remove printer) button.
    http://support.apple.com/kb/ht1341
    Reboot.
    Mac OS X: О сброса системы Печать ...
    http://support.apple.com/kb/HT1341?viewlocale=en_US
    10.5/10.6/10.7/10.8 инструкции ...
    В System Preferences> Печать и факс, правой кнопкой мыши или Control + Click на боковой панели списка принтеров, выберите Сброс системы печати.
    если вы держите опцию и нажмите кнопку "-" на вкладке он сбрасывает систему печати.
    http://www.macosxhints.com/article.php?story=20031215144430486
    Безопасная загрузка с HD, (Удержание нажатой клавиши Shift нажатой при загрузке), запустите Disk Utility в Приложения> Утилиты, затем выделите диск, нажмите на ремонт разрешения.
    Любые устройства, которые ранее появились в списке принтеров и факсов список необходимо будет добавить снова после перезагрузки системы печати.
    Сброс системы печати в Mac OS X 10.5.x + + +
    1. Для сброса системы печати в Mac OS X 10.5.x, выполните следующие действия:
    2. Выберите Системные настройки в меню Apple.
    3. Выбери для печати и факса в меню Вид.
    4. Управление кнопкой мыши на список принтеров в левой части окна, затем выберите "Сброс системы печати" из контекстного меню. Если вы не видите списка принтеров, управление кнопкой мыши на текст "Нажмите, чтобы добавить + принтер или факс" и выберите "Сброс системы печати ..." В качестве альтернативы, если у Вас уже есть один или несколько принтеров в списке, можно Option-нажмите кнопку "-" (Удалить принтер) кнопки.
    http://support.apple.com/kb/ht1341
    Перезагрузку.

Maybe you are looking for