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
| Type | Name | Description | Required |
|---|---|---|---|
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
| Type | Description |
|---|---|
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:
| Key | Type | Value 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:
|
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.