var active_portal = ArcGISPortalManager.Current.GetActivePortal(); string uri = active_portal.PortalUri.ToString();
var portals = ArcGISPortalManager.Current.GetPortals(); //Make a list of all the Uris var portalUris = portals.Select(p => p.PortalUri.ToString()).ToList();
Target Platforms: Windows 11, Windows 10