I would like to use arcpy to share a map package (.mpk) in both ArcGIS Online and our local Portal.
I have been testing the SignInToPortal_server (username, password, portal_url) function but the 'portal_url' parameter seems meaningless (see bold text in the below documentation).
The Sign In To Portal tool reads the URL set in Desktop Administrator. Any user entered value is ignored. The default value is URL for the ArcGIS portal currently chosen by the user in Desktop Administrator.
Basically I would like to do the below but I can not get around the settings pre-stored in Desktop Administrator....
# TO DO ->: Upload Map Package to ArcGIS.com
# TO DO->: Upload Map Package to Local Portal
Any ideas on how to change my portal URL programmatically?