Monthly Archives: June 2015

Obtain List of Active Directory Users Sorted by Last Logon Date

A common question asked by many HR Managers and Administrators a like.

How many users do we have in a company? and when did they last logon?

This quick one line will achieve this goal and send the output to a CSV file, which can be used to create reports in Microsoft Excel.

$adaccount = Get-ADUser -Filter * -Properties LastLogonDate,PasswordLastSet, whencreated |Where-Object {$_.enabled -eq $true} |Sort-Object -Property LastLogonDate -Descending |select Name, LastLogonDate, PasswordLastSet, Enabled, WhenCreated
$adaccount | export-csv ("C:\UserLastLogonDateV1.1.csv") -NoTypeInformation

 

Advertisements

Microsoft Hyper-V 2012 R2 patches and hotfixes

A key update viewed in many eyes for any Hyper-V environment.

Released back in April 2015, a new security vulnerability has been discovered which could result in a denial of service to a virtual machine running in Hyper-V. Even thou this may not impact other running virtual machines this could affect manageability of the underlying hosts.

The following Microsoft KB provides further info and patch information. https://support.microsoft.com/en-us/kb/3047234

As per best practice, it best to ensure your Hyper-V environment’s have been fully patched with all the latest hot fixes and patches. The following articles should be used as guidance on what to install.

https://support.microsoft.com/en-us/kb/2920151

http://social.technet.microsoft.com/wiki/contents/articles/20885.hyper-v-update-list-for-windows-server-2012-r2.aspx

Is your Dell Drac/idrac default password still calvin?

I’m sure many folk already know this oldie. But you wouldn’t believe how many times I’ve seen a reset config rather than a soft reset of an unresponsive drac being performed using racadm resulting in the default password being reinstated.

Default IP: 192.168.0.120/24

Default username: root

Default password: calvin

Best practice should be to reset root user to have a complex password. Or even enable LDAP integration of supported on your card.

How many VM’s are running in Hyper-V cluster?

Common question asked by many admins, How many virtual machines are running in my Hyper-V cluster? This quick one line powershell cmd queries the cluster object for all VM’s and gathers some key usage configuration information and exports to CSV for easy reading.

Run this command on any Hyper-V node in the cluster. Tested on Microsoft Windows Server 2012 R2

Get-ClusterGroup | ? {$_.GroupType -eq 'VirtualMachine' } | Get-VM | ft VMName, State, ProcessorCount,@{label="MemoryStartup(GB)";Expression={$_.MemoryStartup/1024/1024}},DynamicMemoryEnabled |out-file C:\hvlist.csv

Reason for blogging

If you’ve stumbled across this site your are no doubt a fellow techie like myself working within IT infrastructure support and/or consultancy.

My goal is to help share experiences and best practice’s of working in the real world of IT. Along with having a place to keep track of all the random fixes and notes that I have taken over the years. I have tried Evernote, OneNote and the olde classic notepad to try organizing these thoughts but somehow also manage to misplace things.

Anyhow having these notes stored in one place, I have a single pane of glass (How many times have you heard that before lol) to find the information I need as long as I have a connection to the web.

Predominantly I will be posting about how I’ve used products around the Microsoft and VMware stack.

Cheers,

Dave