Skip To Content

Portal.Get (.NET)

The Portal.Get method returns a dictionary of portal properties for the specified portal.

Declaration

public Dictionary<string, object> Esri.ArcGISForAutoCAD.Portal.Get(string portalName)

Parameters

TypeNameDescriptionRequired

string

portalName

An ArcGIS Online or ArcGIS Enterprise organization name. Use Portal.Names to find a list of valid names.

Required

Note:

The portal name is first accessed by the default portal name "ArcGIS Online" or "ArcGIS Enterprise". Once you're signed in, the portal name may be the organizational name set by your administrator. You can review the names using Portal.Names after signing in.

Returns

TypeDescription

Dictionary<string, object>

A dictionary of portal properties. Properties vary based on whether the portal is signed in. Keys and values of the dictionary are described in the table below.

The dictionary may contain the following values:

KeyTypeValue Description

"IsActivePortal"

bool

Specifies whether the portal is the active portal.

"IsSignedIn"

bool

Specifies whether the portal is signed in.

"OrganizationName"

string

The name of the organization.

"Name"

string

The name of the portal.

"PortalUrl"

Uri

The URL of the portal.

"CurrentUser"

Dictionary<string, object>

A dictionary of current user properties that include the following:

  • Key: "UserName", Type: string, Value Description: The name of the current user.
  • Key: "CanShareHostedFeatureLayer", Type: bool, Value Description: Specifies whether the current user type has publishing permissions.
  • Key: "OrganizationId", Type: string, Value Description: The Organizational Id.

Remarks on error conditions

This method may throw an exception or return null if a parameter is invalid.

Example

Print the properties of the specified portal.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;

// Get the portal properties
var portalProperties = Esri.ArcGISForAutoCAD.Portal.Get("CAD Team Enterprise 11.3"); 

// Print the properties
foreach (var property in portalProperties)
{
  if (property.Key == "CurrentUser")
  {
    foreach (var kvp in property.Value as Dictionary<string, object>)
    {
      doc.Editor.WriteMessage("\n{0}: {1}", kvp.Key, kvp.Value);
    }
    continue;
  }
  doc.Editor.WriteMessage("\n{0}: {1}", property.Key, property.Value);
}

/* Example output 
IsActivePortal: True
IsSignedIn: True
OrganizationName: CAD Team Enterprise 11.3
Name: CAD Team Enterprise 11.3
PortalUrl: https://cadteam.esri.com/portal
UserName: portaladmin
CanShareHostedFeatureLayer: True
OrganizationId: 0123456789ABCDEF
*/

See also

Portal.Names—A .NET method that returns a collection of portal names from the Manage Portals dialog box as strings.

esri_portal_get—An AutoLISP function that gets an associated list of portal properties for the specified portal.