This topic contains 8 replies, has 3 voices, and was last updated by Brad 8 months, 3 weeks ago.
-
AuthorPosts
-
August 1, 2017 at 6:01 pm #76366
Hi All,
need help
i created simple popup form and its working ok on local computerfunction Create-SplashForm { # Form object [Reflection.Assembly]::LoadWithPartialName('System') | Out-Null [Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null [Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null [Reflection.Assembly]::LoadWithPartialName('mscorlib') | Out-Null [Reflection.Assembly]::LoadWithPartialName('System.Data') | Out-Null [Reflection.Assembly]::LoadWithPartialName('System.IO') | Out-Null [Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null [reflection.assembly]::LoadWithPartialName('System.DirectoryServices') | Out-Null $script:frmMessage = New-Object System.Windows.Forms.Form $lblTitle = New-Object System.Windows.Forms.Label $objImage = New-Object System.Windows.Forms.PictureBox $lblTextDown = New-Object System.Windows.Forms.Label $InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState $frmMessage.BackColor = [System.Drawing.Color]::FromArgb(255,255,255,255) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 550 $System_Drawing_Size.Width = 500 $frmMessage.ClientSize = $System_Drawing_Size $frmMessage.DataBindings.DefaultDataSourceUpdateMode = 0 $frmMessage.Name = 'frmMessage' $frmMessage.StartPosition = 1 $frmMessage.MinimizeBox = 0 $frmMessage.MaximizeBox = 0 $frmMessage.Text = "Test form !!!" # Save form #InitialFormWindowState = $frmMessage.WindowState #frmMessage.add_Load($OnLoadForm_StateCorrection) # Show form #$frmMessage.Show({ TopMost = true })| Out-Null $frmMessage.Add_Shown({$frmMessage.Activate()}) $frmMessage.ShowDialog() | Out-Null } and to run: Create-SplashForm Start-Sleep -seconds 20 $frmMessage.Close()
i need help , how i can show this popup on remote comp. list
Thanks
-
August 1, 2017 at 6:05 pm #76373
You would need to push that script out to the remote computers, and then have the script run under the context of whatever user is logged on. Windows' security boundaries don't allow your to shove UI elements into another user's space. If you could, the spammers would have windows popping up everywhere, all the time!
-
August 1, 2017 at 6:07 pm #76376
😉 Thanks Don
what if i safe file as .ps
can i run it on remote comp with Invoke-Command ?Thanks
-
August 1, 2017 at 6:11 pm #76382
You can run it, but a remote person can't force a user interface element to pop up in another user's run space, no. The user would have to run the script.
Windows is designed to not do what you're wanting to do.
-
August 1, 2017 at 6:14 pm #76384
Ok,
Thank you Don for explanation -
August 2, 2017 at 7:46 am #76405
you may be able to use the local copy of msg.exe which is present in windows 7 assuming winrm has been configured correctly
see http://quickbytesstuff.blogspot.co.uk/2014/05/how-to-show-remote-notifications-in.html for some examples and how to configure winrm
-
August 2, 2017 at 8:20 am #76406
If you are using Microsoft Lync 2010 in your environment you could send an instant message to a group of people
https://blogs.technet.microsoft.com/csps/2011/05/05/send-an-instant-message-from-a-script/
-
August 2, 2017 at 2:34 pm #76457
Thank you everyone,
i try , but this is what working for me
i try with Invoke-WmiMethod -Path Win32_Process and it's working
now my problem when message popup it's stay just for 15-20 sec and then disappear
and also i can't add image in messageThanks.
-
August 2, 2017 at 4:38 pm #76486
i try use psexec:
PsExec.exe -i \\$comp PowerShell.exe -ExecutionPolicy Unrestricted -noprofile -nologo -noninteractive "\\$script_path\Message.ps1"but still not working
-
AuthorPosts
You must be logged in to reply to this topic.