Use PowerShell to Remove Lighthouse Delegations Based on Subscription IDs
You may use this script to easily list the resource groups per subscription, and programmatically remove the delegation based on user input.
Notes on using the script:
- The script will accept a list of subscription ids as input at the command line (separated by commas), OR, a text file with a list of subscription IDs within it.
- For each subscription, it reads the delegations and outputs on the screen, then asks if you want to remove them.
- As written, the code will remove BOTH resource group and subscription-level assignments. Adjust the code as needed to ignore subscription-level assignments.
- This code is provided AS IS and as an example only.
Example of what Lighthouse looks like before running the script. Note subscription names and IDs are not visible so in cases where the resource groups are the same name, you do not know which subscription they belong to making delegation removal via UI difficult.
Example script output. Note in this case, duplicate resource group names in separate subscriptions are not a concern. This was due to my testing but if duplicate names were present, each name would show under its proper subscription.
Published on:
Learn moreWe can help you with Use PowerShell to Remove Lighthouse Delegations Based on Subscription IDs
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
Unlocking the Best of Azure with AzureRM and AzAPI Providers
With the recent release of AzAPI 2.0, Azure offers two powerful Terraform providers to meet your infrastructure needs: AzureRM and AzAPI. The ...
Announcing AzAPI 2.0
The AzAPI provider, designed to expedite the integration of new Azure services with HashiCorp Terraform, has now released 2.0. This updated ve...
Azure CLI docker container base Linux image is now Azure Linux
Starting from the version 2.64.0 of Azure CLI, the base Linux distribution of Azure CLI is now Azure Linux. Impact of the change ...
Mastering the Shorthand Syntax in your daily workflow
Introduction In this tech blog, we'll unravel the magic behind Azure CLI shorthand syntax and discover how it can elevate your command-line ex...
Azure Verified Modules - Monthly Update [June]
AVM Module Summary The AVM team are excited that our community have been busy building AVM Modules. As of June 17th, the AVM Footprint curren...
Azure Verified Modules - Monthly Update [May]
Quarterly Community Call This month we held our first community call. Thank you to everyone that attended & contributed. It was amazing t...
Azure CLI and PowerShell Tools Build 2024 Announcement
Microsoft has announced several new capabilities for Azure CLI and Azure PowerShell at the Microsoft Build 2024. The priority remains to provi...
Terraform on Azure May 2024 Update
Welcome to our April 2024 update! These blogposts will be covering everything we've gotten up to recently with Terraform on Azu...
Azure Verified Modules - Monthly Update [April]
In the April edition of the Azure Verified Modules update, the AVM team announces their upcoming quarterly community call scheduled for 21st M...
Announcing AzAPI Dynamic Properties
It’s been almost two years since the announcement of AzAPI, and the provider has eclipsed 20M+ downloads thanks to all of you. We’re ex...