上一次机器运行时 [英] last time when machines was running

查看:82
本文介绍了上一次机器运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们的帐户中有300多个已停止VM的虚拟机,如何使用Powershell找出上次计算机运行的时间?
我可以使用一些命令来至少有一个订阅要让所有已停止的计算机最后一次打开?

Hi.
We have in our account 300+ stopped VM's, how can I, by using powershell, find out what was last time when machines was running ?
Can I use some command for at least one subscription to get all stopped machines was last Turn On ?

推荐答案

Azure活动登录到存储如果您希望将活动日志"保留的时间长于 90天(可完全控制保留策略)进行审核,静态分析或备份.如果您只需要将事件保留90天或更短的时间,则无需为存储帐户设置档案,因为活动日志事件是 在Azure平台上保留了90天而未启用存档.
要获取虚拟机的最后时间戳记,我建议您遵循cmdlet:

Azure Activity Log in a storage account is the option useful, if you would like to retain your Activity Log longer than 90 days (with full control over the retention policy) for audit, static analysis, or backup. If you only need to retain your events for 90 days or less you do not need to set up archival to a storage account, since Activity Log events are retained in the Azure platform for 90 days without enabling archival.
To get last Time Stamp of the Virtual machines
,I would suggest you to follow the cmdlets:

Connect-AzureRmAccount
Select-AzureRmSubscription –SubscriptionName 'subscription-name'

Get-AzureRmLog | Where-Object {


_.Authorization.Action -eq'Microsoft.Compute/virtualMachines/deallocate/action'}
_.Authorization.Action -eq 'Microsoft.Compute/virtualMachines/deallocate/action'}

有关更多信息,建议您 引用 存档Azure活动日志

For more information, suggest you to refer Archive the Azure Activity Log

If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here


这篇关于上一次机器运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆