ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / ArcGISPortalManager Class / GetPortals Method
Example

In This Topic
    GetPortals Method
    In This Topic
    Get the enumeration of portals. This list correlates with the list of portals on the "Portals" tab on the Pro backstage.
    Syntax
    Public Function GetPortals() As IEnumerable(Of ArcGISPortal)
    public IEnumerable<ArcGISPortal> GetPortals()

    Return Value

    An IEnumerable of ArcGISPortal
    Example
    ArcGISPortalManager: Get a list of all your Portals
    {
      var portals = ArcGISPortalManager.Current.GetPortals();
      //Make a list of all the Uris
      var portalUris = portals.Select(p => p.PortalUri.ToString()).ToList();
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also