[環境]:Windows Server 2008 R2-SP1<=DC
..........XP,Win 7
[問題]:
1.在2008R2為DC下,可看到網域帳號 AAA現在有登入到哪台電腦嗎
2.網域帳號 AAA 除了在[AD使用者和電腦]下,看到內容外,還有甚麼方式可看到更詳細的資料?
譬如:最後登入的時間,...
<<感謝>>
請服用 PowerShell Script:
<pre class="c" name="code">Import-Module ActiveDirectory
function Get-ADUserLastLogon([string]$userName)
{
$dcs = Get-ADDomainController -Filter {Name -like "*"}
$time = 0
foreach($dc in $dcs)
{
$hostname = $dc.HostName
$user = Get-ADUser $userName | Get-ADObject -Properties lastLogon
if($user.LastLogon -gt $time)
{
$time = $user.LastLogon
}
}
$dt = [DateTime]::FromFileTime($time)
Write-Host $username "last logged on at:" $dt }
Get-ADUserLastLogon -UserName administrator