Forum Discussion
Add-PowerBIWorkspaceUser - adding group to Workspace
- Anonymous4 years ago
HI ,
Below worked like a charm :Add-PowerBIWorkspaceUser -Scope Organization -Id <workspaceid> -UserEmailAddress [email protected] -AccessRight Admin
Ensure: You have Admin Rights to add the user. I tested it just now my user from which running API has Admin Rights on the workspace and its Premium ( to be considered if you are adding free user )
Waiting for update 🙂
CHeers
Mahak
Also, there is a very nice blog/code available for Automation: https://github.com/microsoft/powerbi-powershell/blob/master/src/Modules/Workspaces/Commands.Workspaces/help/Add-PowerBIWorkspaceUser.md which can help more. Tried and Tested.
I tried it, but I get the same error:
Add-PowerBIWorkspaceUser : Operation returned an invalid status code 'NotFound'
It works when I add a user to a Workspace:
Add-PowerBIWorkspaceUser -Id <Workspace Id> -AccessRight Contributor -Identifier <User UPN> -PrincipalType User
- Anonymous4 years agoNot applicable
HI ,
Below worked like a charm :Add-PowerBIWorkspaceUser -Scope Organization -Id <workspaceid> -UserEmailAddress [email protected] -AccessRight Admin
Ensure: You have Admin Rights to add the user. I tested it just now my user from which running API has Admin Rights on the workspace and its Premium ( to be considered if you are adding free user )
Waiting for update 🙂
CHeers
Mahak- kimlaurits4 years agoFrequent Visitor
Yes - the same works here, when adding a user.
But unfortunately it doesn't work when adding a AD group.
- Anonymous4 years agoNot applicable
Login-PowerBI
#Using AD Security group
$Body = @{
identifier= “add your Odject ID here” #Object ID for the Security group
groupUserAccessRight= “Admin” #Permission for the group to the Workspace
principalType= “Group” #The type of Principal(App, Group, User)
}$BodyJSON=$Body | ConvertTo-Json
Invoke-PowerBIRestMethod -Method post -Url “/groups/Add your group Id here/users” -Body $BodyJSON #Workspace IDCan you trythis too.
This worked for me to add my Functional Email Group to the same workspace.
Cheers
Mahak