Hi,
we have host and website objects in DMZs, which are only accessible after performing a web browser based authentication against a firewall. We have this firewall covered in a "Website" object, together with KeePass integration etc.
It now would be great to intelligently warn the user prior a connection to a server (RDP or SSH) that he needs to "open the door" first.
I've already checked that something like
if ((Test-NetConnection "mymachine.domain.com" -Port 443).tcptestsucceeded -eq "True") {
$RDM.Cancel = $false
}
else {
# MSGBOX HERE!?!
$RDM.Cancel = $true
}
is working, but I'd like to have a feedback to the user instead of just not opening the connection like "you need to to this and that first". "Message prompt" before open is also not feasible as this appears every time, even though I'm already authenticated at the firewall.
Any ideas are welcome, also non Powershell based ones.
Thanks in advance...
Hello,
It could be possible to create a dialog message and display it on the screen as a warning message.
With the following external PowerShell function in the PromptMessage.ps1 file I have attached to this post, we need to import it using the Import-Module cmdlet. You will have to adapt the path to the .ps1 file.
Then we can call the function in the Before Open event like the following.
Import-Module 'c:\Temp\PromptMessage.ps1'
if ((Test-NetConnection "mymachine.domain.com" -Port 443).tcptestsucceeded -eq "True") {
$RDM.Cancel = $false
}
else {
PromptMessage
$RDM.Cancel = $true
}
Let us know if that helps.
Best regards,
Érica Poirier
PromptMessage.ps1