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