active_directory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
active_directory [2022/01/14 13:24] mguptonactive_directory [2022/01/17 17:21] (current) – [Solutions] mgupton
Line 1: Line 1:
 ====== Active Directory ====== ====== Active Directory ======
  
 +====== Tools ======
 +  * [[https://github.com/jdhitsolutions/ADReportingTools]]
 +
 +====== Solutions ======
 === run-mmc.bat === === run-mmc.bat ===
 Run AD domain tools from machines not joined to domain. Run AD domain tools from machines not joined to domain.
Line 8: Line 12:
 @rem Run this script as administrator. @rem Run this script as administrator.
 set /p USER="Username: " set /p USER="Username: "
-runas /netonly /user:contoso.com\%USER% "mmc C:\Users\Public\Desktop\contoso.com.msc /server=contoso.com.com"+runas /netonly /user:contoso.com\%USER% "mmc C:\Users\Public\Desktop\contoso.msc /server=contoso.com"
 pause pause
 </code> </code>
 +
 +----
 +
 +=== Get LastLogon to find stale user accounts ===
 +//Powershell// command for getting the LastLogon date-time for users on a specified domain controller.
 +<code powershell>
 +Get-ADUser -Credential $Credentials -Server pdc -Filter * -Properties * | Select-Object Name, @{N='LastLogon'; E={[DateTime]::FromFileTime($_.LastLogon)}}
 +</code>
 +
 +See theses solutions for handling multiple domain controllers, [[https://interworks.com/blog/trhymer/2014/01/22/powershell-get-last-logon-all-users-across-all-domain-controllers/|solution1]], [[https://stackoverflow.com/questions/41042336/lastlogon-from-all-domain-controllers-csv-output|solution2]].
  
  • active_directory.1642166691.txt.gz
  • Last modified: 2022/01/14 13:24
  • by mgupton