I am using the Quest AD tools. I loaded them up before I ran this code.
function inactive_computers()
{
Set-QADPSSnapinSettings -DefaultSizeLimit 0
$old = (Get.Date).AddDays(-50)
Get-QADComputer -IncludedProperties pwdLastSet -SizeLimit 10 | where {$_.pwdLastSet -le $old}
}
inactive_computers | Sort-Object -property 'Name'
-----------------------------------------------------------------------------------------------------
When I run this code I get this error.
Get.Date : The term 'Get.Date' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
But the Get-Date looks fine when I compare it against code I've found online.
mqh7