web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add security role to D...
Power Apps
Unanswered

Add security role to Dataverse user with Azure and Powershell Add-CrmSecurityRoleToUser

(1) ShareShare
ReportReport
Posted on by 49
Hello.
I have been struggling for a few days how to properly use powershell command Add-CrmSecurityRoleToUser with Azure Runbook.
No matter what I do it works on local windows powershell but fails on Runbook.
 
Has anyone ever tried this one with success and could share proper syntax for this command?
The biggest challenge seems to be proper connection object with credentials because using Get-CrmConnection doesn't seem to work properly.
 
Maybe there is another way to prepare connection object than using Get-CrmConnection?
Any experiences?
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,345 Super User 2025 Season 2 on at
    HI,
     
    Sharing the Error etc would help a lot since we have no idea what it says.
     
    Silly question/suggestion, since you are in the D365 Forums.
     
    Why not use Flow to do it for you Or create yourself as simple Canvas App, heck you could even make a way for people to request it, approval it, then do it automatically in flow.
     
    Much easier.
  • JS-12031857-0 Profile Picture
    2 on at
    @Emejcz Did you every get this resolved? I cant get it to add a role even locally, and I am sure I have something wrong. If you have it solved, would you mind sharing the code for that part please?  Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard