Powershell
- Find User Creation Date AD
- Get Last Logon User
- How To 'Grep' in powershell
- Get computer serial number with powershell
- Memo Commandes Powershell
Find User Creation Date AD
Command to know when user ceated in AD
Get-ADUser username -Properties whenCreated | Select Name,whenCreated
Source
Get Last Logon User
How to Get Last Logon Date of an User with Powershell:
#store in Variable an object contains LastLogon User
$user = Get-ADUser $userName -Server $hostname | Get-ADObject -Properties lastLogon
#Store just LastLogon Value
$time=$user.LastLogon
#Display Date in proper format to read
[DateTime]::FromFileTime($time)
Link
→ Using Powershell To Get User Last Logon Date
How To 'Grep' in powershell
The rapid method:
get-process | findstr foo
The proper way:
Get-Process | Where-Object {$_ | Select-String "foo"}
Example, for display thunderbird process:
get-process | findstre "thunderbird"
Docs
Get computer serial number with powershell
To Get the motherboard Serial number via powershell, use the following command:
Get-WMIObject Win32_Bios | Select-Object SerialNumber
Source: Get Serial Number of a Remote Computer with PowerShell