<?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: Power shell scripting to delete multiple bookmarks owned by users in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514351#M22069</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/29458"&gt;@Marc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We got some python script which can be used to delete the bookmarks from app binary by listening the bookmarks object ifs in the CSV file .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;</description>
    <pubDate>Tue, 15 Apr 2025 04:22:03 GMT</pubDate>
    <dc:creator>Raju_6952</dc:creator>
    <dc:date>2025-04-15T04:22:03Z</dc:date>
    <item>
      <title>Power shell scripting to delete multiple bookmarks owned by users</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2491909#M21489</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am planning to below power shell scripting to delete the bookmark owned by specific users and that are never published.&lt;/P&gt;
&lt;P&gt;Is this code finde or need to make any changes here.&lt;/P&gt;
&lt;P dir="ltr"&gt;# Define your Qlik server, app ID, and credentials&lt;/P&gt;
&lt;P dir="ltr"&gt;$qlikServer = "https://&amp;lt;QlikServer&amp;gt;:4242"&lt;/P&gt;
&lt;P dir="ltr"&gt;$appId = "&amp;lt;YourAppID&amp;gt;"&lt;/P&gt;
&lt;P dir="ltr"&gt;$headers = @{&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "X-Qlik-User" = "UserDirectory=Internal;UserId=sa_repository"&lt;/P&gt;
&lt;P dir="ltr"&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;# Define a list of specific owners (usernames) whose unpublished bookmarks should be deleted&lt;/P&gt;
&lt;P dir="ltr"&gt;$specificOwners = @("user1", "user2", "user3") # replace with actual usernames&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;# Step 1: Get all bookmarks in the app&lt;/P&gt;
&lt;P dir="ltr"&gt;$bookmarks = Invoke-RestMethod -Uri "$qlikServer/qrs/bookmark/full?filter=app.id eq '$appId'" -Headers $headers -Method Get&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;# Step 2: Loop through bookmarks and delete only unpublished (never published) bookmarks from specific owners&lt;/P&gt;
&lt;P dir="ltr"&gt;foreach ($bookmark in $bookmarks) {&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Check if the bookmark is unpublished (no publishTime and published is false) and the owner is in the specified list&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (-not $bookmark.publishTime -and !$bookmark.published -and $specificOwners -contains $bookmark.owner.userId) {&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Delete the unpublished bookmark&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $bookmarkId = $bookmark.id&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Invoke-RestMethod -Uri "$qlikServer/qrs/bookmark/$bookmarkId" -Headers $headers -Method Delete&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Output "Deleted unpublished bookmark with ID: $bookmarkId, owned by $($bookmark.owner.userId)"&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P dir="ltr"&gt;}&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;Any suggestions would be highly appreciated.&lt;/P&gt;
&lt;P dir="ltr"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir="ltr"&gt;Regards,&lt;/P&gt;
&lt;P dir="ltr"&gt;Raju&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2024 14:32:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2491909#M21489</guid>
      <dc:creator>Raju_6952</dc:creator>
      <dc:date>2024-11-10T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Power shell scripting to delete multiple bookmarks owned by users</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514349#M22068</link>
      <description>&lt;P&gt;This will only remove the bookmarks from the QRS (Metadata), they will still exist in the App Binary file.&lt;BR /&gt;to remove them from the binary, you need to use the engine APIs to remove the Bookmarks from the app. &lt;BR /&gt;&lt;BR /&gt;e.g. Qlik Sense SDK,&lt;BR /&gt;&lt;BR /&gt;You will need a process similar to the one outlined here:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Integration-Extension-APIs/Exporting-Qlik-Script-QVS-with-Powershell-QSefW/m-p/2507166#M21859" target="_self"&gt;Exporting-Qlik-Script-QVS-with-Powershell-QSefW&lt;/A&gt;&amp;nbsp;to get the $QEApp so you can call&amp;nbsp;DestroyGenericBookmark with the Bookmark Engine ObjectID&lt;BR /&gt;&lt;SPAN&gt;$QEApp.DestroyGenericBookmark($bookmark.EngineObjectID)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 04:17:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514349#M22068</guid>
      <dc:creator>Marc</dc:creator>
      <dc:date>2025-04-15T04:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Power shell scripting to delete multiple bookmarks owned by users</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514351#M22069</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/29458"&gt;@Marc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We got some python script which can be used to delete the bookmarks from app binary by listening the bookmarks object ifs in the CSV file .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 04:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514351#M22069</guid>
      <dc:creator>Raju_6952</dc:creator>
      <dc:date>2025-04-15T04:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Power shell scripting to delete multiple bookmarks owned by users</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514441#M22075</link>
      <description>&lt;P&gt;if you are just deleting the app objects from the QRS, you can use the QlikSenseCLI in the tools folder&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Import-Module 'C:\Program Files\Qlik\Sense\Tools\QlikSenseCLI\QlikSenseCLI.psd1'
Connect-QlikSense
$specificOwners = @("user1", "user2", "user3") # replace with actual usernames
$appId = 'AppGuid'

$QSBookmarks = Get-QSAppObject -Filter "app.id eq $($appId) and ObjectType eq 'bookmark' and ($(($specificOwners|%{"Owner.userid eq '$_'"}) -join(" or ")))"

foreach($QSBookmark in $QSBookmarks){
Remove-QSAppObject -Id $QSBookmark.id
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Apr 2025 13:41:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Power-shell-scripting-to-delete-multiple-bookmarks-owned-by/m-p/2514441#M22075</guid>
      <dc:creator>Marc</dc:creator>
      <dc:date>2025-04-15T13:41:55Z</dc:date>
    </item>
  </channel>
</rss>

