Launch SCCM anti-virus scan from ICON

I’m trying to run a cmdlet on the SCCM server to start a full scan of a device name.

Running this command on the SCCM server works, but I get a failure in ICON.

Invoke-CMEndpointProtectionScan -DeviceName “{{[“Loop Through Each Asset”].[$item].[shortname]}}” -ScanType Full

Invoke-CMEndpointProtectionScan : The term ‘Invoke-CMEndpointProtectionScan’ is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.

For others who may run into this problem, it appears to be an issue of being able to find the cmdlet. An import of the library that contains the cmdlet should allow it to be accessible.

In case this is helpful to others, here is what I put into the Powershell Script plugin.

Import-Module “\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1”;cd :;Invoke-CMClientAction -DeviceName {{[“Loop Through Each Asset”].[$item].[shortname]}} -ActionType EndpointProtectionFullScan

1 Like