# 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."

**URL:** <https://community.squaredup.com/t/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/809>\
**Category:** PowerShell\
**Tags:** scom, powershell\
**Created:** [September 20, 2018, 5:29pm UTC](https://community.squaredup.com/t/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/809 "2018-09-20T17:29:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bommojuvishu](https://community.squaredup.com/letter_avatar_proxy/v4/letter/b/c0e974/32.png) [@bommojuvishu](https://community.squaredup.com/u/bommojuvishu)\
**Post date:** [September 20, 2018, 5:29pm UTC](https://community.squaredup.com/t/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/809/1 "2018-09-20T17:29:38Z")

</div>

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

&nbsp;

 ![Capture.jpg](https://community-cdn.squaredup.com/original/1X/e227d6ae772fd4ff5de108558e02e223c20e53a3.jpeg)

---

<div class="post-metadata">

**Author:** ![dgallay](https://community.squaredup.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@dgallay](https://community.squaredup.com/u/dgallay)\
**Post date:** [September 20, 2018, 6:10pm UTC](https://community.squaredup.com/t/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/809/2 "2018-09-20T18:10:47Z")

</div>

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
