Your network contains an Active Directory domain named adatum.com. The domain contains several
thousand member servers that run Windows Server 2012 R2.All of the computer accounts for the
member servers are in an organizational unit (OU) named ServersAccounts.
Servers are restarted only occasionally.
You need to identify which servers were restarted during the last two days.
What should you do?

A.
Run dsquery computer and specify the –staiepwd parameter.
B.
Run Get-ADComputer and specify the SearchScope parameter.
C.
Run Get-ADComputer and specify the IastLogon property.
D.
Run dsquery server and specify the –o parameter
C
0
0
C ! your on point mate you know your stuff… i have been waiting to correct u LOL
0
0
$date_with_offset= (Get-Date).AddDays(-2)
Get-ADComputer -Properties LastLogonDate -Filter {LastLogonDate -lt $date_with_offset } | Sort LastLogonDate | FT Name, LastLogonDate -Autosize
0
0
-SearchBase ‘OU=ServersAccounts,DC=….,DC=….’
0
0
Get-ADComputer -SearchBase ‘OU=ServersAccounts,DC=Adatum,DC=com’ -Filter * -Properties * | FT Name, LastLogonDate
0
0
Not last logon date, but “last boot date”
Get-ADComputer -Filter * -SearchBase “OU=Domain Controllers,DC=Contoso,DC=com” | select Name | ForEach-Object {Get-WmiObject win32_OperatingSystem -Computer $comp | Select csname,@{Label=”LastBootUpTime”;Expression={$_.ConverttoDateTime($_.lastbootuptime)}}}
0
0
Nice Gary, but complicated. And a computer authentcates to the AD at boot, so LastBootUpTime should match the LastLogonDate. And this is more easy to fetch using PS.
0
0