Link to home
Start Free TrialLog in
Avatar of Murty M
Murty MFlag for India

asked on

Utilisation of a VM

Hi is there a possibility to get the last login details from each VM older than 60 days so that the VM can be decomissiined if not being used based on the usage.

VMware version 6.0, client OS WIN7 and 10

Please suggest
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

It's not a VMware vSphere function. VMware vSphere just hosts the VM.

You will need to look at OS Powershell scripts.
Avatar of Murty M

ASKER

yes, I am looking for the same. i.e PS Script.
Here is one of the PowerShell steps we do in an audit that should work for you:
Get-ADComputer -Filter * -Properties * | Select-Object -Property Name,DNSHostName,Enabled,LastLogonDate

Open in new window

Run in an elevated PoSh on a DC.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Qlemo The reason for the "never" please?
Collecting all properties in AD requires a lot of resources (CPU and memory). If you want to dismiss 90% of it anyway, don't ask AD for details ;-).
@Qlemo Thanks for the clarification. :)
Avatar of Murty M

ASKER

Can we do a wmi query for Win32_UserProfile to get the last login for each VM, not a problem if we do on all the machines.
The power shell script should do a test-connection then continue to next available machine.
You should think you can do that, but scheduled tasks, services etc. will perform authentications all the time, even if no one is actively logged in. And querying WMI will generate a new login event too.
Avatar of Murty M

ASKER

Thanks for your reply  when we try to call from Win32_UserProfile it only check to see the user profile rather to create, let me try on few machines and test the said command.
Avatar of Murty M

ASKER

Thank you.