Do to that the Computer parameter in Invoke-GPUpdate only takes from the pipeline by Value we have to use the For Each-Object cmdlet to go one by one of the onjects on the pipeline and run the cmdlet serially.
This interval can be modified on the Group Policy Object configured on a domain controller.
To configure the Windows Firewall we start first by creating all the Starter GPOs from the Group Policy Management console expanding the domain, selecting Starters GPOs and clicking on Create Starter GPOs Folder.
Once create we can use Power Shell to create a new GPO based on the Group Policy Remote Update Firewall Ports starter GPO and link the GPO to the OU or domain we want to apply this rule to.
Once the firewall rules have been enabled we can now use the cmdlet Invoke-GPUpdate from the Group Policy module installed on all Domain Controllers or hosts running the latest version of the Remote Server Administration Tools (RSAT).
to schedule a task that will run at the time of our choosing and with the parameters we want.