Share via


How to Modify and Remove Assessment Tasks - Unified

This page will give you more information about Modifying and Removing On-Demand Assessment Tasks for your Premier and Unified customers.

Modify existing Assessment Tasks

How to change/update credentials used by the scheduled task to run an Assessment?

  1. Go to Task properties and select Change User or Group under security Options.

    Task Properties

How to update existing scheduled task to use gMSA?

  1. Retrieve the scheduled task name.

    Get-ScheduledTask -TaskPath '\Microsoft\Operations Management Suite\*'
    
  2. Update the code following with the scheduled task and gMSA name.

    $Principal = New-ScheduledTaskPrincipal -UserId ad\adsecgmsa$ -LogonType Password
    $Path = (Get-ScheduledTask ADSecurityAssessment).TaskPath
    $Trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Saturday -At 05:00
    Set-ScheduledTask -TaskPath $Path -TaskName ADSecurityAssessment -Trigger $Trigger -Principal $Principal
    

    gMSA scheduled task update

How to change/update Target SQL Servers, Window Servers or Windows Clients provided while setting up SQL Server Assessment, Windows Server Assessment or Windows Client Assessment respectively?

  1. Go to Task properties and select Action pane. Get the working directory path and find run.cmd file location.

    Task Properties Actions

  2. Edit run.cmd in notepad and save the file.

    Task Properties Run.cmd file

Remove existing Assessment Tasks

Remove existing Assessment tasks using the following steps before directly changing or updating the Log Analytics workspace id in Microsoft Monitoring Agent control panel in data collector machine:

  1. Check the current Assessment execution status by checking OMSAssessment.exe process in Task Manager or using get-process command in PowerShell. If you see process shown as running, we need to manually stop or kill the process.

  2. Run Remove-ADAssessmentTask PowerShell command in data collection machine to remove the Assessment task Here ADAssessment Task is an example.

    After you execute the command:

    • Check if the ADAssessment task item still exists in the Task Scheduler's list. If yes, delete it manually.
    • Check if the ADAssessment folder is present in the registry in the following location. If yes, delete it manually. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\AOI-\<workspace ID\>\Solutions\<Assessment>

Change/update Log Analytics workspace to be used while running assessments in Microsoft Monitoring Agent in data collector machine after removing existing Assessment Tasks in prior steps

Change/update Log Analytics workspace to be used while running assessments in Microsoft Monitoring Agent in data collector machine after removing existing Assessment Tasks in prior steps

  1. Change or update Log Analytics workspace id in Microsoft Monitoring Agent control panel in data collector machine.

  2. Re-Add the assessment using Add-ADAssessmentTask PowerShell command in data collection machine. Here ADAssessment Task is an example.

If you still need help, see Reporting Services Hub issues for assistance.

For general feedback on the documentation, submit your feedback to your Microsoft representative. For specific requests and content updates regarding Services Hub, contact our Support Team to submit a case.