Share via


Modify and remove On-Demand Assessment tasks

This article provides you with information about modifying and removing On-Demand Assessment tasks for Premier and Unified customers.

Modify existing Assessment tasks

Change or update credentials used by the scheduled task to run an Assessment

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

Task properties for change and update credentials used by scheduled task to run an Assessment.

Update existing scheduled task to use gMSA

Retrieve the scheduled task name.

Get-ScheduledTask -TaskPath '\Microsoft\Operations Management Suite\*'

Update the following code 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 with Get scheduled task.

Change or update the Target SQL Servers, Window Servers or Windows Clients provided while you setup SQL Server Assessment, Windows Server Assessment or Windows Client Assessment

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

Actions pane under Task properties with Actions highlighted for selecting.

Edit run.cmd in Notepad, then save your changes.

Task properties run.cmd file in Notepad with SQL.

Remove existing Assessment Tasks

Change or update Log Analytics workspace to be used while running assessments in Microsoft Monitoring Agent in data collector machine

Before you directly change or update the Log Analytics workspace ID in Microsoft Monitoring Agent control panel in data collector machine, remove existing Assessment tasks using the following steps:

  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 run 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-\<workspaceID\>\Solutions\<Assessment>
  3. Change or update Log Analytics workspace ID in Microsoft Monitoring Agent control panel in data collector machine.

  4. 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 Report Services Hub issues for further assistance.