Site Tools


informatique:windows:powershell

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatique:windows:powershell [2025/05/12 15:05] yahikoinformatique:windows:powershell [2025/08/12 13:20] (current) yahiko
Line 165: Line 165:
 </code> </code>
  
 +===== Lister les utilisateurs connectés en RDP =====
  
 +<code powershell>
 +Get-CimInstance -ClassName Win32_UserProfile | where {-not $_.Special} | select LocalPath, LastUseTime, @{ Name = 'DaysSinceLastUse'; Expression = { if ($_.LastUseTime) { ((Get-Date) - $_.LastUseTime).Days } } }
 +</code>
 +
 +Source : https://www.reddit.com/r/sysadmin/comments/150qoo6/whats_the_best_way_to_verify_the_last_logged_in/
 +
 +
 +===== Uptime =====
 +
 +<code powershell>
 +(get-date) – (gcim Win32_OperatingSystem).LastBootUpTime
 +</code>
informatique/windows/powershell.1747062326.txt.gz · Last modified: 2025/05/12 15:05 by yahiko