Find the resources which are untagged / not having any Tags in a Subscription

Dhanalakshmi 20 Reputation points
2024-02-14T13:07:26.23+00:00

How to find all the resources which are Untagged / Not having any tags in a subscription Via PowerShell Script or Policies

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
796 questions
{count} votes

3 answers

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 17,556 Reputation points
    2024-02-14T17:22:11.4833333+00:00

    @Dhanalakshmi You can use PowerShell to find all the resources that are untagged or do not have any tags in an Azure subscription.

    Here's how you can do it using PowerShell: Open PowerShell and connect to your Azure subscription using the Connect-AzAccount cmdlet. Run the following command to get a list of all the resources in your subscription:

    $resources = Get-AzResource
    
    1. Run the following command to filter the list of resources to only show the resources that do not have any tags:
    $untaggedResources = $resources | Where-Object { $_.Tags.Count -eq 0 }
    
    1. The $untaggedResources variable now contains a list of all the resources in your subscription that do not have any tags.

  2. Rob Logie 0 Reputation points
    2024-04-10T23:23:35.1933333+00:00

    For me, none of these suggestions work to locate a resource group that has no tags at all attached to it

    0 comments No comments

  3. alamjeet singh 0 Reputation points
    2024-04-11T00:08:51.43+00:00

    Please try this :

    $resources = Get-AzResource

    $untaggedResources = $resources | Where-Object { -not $_.Tags }

    $untaggedResources | Format-Table Name, ResourceType, ResourceGroupName, Location