This uses the Portal Py API as an ArcGIS Desktop Add-In.