Powershell

Find User Creation Date AD

Command to know when user ceated in AD

Get-ADUser username -Properties whenCreated | Select Name,whenCreated

Source

Get ADUser Creation Date

Get Last Logon User

#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)

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

How To Grep in PowerShell

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

Memo Commandes Powershell