<?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: Delete admin role in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Delete-admin-role/m-p/1782288#M13830</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am not sure what would be the exact syntax for Qlik-Cli (which is just an abstraction layer on top of the Repository API by the way) but if you were to do it directly with the Repository API, then here is the syntax:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$body = '{
  "userDirectory":"DOMAIN",
  "userId":"user1a",
  "removedExternally":"false",
  "blacklisted":"false",
  "modifiedDate":"2021-02-12T14:00:36.157Z",
  "roles":[]
}'
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
   $hdrs.Add("X-Qlik-User","UserDirectory=INTERNAL;UserId=sa_repository")
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://qlikserver1.domain.local:4242/qrs/user/1cfb66b1-0fbc-4aa4-9cca-fb7450a6a83d?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Put -Headers $hdrs -ContentType 'application/json' -Certificate $cert -Body $body&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2021 12:51:31 GMT</pubDate>
    <dc:creator>Damien_V</dc:creator>
    <dc:date>2021-02-12T12:51:31Z</dc:date>
    <item>
      <title>Delete admin role</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Delete-admin-role/m-p/1777964#M13771</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to delete all admin roles of a user using the QLIK CLI command instead of doing on QMC. i tried below but isnt working. its retaining the old roles. I am able to update the roles though, but unable to remove all of them.&lt;/P&gt;&lt;P&gt;Connect-Qlik&lt;/P&gt;&lt;P&gt;$user=Get-QlikUser -filter "userid eq 'abc'" -full&lt;BR /&gt;$str=@()&lt;BR /&gt;Update-QlikUser -id $user.id -roles $str&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 07:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Delete-admin-role/m-p/1777964#M13771</guid>
      <dc:creator>pavanpatha</dc:creator>
      <dc:date>2021-01-28T07:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete admin role</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Delete-admin-role/m-p/1782288#M13830</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am not sure what would be the exact syntax for Qlik-Cli (which is just an abstraction layer on top of the Repository API by the way) but if you were to do it directly with the Repository API, then here is the syntax:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$body = '{
  "userDirectory":"DOMAIN",
  "userId":"user1a",
  "removedExternally":"false",
  "blacklisted":"false",
  "modifiedDate":"2021-02-12T14:00:36.157Z",
  "roles":[]
}'
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
   $hdrs.Add("X-Qlik-User","UserDirectory=INTERNAL;UserId=sa_repository")
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://qlikserver1.domain.local:4242/qrs/user/1cfb66b1-0fbc-4aa4-9cca-fb7450a6a83d?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Put -Headers $hdrs -ContentType 'application/json' -Certificate $cert -Body $body&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 12:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Delete-admin-role/m-p/1782288#M13830</guid>
      <dc:creator>Damien_V</dc:creator>
      <dc:date>2021-02-12T12:51:31Z</dc:date>
    </item>
  </channel>
</rss>

