ESM PS Evaluate - Survey Sent Pass Fail

Modified on Wed, 19 Jan, 2022 at 12:14 PM





#Run the powershell script with a param from esm. the survey ID is required.
$Surveys = Get-MSSurveysForModuleItems -Module UserMigrations -SurveyId $scriptArgs.UserInput -InstanceIds $ScriptArgs.Items -Full

$Results = @()

Foreach($Survey in $Surveys){

    If($Survey.RequestEmailSent -eq $true){
            $results += New-Object PSObject -Property @{
            InstanceId = $Survey.InstanceId;
            ResultHeader = "User has been sent the Survey called `"$($Survey.SurveyName)`" ";   
            ResultStatus = "Success"}
                }
    Else{$results += New-Object PSObject -Property @{
            InstanceId = $Survey.InstanceId;
            ResultHeader = "User has NOT been sent the Survey called `"$($Survey.SurveyName)`" ";   
            ResultStatus = "Error"}    

                }

    }


$results



Evaluate Function - The criteria should be the survey ID


Further Support

If you require further support, please visit ManagementStudio's Service Desk to search the knowledge base or create a new support ticket.