Hi PandzicM,
Why would you like to put hosts in maintenance mode at some dates?
I mean, if you want to patch the ESXi host, VUM does it automatically.
About a script to run in multiplie vCenters, those should be connected to Enhanced Linked Mode, otherwise you will need to execute Connect-ViServer again in your script.
What are you trying to achieve?