When creating the firewall rule, query the registry for the executable for sqlbrowsr.exe and sqlservr.exe, use those as the Program value for both Default Instance and named instances
Is there a command that is similiar or close to what you are looking for?
Yes
Technical Details
Right now, it creates port based rules, but to make things easier, targeting the exe would allow named instances running on different ports or the default instance running on a non-standard port to automatically be allowed.
Summarize Functionality
When creating the firewall rule, query the registry for the executable for sqlbrowsr.exe and sqlservr.exe, use those as the Program value for both Default Instance and named instances![image](https://github.com/dataplat/dbatools/assets/5482447/17999c33-96d2-43d7-8fc5-b6c24c9dd756)
Is there a command that is similiar or close to what you are looking for?
Yes
Technical Details
Right now, it creates port based rules, but to make things easier, targeting the exe would allow named instances running on different ports or the default instance running on a non-standard port to automatically be allowed.