Home General Discussion
Options

Get Members of User Role Via PowerShell

Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭

I need to get the members of the SCSM user roles via PowerShell for a security review. I can get the user roles themselves but I can't find a relationship to get the members. I know someone knows what I'm missing.


Nick

Best Answer

  • Options
    Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    Answer ✓

    With the case of SMLets, it isn't a relationship but in fact just a property on the User Role itself. The following SMlets pulls User Groups + an array of their Users

    Get-SCSMUserRole | select displayname, user | sort displayname
    

    Then if you wanted to, cycle through the User property with a combination of Active Directory Powershell with Get-ADUser and Get-ADGroup.


    Is that what you're looking for?

Answers

  • Options
    Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    Answer ✓

    With the case of SMLets, it isn't a relationship but in fact just a property on the User Role itself. The following SMlets pulls User Groups + an array of their Users

    Get-SCSMUserRole | select displayname, user | sort displayname
    

    Then if you wanted to, cycle through the User property with a combination of Active Directory Powershell with Get-ADUser and Get-ADGroup.


    Is that what you're looking for?

  • Options
    Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭

    Thank you, @Adam_Dzyacky! This is exactly what I needed.

Sign In or Register to comment.