V
V
vadimeasy2021-11-16 09:14:58
Python
vadimeasy, 2021-11-16 09:14:58

How can one manage services and firewall in Windows 7 with Python?

Hello everyone, please tell me, I have a powershell script, it works correctly on Windows 10, but for some reason it gives errors on Windopws 7, here is the script

New-NetFirewallRule -DisplayName 'UTM_transport' -Profile @('Domain', 'Private', 'Public' ) -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('8228')
Set-Service OpenVPNService -startuptype automatic -passthru
Set-Service Transport -startuptype automatic -passthru
Restart-Service -Name OpenVPNService
Restart-Service -Name Transport

Maybe something needs to be changed for Windows 7?

Ideally, it would be possible to carry out all these operations from the python code, and not from a third-party script.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaxKozlov, 2021-11-16
@vadimeasy

https://codereview.stackexchange.com/questions/211...
and New-NetFirewallRule on win7 was not yet
set up services via sc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question