{"id":1086,"date":"2026-03-10T10:58:16","date_gmt":"2026-03-10T10:58:16","guid":{"rendered":"https:\/\/techno.slomka.biz\/?p=1086"},"modified":"2026-03-13T14:29:08","modified_gmt":"2026-03-13T14:29:08","slug":"%f0%9f%92%a1-powershell-tip-find-a-windows-firewall-rule-by-port","status":"publish","type":"post","link":"https:\/\/techno.slomka.biz\/?p=1086","title":{"rendered":"\ud83d\udca1 PowerShell Tip \u2013 Find a Windows Firewall rule by port"},"content":{"rendered":"\n<p>If you know the <strong>port<\/strong> but not the <strong>rule name<\/strong>, you can resolve the rule via the port filter:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#282a36\"><span style=\"background:#ebebe6;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#282a36\">PowerShell<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Get-NetFirewallPortFilter | Where-Object { $_.LocalPort -eq 11434 } | Get-NetFirewallRule\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #97E1F1\">Get-NetFirewallPortFilter<\/span><span style=\"color: #F6F6F4\"> | <\/span><span style=\"color: #97E1F1\">Where-Object<\/span><span style=\"color: #F6F6F4\"> { <\/span><span style=\"color: #BF9EEE\">$_<\/span><span style=\"color: #F6F6F4\">.LocalPort <\/span><span style=\"color: #F286C4\">-eq<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">11434<\/span><span style=\"color: #F6F6F4\"> } | <\/span><span style=\"color: #97E1F1\">Get-NetFirewallRule<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Useful for troubleshooting when an application opens a port but the corresponding firewall rule name is unknown.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you know the port but not the rule name, you can resolve the rule via the port filter: Useful for troubleshooting when an application opens a port but the corresponding firewall rule name is unknown.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,26],"tags":[78],"class_list":["post-1086","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows","tag-powershell"],"_links":{"self":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts\/1086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1086"}],"version-history":[{"count":1,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts\/1086\/revisions"}],"predecessor-version":[{"id":1087,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=\/wp\/v2\/posts\/1086\/revisions\/1087"}],"wp:attachment":[{"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techno.slomka.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}