Forum Discussion

Mayank Bansal's avatar
Mayank Bansal
Icon for Microsoft rankMicrosoft
Oct 02, 2019
Solved

Computer group created through PowerShell cmdlet not working

I created computer group using powershell cmdlet New-AzOperationalInsightsComputerGroup ------- $Query  = "Heartbeat | where Computer in ('myserver.adx.com') | distinct Computer" New-AzOperation...
  • HiMayank Bansal You can use PowerShell to do ARM template deployment. The resource part in your case will look like this:

    {
          "name": "[concat(parameters('logAnalyticsWorkspaceName'), '/', 'id12345' )]",
          "type": "Microsoft.OperationalInsights/workspaces/savedSearches",
          "apiVersion": "2017-03-15-preview",
          "tags": {
          },
          "properties": {
            "query": "Heartbeat | where Computer in ('myserver.adx.com') | distinct Computer",
            "displayName": "MyDN",
            "category": "MyCategory",
            "FunctionAlias" : "MyDN",
            "Version": 2,
            "ETag": "*",
            "Tags": [
                {
                    "Name": "Group",
                    "Value": "Computer"
                }
            ]
          }
        }
    

    The tags part with name Group and value Computer basically makes the function also Computer group.

Resources