locked
SCSM: Need powershell script to get RA reviewer displayname RRS feed

  • Question

  • I want to get SCSM review activity reviewer displayname from powershell
    Friday, May 17, 2013 12:03 PM

Answers

  • Import-Module SMLets
    $RAid = "RA30988"
    $RA = Get-SCSMObject (Get-SCSMClass System.WorkItem.Activity.ReviewActivity$) -Filter "Id -eq $RAid"
    $relRev = Get-SCSMRelationshipClass System.ReviewActivityHasReviewer$
    $relRevUser = Get-SCSMRelationshipClass System.ReviewerIsUser$
    foreach ($Reviewer in Get-SCSMRelatedObject -SMObject $RA -Relationship $relRev)
    {
        $ReviewerUser = Get-SCSMRelatedObject -SMObject $Reviewer -Relationship $relRevUser
        $ReviewerUser.DisplayName
    }
    Remove-Module SMLets

    Thursday, May 23, 2013 1:59 PM

All replies

  • Import-Module SMLets
    $RAid = "RA30988"
    $RA = Get-SCSMObject (Get-SCSMClass System.WorkItem.Activity.ReviewActivity$) -Filter "Id -eq $RAid"
    $relRev = Get-SCSMRelationshipClass System.ReviewActivityHasReviewer$
    $relRevUser = Get-SCSMRelationshipClass System.ReviewerIsUser$
    foreach ($Reviewer in Get-SCSMRelatedObject -SMObject $RA -Relationship $relRev)
    {
        $ReviewerUser = Get-SCSMRelatedObject -SMObject $Reviewer -Relationship $relRevUser
        $ReviewerUser.DisplayName
    }
    Remove-Module SMLets

    Thursday, May 23, 2013 1:59 PM
  • How to delete the already added reviewer from PS script.
    Tuesday, June 18, 2013 10:54 AM
  • Import-Module SMLets
    $RAid = "RA30988"
    $RA = Get-SCSMObject (Get-SCSMClass System.WorkItem.Activity.ReviewActivity$) -Filter "Id -eq $RAid"
    $relRev = Get-SCSMRelationshipClass System.ReviewActivityHasReviewer$
    $relRevUser = Get-SCSMRelationshipClass System.ReviewerIsUser$
    foreach ($Reviewer in Get-SCSMRelatedObject -SMObject $RA -Relationship $relRev)
    {
        $Reviewer | Remove-SCSMObject -Force
    }
    Remove-Module SMLets

    Wednesday, June 19, 2013 11:14 AM