get azure subscriptions‘ all stroages,containers and blobs by PowerShell
来源:互联网 发布:三三地方门户系统源码 编辑:程序博客网 时间:2024/06/07 11:09
导到excel里
# Add your Azure account to the local PowerShell environment.Add-AzureRmAccount -Environment AzureChinaCloud$x=1$excel = New-Object -ComObject Excel.Application $excel.Visible = $true$workbook = $excel.Workbooks.add()$sheet = $workbook.worksheets.Item(1)$SubscriptionNames = Get-AzureRMSubscriptionforeach ($sub in $SubscriptionNames){ $subname=$sub.name $sheet.cells.item($x, 1) = "SubscriptionName" $x++ $sheet.cells.item($x, 1) = $subname $x++ Select-AzureRMSubscription -SubscriptionName $subname $StorageAccountNames=Get-AzureRmStorageAccount foreach($str in $StorageAccountNames) { $strname=$str.StorageAccountName $strrg=$str.ResourceGroupName $sheet.cells.item($x, 2) = "ResourceGroup" $x++ $sheet.cells.item($x, 2) = $strrg $x++ $sheet.cells.item($x, 3) = "storage account name" $x++ $sheet.cells.item($x, 3) = $strname $x++ $StorageAccountKey = Get-AzurermStorageaccountKey -ResourceGroupName $strrg -Name $strname $Ctx = New-AzureStorageContext $strname -StorageAccountKey $StorageAccountKey.GetValue(0).value $containers=Get-AzureStorageContainer -Context $Ctx $sheet.cells.item($x, 4) = "container" $x++ foreach($con in $containers) { $conname=$con.Name $sheet.cells.item($x, 4) = $conname $x++ $blobs=Get-AzureStorageBlob -Context $ctx -Container $conname $sheet.cells.item($x, 5) = "blob" $x++ foreach($blob in $blobs) { $blob2=$blob $sheet.cells.item($x, 5) = $blob2.Name $sheet.cells.item($x,2) = $blob2.BlobType $x++ } } }}
阅读全文
0 0
- get azure subscriptions‘ all stroages,containers and blobs by PowerShell
- Self-Learning:Naming and Referencing Containers, Blobs, and Metadata
- how to get remote fqdn by powershell?
- navigate and process Analysis Services by powershell
- all kinds of containers
- Get the Containers
- Get the Containers
- Get Azure Active Directory GUID By Power shell
- PowerShell Azure 常用命令
- PowerShell登录Azure方法
- Designing Data Storage Architecture - Understanding Block Blobs and Page Blobs
- Java - All Kinds of Containers
- Containers and testing framworks
- IOC Containers and MVVM
- IOC Containers and MVVM
- Portlet and servlet containers
- Parallel Containers and Objects
- docker运行报错Get http:///var/run/docker.sock/v1.18/containers/json?all=1:
- 直方图均衡化
- sts控制台输出tomcat启动后网址颜色为黑不为蓝
- ListView的优化
- AndroidStudio控制台搜索栏内输入中文变成方框解决
- C/C++训练1---最大公约数与最小公倍数
- get azure subscriptions‘ all stroages,containers and blobs by PowerShell
- 手机登录界面
- java 导出Excel文件
- Android事件分发机制
- 常用sql语句及案例(oracle)
- LeetCode--Length of Last Word (计算最后一个单词的长度)Python
- NOIP2007提高组
- itext7学习笔记——第5章
- 如何成为Java软件工程师