Posted By Brian Dukes on 01 Aug 2019 02:57 PM
The scheduler does not run in the context of any particular portal, so there isn't a portal ID to retrieve. You can call an API like
PortalController.GetPortalList to get all of the portals and iterate over them.
This is how we do this, most often.
In the cases where there are a lot of portals or when we just need to avoid that kind of logic, we'll usually build in a way to provide configuration details, such as a static XML or JSON file. If you go the route of having a static config file, I'd suggest naming it with a .resources extension to make sure it never gets served to anonymous requests.