AnsweredAssumed Answered

Is there to test if a mxd has a login to ArcGIS Online in python?

Question asked by dougbrowning on Dec 31, 2015
Latest reply on Nov 4, 2016 by canderson_salem

Anyone know a way to test to see if a MXD is logged in?  I have a mxd that has a Hosted Feature Service in it.  I then have a python script running on a schedule.  The only way I can have python be logged in is to leave ArcMap open all the time and logged in on the same machine.  Then python sees it.  Problem is ArcMap logs itself out appox every 12 hours.  I have posted and no one seems to know how to change this.  So instead is there a way I can test for a login then exit the script if it is not?

 

If the script runs interactively it will popup a login to AGO box.  But if the script is scheduled it just sits and waits which locks up my log file until I kill python in task manager.

 

Just trying anything now since there is strangely no way to login in a mxd in a script.

 

I am using Data Driven pages off the HFS so it dies here

            mxd = arcpy.mapping.MapDocument(os.path.join(mapsDir, mapToUse))

            ddp = mxd.dataDrivenPages

 

Oh and no REST does not work.  The MXD can not see REST tokens.

 

thanks

Outcomes