Hello,
Is there a quick way to gather a list all map services in CSV file using ArcGIS pro client GP tools or programmatically arcpy module or ArcGIS REST API by authoring client - Arcmap vs Arcgis pro? The main objective is to identify services that are published using ArcMap client ONLY.
We have ArcGIS Enterprise 10.8.1 with ArcGIS Pro 2.7.
Solved! Go to Solution.
In the ArcGIS Python API, there is the gis.server submodule that you can use for this. Just call "gis.admin.servers" to access it.
From there, you can iterate through your services on a given server and look at the provider property.
gis = GIS('your-portal-url', 'admin-username', 'admin-password')
server = gis.admin.servers.get('HOSTING_SERVER')[0]
for f in server.services.folders:
for svc in server.services.list(folder=f):
if svc.properties['provider'] == 'ArcObjects':
print(f'{svc.properties['serviceName']} is published using ArcMap!')
Anything that comes back with a provider value of ArcObjects was published using ArcMap. Instead of printing that string at the end, you could have the script write the service name to a CSV, or populate a list object for further use.
In the ArcGIS Python API, there is the gis.server submodule that you can use for this. Just call "gis.admin.servers" to access it.
From there, you can iterate through your services on a given server and look at the provider property.
gis = GIS('your-portal-url', 'admin-username', 'admin-password')
server = gis.admin.servers.get('HOSTING_SERVER')[0]
for f in server.services.folders:
for svc in server.services.list(folder=f):
if svc.properties['provider'] == 'ArcObjects':
print(f'{svc.properties['serviceName']} is published using ArcMap!')
Anything that comes back with a provider value of ArcObjects was published using ArcMap. Instead of printing that string at the end, you could have the script write the service name to a CSV, or populate a list object for further use.