As with any managed services or infrastructure services projects, maintaining the server inventory is very crucial. The server-inventory-file provides a one-stop checklist, that you can refer while you are on priority 1 bridge calls.
With a traditional data center, it is easy to maintain server/infra inventory on an excel sheet. But it is not the same as the cloud because the infrastructure is so dynamic.
The only solution to this problem is Automation. I have written a PowerShell script just to do that.
The script produces a CSV file for individual services inside individual subscription’s folder.
DESCRIPTION:
This script will pull the infrastructure details of the Azure subscriptions. Details will be stored under the folder “c:\AzureInventory”. If you have multiple subscriptions, a separate folder will be created for individual subscription. CSV files will be created for individual services (Virtual Machines, NSG rules, Storage Account, Virtual Networks, Azure Load Balancers) inside the subscription’s directory
Below is the link to the script:
https://gallery.technet.microsoft.com/scriptcenter/Azure-Inventory-using-3db0f658?redir=0
Below are the links to:
Reblogged this on Cloud & Virtualization.
LikeLiked by 1 person
Hi Manjunath,
Script is very good. We need in virtual machine worksheet Virtual machine running status can you please add and republish the script.
Thanks,
Sheikvara
LikeLike
one more request we need cidr value in script also.
Thanks,
Sheikvara
LikeLike
Hi,
I am getting error
login-azurermaccount : The term ‘login-azurermaccount’ is not recognized as
the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
Can you suggest why this error and which version of powershell this script support
LikeLike
Hello Suraj, You need to update your Azure Power shell modules. Use the command: “Install-Module AzureRM -AllowClobber”
LikeLike
‘AzureRm’ module will be retired soon. I have updated the script to use the Azure ‘AZ’ module. Link to script: https://github.com/manjunathrao/manjunathrao-blog/blob/main/PowerShell/Get-AzInventory.ps1
Note: You will have to use the AZ modules. I have tested this in Powershell 5.1 version
LikeLike
Hi
My am getting error,
login-azurermaccount : The term ‘login-azurermaccount’ is not recognized as
the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
Please suggest and also let me know which version of Powershell is support
LikeLike
Hello Biswakarmas, You need to update your Azure Power shell modules. Use the command: “Install-Module AzureRM -AllowClobber”
LikeLike