Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Add SystemUsers to Team via Powershell?

Posted on by Microsoft Employee

I've tried several methods, but there doesn't seem to be a lot documented.  I've attempted to use:

new-crmrecord -entitylogicalname teammembership -fields @{
    "systemuserid"="59c29998-dc13-e611-80e9-005056bb6a40"
    "teamid"="241028f4-9e7a-e611-80ed-005056bb6a40"}

add-crmrecordassociation -CrmRecord1 5260d3ba-8e7a-e611-80ed-005056bb6a40 -crmrecord2 241028f4-9e7a-e611-80ed-005056bb6a40 -RelationshipName teammembership

Add-CrmRecordAssociation -EntityLogicalName1 systemuser -Id1 "241028f4-9e7a-e611-80ed-005056bb6a40" -EntityLogicalName2 team -id2 "5260d3ba-8e7a-e611-80ed-005056bb6a40"


and none of these cmdlets are getting the job done.  Just reaching errors telling me:

The 'Create' method does not support entities of type 'teammembership'.

OR

Entity Relationship teammembership was not found in the metadata

Anyone have ideas on how to complete this task?

Thanks!

*This post is locked for comments

  • Manuel Duque Profile Picture
    Manuel Duque 5 on at
    RE: Add SystemUsers to Team via Powershell?

    Thanks a lot for the info.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Add SystemUsers to Team via Powershell?

    Apparently, using "teammembership_association" is the correct way to do it.

    Add-CrmRecordAssociation -EntityLogicalName1 team -Id1 "241028f4-9e7a-e611-80ed-005056bb6a40" -EntityLogicalName2 systemuser -id2 "5260d3ba-8e7a-e611-80ed-005056bb6a40" -RelationshipName teammembership_association


    This resolves my issue.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans