Can I specify an application that isn't currently installed for a firewall rule?











up vote
-1
down vote

favorite












Essentially, We deploy machines to clients. I want to know if I can pass through a firewall rule for a program that isn't currently installed. At the moment, my preparation script does not work unless someone has manually installed SQL express 2016/17.



I'm wondering if I can make work in PowerShell:



New-NetFireWallRule  -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"


WITHOUT having the program installed. Could somebody clarify this?



For reference, here is a sample of the script.



#Whitelist the Program depending on edition of Express
if (Test-Path -Path "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESS")
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"}
else
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL13.SQLEXPRESSMSSQLBinnsqlservr.exe"}









share|improve this question









New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1




    Why can't you try it and see?
    – harrymc
    Nov 13 at 13:42










  • A firewall blocks all ports unless opened. If you know what port your program will use, you can just open a generic port, and it will work. This is usually the way to go.
    – LPChip
    Nov 13 at 14:07












  • As my know, firewall can block download software, but for install software with a usb disk, it might can't take effect.
    – Joy
    Nov 14 at 10:37

















up vote
-1
down vote

favorite












Essentially, We deploy machines to clients. I want to know if I can pass through a firewall rule for a program that isn't currently installed. At the moment, my preparation script does not work unless someone has manually installed SQL express 2016/17.



I'm wondering if I can make work in PowerShell:



New-NetFireWallRule  -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"


WITHOUT having the program installed. Could somebody clarify this?



For reference, here is a sample of the script.



#Whitelist the Program depending on edition of Express
if (Test-Path -Path "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESS")
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"}
else
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL13.SQLEXPRESSMSSQLBinnsqlservr.exe"}









share|improve this question









New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1




    Why can't you try it and see?
    – harrymc
    Nov 13 at 13:42










  • A firewall blocks all ports unless opened. If you know what port your program will use, you can just open a generic port, and it will work. This is usually the way to go.
    – LPChip
    Nov 13 at 14:07












  • As my know, firewall can block download software, but for install software with a usb disk, it might can't take effect.
    – Joy
    Nov 14 at 10:37















up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Essentially, We deploy machines to clients. I want to know if I can pass through a firewall rule for a program that isn't currently installed. At the moment, my preparation script does not work unless someone has manually installed SQL express 2016/17.



I'm wondering if I can make work in PowerShell:



New-NetFireWallRule  -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"


WITHOUT having the program installed. Could somebody clarify this?



For reference, here is a sample of the script.



#Whitelist the Program depending on edition of Express
if (Test-Path -Path "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESS")
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"}
else
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL13.SQLEXPRESSMSSQLBinnsqlservr.exe"}









share|improve this question









New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Essentially, We deploy machines to clients. I want to know if I can pass through a firewall rule for a program that isn't currently installed. At the moment, my preparation script does not work unless someone has manually installed SQL express 2016/17.



I'm wondering if I can make work in PowerShell:



New-NetFireWallRule  -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"


WITHOUT having the program installed. Could somebody clarify this?



For reference, here is a sample of the script.



#Whitelist the Program depending on edition of Express
if (Test-Path -Path "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESS")
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQLBinnsqlservr.exe"}
else
{New-NetFireWallRule -DisplayName "SQLProgramEnable" -Description "Whitelists the Sqlservr.exe within the firewall" -Direction Inbound -Program "C:Program FilesMicrosoft SQL ServerMSSQL13.SQLEXPRESSMSSQLBinnsqlservr.exe"}






windows-10 powershell firewall sql-server






share|improve this question









New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 13 at 13:36









harrymc

247k10255542




247k10255542






New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 13 at 13:18









Jake

1




1




New contributor




Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Jake is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    Why can't you try it and see?
    – harrymc
    Nov 13 at 13:42










  • A firewall blocks all ports unless opened. If you know what port your program will use, you can just open a generic port, and it will work. This is usually the way to go.
    – LPChip
    Nov 13 at 14:07












  • As my know, firewall can block download software, but for install software with a usb disk, it might can't take effect.
    – Joy
    Nov 14 at 10:37
















  • 1




    Why can't you try it and see?
    – harrymc
    Nov 13 at 13:42










  • A firewall blocks all ports unless opened. If you know what port your program will use, you can just open a generic port, and it will work. This is usually the way to go.
    – LPChip
    Nov 13 at 14:07












  • As my know, firewall can block download software, but for install software with a usb disk, it might can't take effect.
    – Joy
    Nov 14 at 10:37










1




1




Why can't you try it and see?
– harrymc
Nov 13 at 13:42




Why can't you try it and see?
– harrymc
Nov 13 at 13:42












A firewall blocks all ports unless opened. If you know what port your program will use, you can just open a generic port, and it will work. This is usually the way to go.
– LPChip
Nov 13 at 14:07






A firewall blocks all ports unless opened. If you know what port your program will use, you can just open a generic port, and it will work. This is usually the way to go.
– LPChip
Nov 13 at 14:07














As my know, firewall can block download software, but for install software with a usb disk, it might can't take effect.
– Joy
Nov 14 at 10:37






As my know, firewall can block download software, but for install software with a usb disk, it might can't take effect.
– Joy
Nov 14 at 10:37

















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Jake is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375026%2fcan-i-specify-an-application-that-isnt-currently-installed-for-a-firewall-rule%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








Jake is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















Jake is a new contributor. Be nice, and check out our Code of Conduct.













Jake is a new contributor. Be nice, and check out our Code of Conduct.












Jake is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375026%2fcan-i-specify-an-application-that-isnt-currently-installed-for-a-firewall-rule%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix