<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change a users licence type to Field worker in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103388#M6693</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this is not working for me. The very simple piece of code I am using is:&lt;/P&gt;&lt;PRE&gt;# _user = p_gis.users.get(username='U19452')&lt;BR /&gt;_listUsers = gis.users.search(query='username:{}'.format('U19452'))&lt;BR /&gt;for _user in _listUsers:&lt;BR /&gt;    print(_user.username, _user.userLicenseTypeId)&lt;BR /&gt;    _user.update_license_type("fieldWorkerUT")&lt;BR /&gt;    print(_user.username, _user.userLicenseTypeId)&lt;/PRE&gt;&lt;P&gt;and this is the result:&lt;/P&gt;&lt;PRE&gt;U19452 creatorUT
U19452 creatorUT&lt;/PRE&gt;&lt;P&gt;What am I missing?, because it seems quite straightforward.&lt;/P&gt;&lt;P&gt;Thanks in advance for your time.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 08:11:09 GMT</pubDate>
    <dc:creator>EloyBonillaPerez</dc:creator>
    <dc:date>2021-09-30T08:11:09Z</dc:date>
    <item>
      <title>Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062392#M6135</link>
      <description>&lt;P&gt;i am trying to change a set of users licence in AGOL from Creator to Field Worker&lt;/P&gt;&lt;P&gt;this is what i have but it dosent seem to work (no error or anything)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS("home")
source_users = gis.users.search(query="username:xxx")
for user in source_users:
    print(user.username)
    print(user.userLicenseTypeId)     
    user.userLicenseTypeId = 'fieldWorkerUT'
    print(user.userLicenseTypeId)  &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 May 2021 16:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062392#M6135</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-05-27T16:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062413#M6136</link>
      <description>&lt;P&gt;Hi Stuart,&lt;BR /&gt;&lt;BR /&gt;Can you try the following? It is documented &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User.update_license_type" target="_self"&gt;here&lt;/A&gt; in the API guide.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

gis = GIS("home")

source_users = gis.users.search(query="username:xxx")

for user in source_users:
    
    print(user.username, user.userLicenseTypeId)
    
    user.update_license_type("fieldWorkerUT")
    
    print(user.username, user.userLicenseTypeId)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that for the update to be successful, the user must have a compatable role.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Hamish&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 16:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062413#M6136</guid>
      <dc:creator>HamishMorton</dc:creator>
      <dc:date>2021-05-27T16:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062416#M6137</link>
      <description>&lt;P&gt;Hey Stuart - you need to use the&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User.update_license_type" target="_self"&gt;update_license_type&lt;/A&gt; method - example here: &lt;A href="https://community.esri.com/t5/education-blog/creator-to-gis-professional-advanced-user-type-for-education/bc-p/885272/highlight/true#M480" target="_blank"&gt;https://community.esri.com/t5/education-blog/creator-to-gis-professional-advanced-user-type-for-education/bc-p/885272/highlight/true#M480&lt;/A&gt;&lt;/P&gt;&lt;P&gt;License type ID's can be found here: &lt;A href="https://developers.arcgis.com/rest/enterprise-administration/portal/create-user.htm" target="_blank"&gt;https://developers.arcgis.com/rest/enterprise-administration/portal/create-user.htm&lt;/A&gt;. Current options include the following: creatorUT | editorUT | GISProfessionalAdvUT | GISProfessionalBasicUT | GISProfessionalStdUT | viewerUT | fieldWorkerUT.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 16:48:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062416#M6137</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-05-27T16:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062482#M6138</link>
      <description>&lt;P&gt;thanks both that worked a treat&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 18:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1062482#M6138</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-05-27T18:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103388#M6693</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this is not working for me. The very simple piece of code I am using is:&lt;/P&gt;&lt;PRE&gt;# _user = p_gis.users.get(username='U19452')&lt;BR /&gt;_listUsers = gis.users.search(query='username:{}'.format('U19452'))&lt;BR /&gt;for _user in _listUsers:&lt;BR /&gt;    print(_user.username, _user.userLicenseTypeId)&lt;BR /&gt;    _user.update_license_type("fieldWorkerUT")&lt;BR /&gt;    print(_user.username, _user.userLicenseTypeId)&lt;/PRE&gt;&lt;P&gt;and this is the result:&lt;/P&gt;&lt;PRE&gt;U19452 creatorUT
U19452 creatorUT&lt;/PRE&gt;&lt;P&gt;What am I missing?, because it seems quite straightforward.&lt;/P&gt;&lt;P&gt;Thanks in advance for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 08:11:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103388#M6693</guid>
      <dc:creator>EloyBonillaPerez</dc:creator>
      <dc:date>2021-09-30T08:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103416#M6695</link>
      <description>&lt;P&gt;Hi, i think i had a similar issue if the user was the owner of content it wouldn't change the licence, maybe try changing their account manually to see if you get an error&lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 10:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103416#M6695</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-09-30T10:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change a users licence type to Field worker</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103446#M6696</link>
      <description>&lt;P&gt;Hi Stuart,&lt;/P&gt;&lt;P&gt;you are right. I a user owns any content then you cannot change his type. I think a least you should receive any kind of message informing about this, but the sentence finishes ok.&lt;/P&gt;&lt;P&gt;Thank you very much!!!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:30:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/change-a-users-licence-type-to-field-worker/m-p/1103446#M6696</guid>
      <dc:creator>EloyBonillaPerez</dc:creator>
      <dc:date>2021-09-30T12:30:29Z</dc:date>
    </item>
  </channel>
</rss>

