|
POST
|
I had the same issue with a 2.0 test machine. I did the "Download Update" thing, thinking all I was going to get 2.1. Imagine my surprise when 2.1.1 came with it.
... View more
02-06-2018
01:14 PM
|
0
|
0
|
877
|
|
BLOG
|
Any chance this script will be updated to work in Pro Python 3.x?
... View more
02-06-2018
09:31 AM
|
0
|
0
|
17250
|
|
POST
|
If you can get IT to let you use a domain service account, write a batch file to delete them, and run it nightly as a scheduled task. If you can't get a service account, set the task to start when you login.
... View more
02-05-2018
08:54 AM
|
2
|
0
|
2537
|
|
POST
|
Don't forget to upvote https://community.esri.com/ideas/10859
... View more
02-04-2018
07:16 AM
|
1
|
0
|
5674
|
|
BLOG
|
Disappointing to not see https://community.esri.com/ideas/12258 on the road map. For many, that's a fish or cut bait barrier to adopting Pro.
... View more
02-02-2018
04:04 PM
|
3
|
0
|
14257
|
|
POST
|
A bit over complicated...requires Pro Py (3.5.3) import subprocess
import os, sys, string, calendar, datetime, traceback, smtplib
import csv
from os import listdir
from os.path import isfile, join
from arcgis.gis import GIS
import itertools
from collections import Counter
import arcpy
from arcpy import env
# Use this script when you need to add members of multiple AD groups to one or more PTL groups
# All scripts and files should read/write to the same directory
##########################
#Begin variables
ptl ="https://portal"
#Coded to work with headless account
# Additional parameters will need to be defined to use enterprise account or token
user = "user"
passw = "pw"
workdir = 'C:\PRODUCTION\PTL_GROUPS\FIRE'
# List of PTL Groups that will include members of the multiple AD groups lists in adgroups.txt
ptllist = ['Fire Editors']
# a text file titled "adgroups.txt" containing the name of multiple AD groups (one per line, no delimiters or
# seperators) is required to be in the workdir
# Output file containing UPN of AD members from the groups listed in adgroups.txt
admembers = 'FIRE_USERS.csv'
# Define log setting
try:
d = datetime.datetime.now()
log = open("C:\PYTHON_LOGS\hotLOG."+admembers+".txt","a")
log.write("----------------------------" + "\n")
log.write("----------------------------" + "\n")
log.write("Log: " + str(d) + "\n")
log.write("\n")
# Start process...
starttime = datetime.datetime.now()
log.write("Begin process:\n")
log.write(" Process started at " + str(starttime) + "\n")
log.write("\n")
### Start setting variables
# Mail Server Settings
SERVER = "server"
PORT = "25"
FROM = "from"
MAILDOMAIN = '@domain'
# Data Steward getting the email. Needs to be their email address...without @nps.gov at the end
userList=["sasquatch"]
# get a list of usernames from the list of named tuples returned from ListUsers
userNames = [u for u in userList]
# take the userNames list and make email addresses by appending the appropriate suffix.
emailList = [name + MAILDOMAIN for name in userNames]
TO = emailList
# Grab date for the email
DATE = d
#End variables
##########################
try:
os.remove(admembers)# Remove AD names list if it exists
except OSError:
pass
#PS command to get members of ad group(s)
command = '$groups = Get-Content '+workdir+'\\adgroups.txt ;foreach($Group in $Groups) {Get-ADGroupMember -Id $Group | \
Where { $_.objectClass -eq "user" }|%{Get-ADUser $_.SamAccountName | select UserPrincipalName} | Export-CSV '+workdir+'\\'+admembers+' \
-NoTypeInformation -append}'
process=subprocess.Popen(['powershell',command],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
out, err = process.communicate()
print(process.returncode, out, err)
#Remove any special charactes, including quotes, from AD names list
input_file = workdir+'\\'+admembers
chars = '$%^*"_\n' # etc notice the \n (linefeed)
with open(input_file) as f:
lines = [x.strip(chars) for x in f]
with open(input_file,"w") as f:
f.writelines("{}\n".format(x) for x in lines)
#Initialize GIS connection to PTL
gis = GIS(ptl, user, passw)
#Loop through all PTL groups and do the following:
for item in ptllist:
#Get PTL group name
group = gis.groups.search('title: "'+item+'"', '')
print(group)
#Add AD users to PTL group
readCSV = list(csv.reader(open(workdir+'\\'+admembers)))
for row in readCSV:
group[0].add_users(row)
else:
print ('done')
#Get list of all members in PTL group
members = group[0].get_members()
members_list = members['users']
#Get list of authorized members in PTL group
allowed_list = list(itertools.chain(*readCSV))
#Figure out who doesn't belong
c1 = Counter(allowed_list)
c2 = Counter(members_list)
diff = list((c2 - c1).elements())
#Remove unauthorized group members
for j in diff:
group[0].remove_users([str(j)])
# Write nothing to log if success.
endtime = datetime.datetime.now()
log.write(" Completed successfully in "
+ str(endtime - starttime) + "\n")
log.write("\n")
log.close()
######################################################################
#Delete below if not want email on success
#Define email message if success
SUBJECT = "Notification of Successful Update of "+str(ptllist)
MSG = "Finished updating:"+str(ptllist)+" at "+ str(DATE)
print (MSG)
print (emailList)
# Send an email notifying steward of successful archive
#MESSAGE = "\ From: %s To: %s Subject: %s %s" % (FROM, ", ".join(TO), SUBJECT, MSG)
MESSAGE = "Subject: %s\n\n%s" % (SUBJECT, MSG)
try:
try:
print("Connecting to Server...")
server = smtplib.SMTP(SERVER,PORT)
try:
print("Login...")
try:
print("Sending mail...")
server.sendmail(FROM, TO, MESSAGE)
except Exception as e:
print("Send Error Mail\n" + e.message)
except Exception as e:
print("Error Authentication Server: check the credentials \n" + e.message)
except Exception as e:
print("Error Connecting to Server : check the URL of the server and communications port ( 25 and ' the default ) \n" + e.message)
print("Quit.")
server.quit()
except Exception as e:
print (e.message)
#Delete above if not want email on success
######################################################################
# Something with wrong
except:
# Get the traceback object
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# Concatenate information together concerning
# the error into a message string
pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages(2) + "\n"
# Return python error messages for use in
# script tool or Python Window
arcpy.AddError(pymsg)
arcpy.AddError(msgs)
# Print Python error messages for use in
# Python / Python Window
log.write("" + pymsg + "\n")
log.write("" + msgs + "")
log.close()
# Define email message if something went wrong
SUBJECT = "Notification of Un-Successful Update of "+str(ptllist)
MSG = "This horrible thing happend:"+ str(DATE)+ "; " +pymsg + "; " + msgs
print (MSG)
print (emailList)
# Send an email notifying steward of successful archive
#MESSAGE = "\ From: %s To: %s Subject: %s %s" % (FROM, ", ".join(TO), SUBJECT, MSG)
MESSAGE = "Subject: %s\n\n%s" % (SUBJECT, MSG)
try:
try:
print("Connecting to Server...")
server = smtplib.SMTP(SERVER,PORT)
try:
print("Login...")
try:
print("Sending mail...")
server.sendmail(FROM, TO, MESSAGE)
except Exception as e:
print("Send Error Mail\n" + e.message)
except Exception as e:
print("Error Authentication Server: check the credentials \n" + e.message)
except Exception as e:
print("Error Connecting to Server : check the URL of the server and communications port ( 25 and ' the default ) \n" + e.message)
print("Quit.")
server.quit()
except Exception as e:
print (e.message)
... View more
02-02-2018
09:52 AM
|
1
|
2
|
6588
|
|
POST
|
I've had the same problem....and solve it with a python scheduled tasks that compares membership in AD to group membership and does the appropriate add/delete.
... View more
02-02-2018
08:45 AM
|
0
|
1
|
6588
|
|
IDEA
|
Server Manager only shows 10 services per page. If you make a change to a service on page 2, after save and restart, you are returned to page 1. This can be solved by changing number of services per page, but defaults back to 10 when ever you close the browser. The services per page setting should be permanent regardless of browser session.
... View more
02-02-2018
06:33 AM
|
3
|
0
|
595
|
|
POST
|
Many of us have the same question " Shouldn't the Catalog Pane have the functionalities as catalog?" ....Be sure to vote up on https://community.esri.com/ideas/12671-add-stand-alone-data-catalog-to-arcgis-pro-like-arccatalog
... View more
02-01-2018
11:51 AM
|
1
|
1
|
3797
|
|
POST
|
I "think" the functionality you desire is to select "Add to New Project" on the folder in Favorites (right click). Then, on each new project, the folder (and the functionality you desire) will be present. I agree, this is not intuitive.
... View more
02-01-2018
11:40 AM
|
1
|
6
|
3797
|
|
POST
|
I've had great luck with https://www.red-gate.com/simple-talk/sql/learn-sql-server/sql-server-indexed-views-the-basics/ in increasing view performance
... View more
02-01-2018
06:29 AM
|
0
|
1
|
1400
|
|
IDEA
|
This one will get thousands of votes....I recently had a project that got me wrapped around the axle....geodatabase replication wasn't working...days of trouble shooting...turns out I had populated a related table with external data that had Version 2 of the GUID format......ESRI products get wonky with anything other than Version 4. It would be handy if there was a GUID validator GP tool....yes, I know, I can code this with python. Like I said..."Handy".
... View more
01-30-2018
01:31 PM
|
2
|
0
|
769
|
|
POST
|
My workflow has always been to create the item metadata in the map (now project) before publishing...If I need to make a change to the AGOL item meta, I'll do it in the source document (project) and republish. Start Pro Add Feature Class Populate Metadata, both at the Map, and the layer in the TOC. Publish to AGOL The version doing the publishing is 2.0.1., as I haven't yet certified 2.1 to be installed on anything other than a test machine.... Which shouldn't make a difference....I hope we're not going down the road where an organization has to globally update its GIS software just so something as simple as viewing item metadata from AGOL remains consistent... However, to test your question, I made some changes to the AGOL meta in AGOL, and ONLY those changes showed up when I add the HFS to Pro. I changed tags, and item summary, those appear in meta view in Pro, however, ALL AGOL item meta is populated (e.g restrictions on use), and that doesn't show.
... View more
01-26-2018
12:15 PM
|
0
|
0
|
2339
|
|
POST
|
This issue is consistent with all feature services that are a single-feature-class service (not grouped), and is the same issue when viewing the metadata from the root (group) layer or the actual (sub) layer. However, "how it gets published" got me to thinking, and I've narrowed this down to: This behavior is only exhibited in HFS layers published by Pro. And to answer your next question, yes, all of the metadata items are fully published during the pro-publishing-workflow...which is how the metadata ended up on AGOL in the first place. Changing the metadata viewing preference in Options does not change the behavior. And, as a final follow up, this behavior wasn't an issue in 2.0.1...so what's different?
... View more
01-26-2018
11:18 AM
|
0
|
2
|
2339
|
|
POST
|
In Pro 2.0.1, when adding an AGOL HFS layer to a "New Map" via the Add Data icon, when right clicking on the layer in the TOC, selecting Properties, Metadata, all of the AGOL metadata is present (Title, Tags, Summary, Description, Credits, Use Limitations, Thumbnail). In 2.1, same add data workflow, same AGOL source, when right-clicking on the layer in the TOC, select Properties, Metadata, only the title and the tags are populated. All other elements are blank, as is when you select "Edit" or "view" metadata from the right-click action. This is pretty problematic, as I put a great deal of time into getting the AGOL metadata elements populated so the "Item Information" green line always reports "High". As I'm trying to use Pro to produce more downstream content (e.g Offline Map Package), having to re-create/re-edit all of the metadata doesn't seem very productive. In trying to nail this down, I investigated (and discarded) number/length of tags, SQL reserved keywords, views hanging from the service, sync/edit settings....as the cause, this applies to all HFS's. So it appears something was introduced in 2.1 that worked in 2.0.1...
... View more
01-26-2018
10:24 AM
|
0
|
5
|
2497
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2022 12:19 PM | |
| 1 | 03-14-2019 06:24 AM | |
| 1 | 07-12-2018 09:29 AM | |
| 1 | 06-27-2019 12:08 PM | |
| 2 | 09-23-2019 11:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-26-2026
07:12 AM
|