On executing the cmdlet Get-SCOMGroup in SCOM 2016, getting the error " The query processor ran out of internal resources and could not produce a query plan."

recently upgraded to the SCOM 2016 from SCOM 2012 .

when I tried to execute the get-SCOMgroup -displayname <groupname> , we are getting the following . the get-scomgroup cmdlet was executing fine in the 2012 but it is not executing the SCOM 2016 (1801 version).

Please let me know how to resolve it

Error

Get-SCOMGroup : The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information. At line:1 char:1 + Get-SCOMGroup -DisplayName “all windows*” + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Microsoft.Syste…tSCGroupCommand:GetSCGroupCommand) [Get-SCOMGroup], UnknownDatabaseException + FullyQualifiedErrorId : ExecutionError,Microsoft.SystemCenter.OperationsManagerV10.Commands.GetSCGroupCommand
 

We ran into this on SCOM 2012 after hitting about 800 groups. MS Support knew about the issue but the only way to work around it was to stop using get-scomgroup and change to code to use scomclass instead:

$Class = Get-SCOMClass | ?{$_.DisplayName -eq $groupName}

$MMGroup = Get-SCOMClassInstance -Class $Class

$MMObjects = Get-SCOMClassInstance $MMGroup

1 Like