title: Remote Powershell Popup message to all users not working
body: <p>I'm having some issues creating a remote powershell popup message. </p>
  
  <p>I've got a working script that displays the popup message that I want to send to a remote user. However, whenever I bundle it up in a .ps1 script and run it remotely it does not send a popup message to the logged in user. I know the script is running correctly, as I have other parts of the script that execute correctly. I was able to run the popup message on a local machine, so it is not a script error.</p>
  
  <p>The script is: </p>
  
  <pre><code>    Add-Type -AssemblyName System.Windows.Forms
      $Form = New-Object system.Windows.Forms.Form
      $Form.Text = 'ALERT!'
      $form.ControlBox = $false; 
      $Image = [system.drawing.image]::FromFile('\\filepath') 
      $Form.BackgroundImage = $Image 
      $Form.BackgroundImageLayout = 'Stretch'
      $Form.Width = (680)
      $Form.Height = (550) 
      $OKButton = New-Object System.Windows.Forms.Button 
      $OKButton.Location = New-Object System.Drawing.Size(500,445) 
      $OKButton.Size = New-Object System.Drawing.Size(100,50) 
      $OKButton.Text = 'Accept'
      $OKButton.Font = New-Object System.Drawing.Font('Times New Roman',18) 
      $OKButton.Add_Click({$Form.Close()}) 
      $Form.Controls.Add($OKButton) 
      $Form.Add_Shown({$Form.Activate()}) 
      [void] $Form.ShowDialog()
  </code></pre>
  
  <p>I'm running this as part of a .ps1 that is called in the following fashion:</p>
  
  <pre><code>Invoke-WmiMethod -Class Win32_Process -ComputerName $computer -Name Create -ArgumentList "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe \\$computer\C$\folder\script.ps1
  </code></pre>
  
  <p>I'm running the script as a service account from a server that's executing the commands on a Windows 7 enterprise desktop machine. The target machine execution policy is set to unrestricted so I know it is not a script execution policy issue. </p>
  
  <p>I have a hunch that the reason that it is not popping up on the target machine is because the account that is running the script and the account that is logged into the target machine are different, however I could be incorrect. </p>