ArcGIS Pro 2.6 API Reference Guide
ServerConnectionProjectItem Class
Members  Example 

ArcGIS.Desktop.Catalog Namespace : ServerConnectionProjectItem Class
Represents a server connection project item
Object Model
ServerConnectionProjectItem ClassItem ClassProjectItemInfo ClassCIMProjectServerConnection ClassTimeInstant Class
Syntax
public sealed class ServerConnectionProjectItem : ArcGIS.Desktop.Internal.Catalog.ProjectItemInfoCrawl, ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.IProjectMultiItem, System.ComponentModel.INotifyPropertyChanged  
Public NotInheritable Class ServerConnectionProjectItem 
   Inherits ArcGIS.Desktop.Internal.Catalog.ProjectItemInfoCrawl
   Implements ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.IProjectMultiItem, System.ComponentModel.INotifyPropertyChanged 
Remarks

A server connection project item is a connection to an ArcGIS Server site, an OGC WMS service, or an OGC WMTS service that has been added to the current project. New server connections cannot be created, but an existing .ags, .wms, or .wmts file containing connection information can be added to a project.

Example
/// Get all the server connections in a project
IEnumerable<ServerConnectionProjectItem> projectServers = Project.Current.GetItems<ServerConnectionProjectItem>();
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
      ArcGIS.Desktop.Core.Item
                  ArcGIS.Desktop.Catalog.ServerConnectionProjectItem

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

ServerConnectionProjectItem Members
ArcGIS.Desktop.Catalog Namespace