This project can be help everyone who needs to block access in APIS Industrial System and Active Directory.
To use this project you need to do one script that read the file in \%netlogon%\Inativacao_AD\funcionarios.txt and use a powershell script (DisabledUsers) to inactivate the users on Active Directory.
https://github.com/mateusbessa/block_all_access_from_ERP_protheus/blob/main/Flow.PNG
Also, this solution insert users at a database with the users tha will be blocked in the APIS Industrial system.