@Mikkel Lund Knudsen , Based on my research, Intune has a feature "Windows 10 Device diagnostics" which utilizes the Windows DiagnosticLog CSP, allowing Intune to collect a set of files, like registry, event viewers and commands. For the event viewer log, it contains Application, System, Setup and Applocker related event log. We can see more details in the following link:
https://learn.microsoft.com/en-us/mem/intune/remote-actions/collect-diagnostics
On windows 11 device, we can also use this feature. on the device, select "Collect diagnostics" to collect the log. After the status shows complete. Go to "Device diagnostics" and click download button to download the logs.
https://techcommunity.microsoft.com/t5/intune-customer-success/intune-public-preview-windows-10-device-diagnostics/ba-p/2179712
In addition, for the firewall port, I didn't find the official article mentioned any additional ports required. We can firstly try the above feature. if it is failed to collect due to port issue, we can capture netmon log to see which port is used.
Hope it can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.