powershell
This is an old revision of the document!
Table of Contents
Useful Powershell Commands
Get Systemboot/Reboot/Shutdown Events
Get-EventLog System -Newest 10000 | ` Where EventId -in 41,1074,1076,6005,6006,6008,6009,6013 | ` Format-Table TimeGenerated,EventId,UserName,Message -AutoSize -wrap
Ping with Timestamps
$target = "www.google.com" ping -t $target | ForEach {"{0} - {1}" -f (Get-Date),$_}
Useful Commandlets
Format-Hex $filename
ActiveDirectory Commandlets
Groups / GroupMembers
$file="C:\Temp\GroupCount.csv" Get-ADGroup -Filter * -Properties Member | Select-Object Name,@{n="MemberCount";e={$_.Member.Count}} | Export-Csv -Path $file -Delimiter '|'
powershell.1668101636.txt.gz · Last modified: 2022/11/10 18:33 by baumi