Hey there,
I am trying to get a python script working that stops all the services following this
https://support.esri.com/en/technical-article/000019994
I get the general idea but I am getting the error 'GIS' object has no attribute 'admin' when trying to access the servers list. We use Enterprise Logins via SAML with One identity provider.
I am running this
from arcgis.gis import GIS
import arcgis.gis.admin
gis = GIS("https://url.domain.ca/portal")
print("Logged in as: " + gis.properties.user.username)
print("Servers: " + gis.admin.servers.list())
Which gives me:
Logged in as: TSlack@CITY
Traceback (most recent call last):
File "<string>", line 6, in <module>
AttributeError: 'GIS' object has no attribute 'admin'
If I run
print("Logged in as: " + gis.properties.user.role)
it tells me im an org_admin which is correct, my user account as administrator privileges.
Any idea where I am going wrong here? Im using the latest ArcGIS Pro version with all updates. My python version output is below:
import sys
import matplotlib
import numpy
import scipy
print(sys.version)
print(matplotlib.__version__)
print(numpy.__version__)
print(scipy.__version__)
3.9.11 [MSC v.1931 64 bit (AMD64)]
3.4.3
1.20.1
1.6.2
arcgis API is version 2.0.1
Solved! Go to Solution.
Were you able to resolve this with Esri Support? If so, what was the outcome?
The issue had to do with the fact our Enterprise is running 10.6
ESRI Support said "Our 10.6.1 Enterprise deployment built with SAML isn't maintained very well anymore as the product is in mature support. I've tried to bring it back to life but the IDP it leverages no longer exists, and I've been unable to create a new one to test this."
My main goal was getting a script to run that stopped services on Server and I was given a link to https://enterprise.arcgis.com/en/server/10.7/develop/windows/example-stop-or-start-all-services-in-a...
which I was able to modify for my purposes.