Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str Str ImportFrom alias alias Import alias Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore Str FunctionDef arguments args defaults body If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Num body Print BinOpAdd BinOpAdd Str NameLoad Str Print Str Print Str Print Str Print Str Print Str Print Str Print Call AttributeLoad Str attr NameLoad Return NameLoad orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body If CompareEq NameLoad SubscriptLoad NameLoad Index Str body Assign NameStore SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore NameLoad If NameLoad body For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareEq NameLoad SubscriptLoad NameLoad Index Str body Assign NameStore NameLoad Break Return NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore NameLoad Assign NameStore Call NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore NameStore NameStore NameLoad TryFinally body TryExcept body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If CompareGt Call NameLoad NameLoad Num body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index Str comprehension NameStore Call AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad NameLoad Print Call AttributeLoad Str attr BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr BinOpAdd SubscriptLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str Index Num Str Expr Call AttributeLoad NameLoad attr NameLoad Print Call AttributeLoad Str attr NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Print Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore ListComp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad comprehension NameStore NameLoad Print Call AttributeLoad Str attr BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Print Str Print NameLoad For NameStore NameLoad body Print Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If NameLoad body If UnaryOpNot Call NameLoad NameLoad NameLoad NameLoad body Print Call AttributeLoad Str attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Print Call AttributeLoad Str attr NameLoad NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Print Call AttributeLoad Str attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad NameLoad orelse For NameStore NameLoad body If CompareNotEq SubscriptLoad NameLoad Index Str NameLoad body Print Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad NameLoad Index Str Print Call AttributeLoad Str attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad NameLoad orelse Print Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str Print Str handlers ExceptHandler body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num Print Print Str Print BinOpAdd NameLoad Str finalbody Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A sys N/A os N/A time N/A traceback N/A json N/A tempfile N/A shutil N/A N/A N/A N/A sys path append N/A N/A N/A os path join N/A N/A N/A os path join N/A N/A N/A os path dirname N/A N/A N/A os path dirname N/A N/A sys argv N/A 0 Publish Portal portalpy Portal provision N/A PortalContentExtract N/A scriptName N/A N/A sys argv N/A 0 N/A exclude_users N/A admin system_publisher DemoEManagement DemoIntelligence DemoLGovt DemoMilitary DemoNationalSecurity DemoParksGardens DemoSGovt DemoUtilities ReleasedEManagement ReleasedIntelligence ReleasedLGovt ReleasedMilitary ReleasedOpsServer ReleasedParksGardens ReleasedSGovt ReleasedUtilities TemplateIntelligence TemplateMilitary N/A start_dir N/A N/A os getcwd N/A sec_len 75 N/A sec_char - check_args N/A N/A N/A N/A N/A N/A N/A len N/A sys argv 5 N/A N/A N/A N/A scriptName  <PortalURL> <AdminUser> <AdminUserPassword> <GUID{,GUID...}> N/A 
Where: N/A 
	<PortalURL> (required): URL of Portal (i.e. https://fully_qualified_domain_name/arcgis) N/A 
	<AdminUser> (required): Primary portal administrator user. N/A 
	<AdminUserPassword> (required): Password for AdminUser. N/A 
	<GUID{,GUID...}> (required): GUIDs of portal items to add to other user accounts. N/A 

NOTE: The specified items will not be added to the following accounts: N/A N/A N/A 	{}
 format exclude_users N/A None N/A N/A portal_address N/A N/A sys argv N/A 1 N/A adminuser N/A N/A sys argv N/A 2 N/A password N/A N/A sys argv N/A 3 N/A guids N/A N/A sys argv N/A 4 N/A src_ids N/A N/A N/A guid strip N/A guid N/A N/A guids split , N/A N/A portal_address adminuser password src_ids N/A validate_guids N/A N/A portal guids N/A N/A N/A invalid_guids N/A N/A guid guids N/A N/A search_results N/A N/A portal search q N/A N/A id:{} format guid N/A N/A N/A len search_results 0 N/A N/A N/A N/A invalid_guids append guid N/A invalid_guids N/A get_folder_name N/A N/A portal owner folder_id N/A N/A N/A folder_name None N/A folder_id N/A N/A folders N/A N/A portal folders owner N/A folder folders N/A N/A N/A folder_id N/A folder N/A id N/A N/A folder_name N/A folder N/A title N/A folder_name N/A has_folder N/A N/A portal owner folder_name N/A N/A N/A  Determines if folder already exists  N/A exists False N/A folder_name N/A N/A folder N/A N/A portal folders owner N/A N/A N/A folder_name N/A folder N/A title N/A N/A exists True N/A N/A exists N/A main N/A N/A N/A N/A N/A output_root None N/A results N/A check_args N/A N/A results N/A N/A N/A N/A sys exit 0 N/A N/A portal_address adminuser password src_ids results N/A N/A N/A N/A N/A portal N/A Portal portal_address adminuser password N/A invalid_guids N/A validate_guids portal src_ids N/A N/A N/A len invalid_guids 0 N/A N/A N/A Exception N/A N/A ERROR: The following portal items do not exist: {} format invalid_guids N/A users N/A N/A org_user N/A username N/A org_user N/A N/A portal org_users N/A target_users N/A user N/A user users N/A user exclude_users N/A N/A N/A 

{}
Extracting select portal items...
{}
 format N/A sec_char sec_len N/A sec_char sec_len N/A output_root N/A N/A N/A os path join N/A N/A tempfile gettempdir N/A N/A N/A N/A N/A N/A N/A os path basename N/A N/A sys argv N/A 0 split . N/A 0 _Extract N/A N/A N/A os makedirs output_root N/A N/A N/A Extract folder: {} format output_root N/A src_id src_ids N/A N/A src_item N/A N/A portal item src_id N/A N/A N/A os chdir output_root N/A N/A N/A - Extracting item {} "{}" ({}) user account {}... format N/A src_item N/A id N/A src_item N/A title N/A src_item N/A type N/A src_item N/A owner N/A N/A N/A PortalContentExtract extract_item portal N/A src_item N/A id N/A src_item N/A owner N/A src_item_paths N/A N/A N/A N/A os path join output_root src_id N/A src_id src_ids N/A N/A N/A 

{}
Publish extracted items to each portaluser account...
{} format N/A sec_char sec_len N/A sec_char sec_len N/A NOTE: not publishing to the following users: N/A exclude_users N/A target_user target_users N/A N/A N/A N/A 

User Account: {} format target_user N/A target_user_folders N/A N/A portal folders target_user N/A src_item_path src_item_paths N/A N/A N/A N/A os chdir src_item_path N/A src_item_json N/A N/A json load N/A open item.json N/A item_title N/A src_item_json N/A title N/A item_type N/A src_item_json N/A type N/A item_id N/A src_item_json N/A id N/A item_owner N/A src_item_json N/A owner N/A item_folder_id N/A src_item_json N/A ownerFolder N/A item_folder_name N/A get_folder_name portal item_owner item_folder_id N/A item_folder_name N/A N/A N/A N/A has_folder portal target_user item_folder_name N/A N/A N/A N/A Creating target folder "{}" in account {}... format item_folder_name target_user N/A N/A N/A portal create_folder target_user item_folder_name N/A user_items N/A N/A portal search q N/A N/A owner:{} AND type:{} AND title:{} format target_user item_type item_title N/A N/A N/A len user_items 0 N/A N/A N/A N/A 
- Add item "{}" ({}) to user account {}... format item_title item_type N/A N/A N/A portal logged_in_user N/A username N/A N/A item orig_id N/A N/A provision load_item portal src_item_path N/A N/A N/A - Reassign item to user account {}, folder "{}"... format target_user item_folder_name N/A N/A N/A portal reassign_item N/A N/A item get id target_user item_folder_name N/A N/A user_item user_items N/A N/A N/A N/A user_item N/A id item_id N/A N/A N/A N/A 
- Update existing item {} "{}" ({}) user account {}... format N/A user_item N/A id N/A user_item N/A title N/A user_item N/A type N/A user_item N/A owner N/A N/A item orig_id N/A N/A provision load_item portal src_item_path N/A user_item N/A id N/A N/A N/A - Reassign item to user account {}, folder "{}"... format target_user item_folder_name N/A N/A N/A portal reassign_item N/A N/A item get id target_user item_folder_name N/A N/A N/A N/A *** No need to update item {}; user is owner of extracted item. format N/A user_item N/A id N/A 

Done. N/A N/A N/A N/A tb N/A N/A N/A sys exc_info N/A 2 N/A tbinfo N/A N/A N/A traceback format_tb tb N/A 0 N/A pymsg N/A N/A N/A PYTHON ERRORS:
Traceback info:
 tbinfo 
Error Info:
 N/A str N/A N/A N/A sys exc_info N/A 1 N/A N/A ***** ERROR ENCOUNTERED ***** N/A N/A pymsg N/A N/A N/A N/A os chdir start_dir N/A output_root N/A N/A N/A N/A N/A os path exists output_root N/A N/A N/A N/A shutil rmtree output_root N/A N/A N/A __name__ __main__ N/A N/A N/A main