Murty M
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
VMware version 6.0, client OS WIN7 and 10
Please suggest
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
Run in an elevated PoSh on a DC.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@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. :)
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.
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.
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.
ASKER
Thank you.
You will need to look at OS Powershell scripts.