简体   繁体   中英

How to get the details of the all Azure VM's with respective all Tag associated with it in excel sheet with the help of powershell?

是否有任何脚本或命令可以在 PowerShell 的帮助下在 Excel 表中获取所有 azure VM 的报告,其中包括与该、RG 和订阅相关的所有标签?

You can implement the Powershell Script by following steps:

  1. Install az modules in your local machine (Install-Module -Name 'Az' -allowclobber -scope currentuser)

  2. Connect to your Azure subscription using this cmd (connect-Azaccount).

  3. Use Get-AzVm Get-AzVM (Az.Compute) | Microsoft Docs to get the list of VM under the subscription and assign the output to a variable and by using the for each loop about Foreach - PowerShell | Microsoft Docs iterate the list in the variable and project the output to csv file using the export-csv .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM