<?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 how we can add user in RLS and app through Power BI REST API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306056#M58483</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how we can&amp;nbsp; implement or Add user in RLS Power BI&amp;nbsp; via REST API,&lt;/P&gt;
&lt;P&gt;i found some of scanner API but it give us only Get Access.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how could implement this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;Thank you for your support.&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/A&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/A&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2024 11:00:26 GMT</pubDate>
    <dc:creator>mohitkumawat</dc:creator>
    <dc:date>2024-11-28T11:00:26Z</dc:date>
    <item>
      <title>how we can add user in RLS and app through Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306056#M58483</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how we can&amp;nbsp; implement or Add user in RLS Power BI&amp;nbsp; via REST API,&lt;/P&gt;
&lt;P&gt;i found some of scanner API but it give us only Get Access.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how could implement this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;Thank you for your support.&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/A&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/A&gt;&lt;A id="link_34" class="" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 11:00:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306056#M58483</guid>
      <dc:creator>mohitkumawat</dc:creator>
      <dc:date>2024-11-28T11:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: how we can add user in RLS and app through Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306406#M58487</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;based on my knowlegde, there is no REST API support as of today to add users/groups within RLS in power BI&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 15:17:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306406#M58487</guid>
      <dc:creator>NandanHegde</dc:creator>
      <dc:date>2024-11-28T15:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: how we can add user in RLS and app through Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306559#M58489</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/327382"&gt;@mohitkumawat&lt;/a&gt;&amp;nbsp;You can add members to the role via &lt;STRONG&gt;powershell cmdlet&lt;/STRONG&gt; but not via Power BI Rest APIs at moment.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jai&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 18:22:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306559#M58489</guid>
      <dc:creator>Jai-Rathinavel</dc:creator>
      <dc:date>2024-11-28T18:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: how we can add user in RLS and app through Power BI REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306857#M58491</link>
      <description>&lt;P&gt;Thanks for the reply from Jai-Rathinavel&amp;nbsp;and NandanHegde&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/327382"&gt;@mohitkumawat&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Could you please let me know if the responses from Jai-Rathinavel&amp;nbsp;and NandanHegde&amp;nbsp; have resolved your issue?&lt;/SPAN&gt;&lt;SPAN&gt;If it did, kindly accept it as the solution.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vlinyulumsft_0-1732850820674.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1207718i71346E421D678DE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vlinyulumsft_0-1732850820674.png" alt="vlinyulumsft_0-1732850820674.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I agree with their suggestion; PowerShell is a good alternative. However, please note that you cannot directly add users to RLS via the PowerShell API. Here is a link to the relevant issue:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Service/How-to-add-a-member-to-a-RLS-via-Power-Shell-API-or/m-p/1315414" target="_blank"&gt;&lt;SPAN&gt;Solved: How to add a member to a RLS via Power Shell, API ... - Microsoft Fabric Community&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, you need to first create a security group and then automatically add users from, for example, a CSV file to the security group. Below is a sample code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Start transcript
Start-Transcript -Path C:\Temp\Add-ADUsers.log -Append

# Import AD Module
Import-Module ActiveDirectory

# Import the data from CSV file and assign it to variable
$Users = Import-Csv "C:\Temp\Users.csv"

# Specify target group name (pre-Windows 2000) where the users will be added to
# You can add the distinguishedName of the group. For example: CN=Pilot,OU=Groups,OU=Company,DC=exoip,DC=local
$Group = "Pilot"

foreach ($User in $Users) {
    # Retrieve UPN
    $UPN = $User.UserPrincipalName

    # Retrieve UPN related SamAccountName
    $ADUser = Get-ADUser -Filter "UserPrincipalName -eq '$UPN'" | Select-Object SamAccountName

    # User from CSV not in AD
    if ($ADUser -eq $null) {
        Write-Host "$UPN does not exist in AD" -ForegroundColor Red
    }
    else {
        # Retrieve AD user group membership
        $ExistingGroups = Get-ADPrincipalGroupMembership $ADUser.SamAccountName | Select-Object Name

        # User already member of group
        if ($ExistingGroups.Name -eq $Group) {
            Write-Host "$UPN already exists in $Group" -ForeGroundColor Yellow
        }
        else {
            # Add user to group
            Add-ADGroupMember -Identity $Group -Members $ADUser.SamAccountName -WhatIf
            Write-Host "Added $UPN to $Group" -ForeGroundColor Green
        }
    }
}
Stop-Transcript
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;For further details, please refer to:&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Service/Adding-users-to-role-on-power-bi-service-automatically/m-p/2218683" target="_blank"&gt;&lt;SPAN&gt;Solved: Adding users to role on power bi service automatic... - Microsoft Fabric Community&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://www.alitajran.com/add-users-to-group-powershell/#:~:text=%20Add%20users%20to%20group%20with%20PowerShell%20,use%20the%20correct%20header.%20In%20our...%20More%20" target="_blank"&gt;&lt;SPAN&gt;Add users to group with PowerShell - ALI TAJRAN&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal?tabs=azure-portal#create-a-security-group-by-using-powershell" target="_blank"&gt;&lt;SPAN&gt;https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal?tabs=azure-portal#create-a-security-group-by-using-powershell&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://m365corner.com/m365-powershell/using-new-mggroupmember-in-graph-powershell.html" target="_blank"&gt;New-MgGroupMember: Add Members to Groups Easily | M365Corner&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Of course, if you have any new discoveries or questions, please feel free to get in touch with us.&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 03:30:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/how-we-can-add-user-in-RLS-and-app-through-Power-BI-REST-API/m-p/4306857#M58491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-29T03:30:10Z</dc:date>
    </item>
  </channel>
</rss>

