Hi,
Based on the information provided, here are the answers to your questions:
- If you are patching servers in different time zones and each server is patched based on its local time, then you will need to make changes to the script to reflect the local time of each server. You can modify the script to incorporate timezone information or adjust the timing of the SCCM maintenance windows accordingly.
- After importing the management pack, it will not automatically put the server into maintenance mode. You will need to use the provided PowerShell script to initiate maintenance mode for the desired agent-managed computer(s). The script triggers an event on the agent, which is then read by the maintenance mode trigger rule to set the agent in maintenance mode.
Regarding the issue with the server not being placed in maintenance mode, it could be due to various reasons, such as incorrect permission settings or misconfiguration. You can check the following:
- Make sure the System Center Operations Manager SDK account has the required SQL Server access and membership in one of the SQL Server roles to take advantage of the maintenance mode feature.
- Verify that the accounts listed under Operational Database Account profile have SQLAgentOperatorRole permission on the MSDB database. If not, assign the permission to each account under this profile.
- Check that the specified agent-managed computer is running the System Center Operations Manager agent and is communicating with the management server.
- Review the maintenance mode trigger rule configuration to ensure it is set up correctly.
- Query the MaintenanceModeHistory table in the Operations Manager database to get information on when a monitored entity went into maintenance mode, which can help with troubleshooting.