This is a draft cheat sheet. It is a work in progress and is not finished yet.
Admin
Command |
Info |
Get-ADComputer |
Get-ADUser |
Disable-ADAccount |
Restart-Service -Name Spooler |
Get-CimInstance -ClassName Win32_PrintJoB |
Get-Printer |
Unlock-ADAccount |
Enter-PSSession |
Invoke-Command |
Get-WinEvent |
Add-ADGroupMember |
Find-Events -Report ADGroupMemberChanges -DatesRange Last3Days -Servers DC1 | Format-Table -AutoSize |
|
|
dotNET
[string]::IsNullOrEmpty(...) |
(Get-Content c:\temp\test.txt).replace('[MYID]', 'MyValue') | Set-Content c:\temp\test.txt |
Get-ChildItem -recurse | Select-String -pattern "dummy" | group path | select name |
ii . |
Open File Explorer in CWD |
Get-ChildItem -Path V:\Myfolder -Filter CopyForbuild.bat -Recurse -ErrorAction SilentlyContinue -Force |
Measure-Command {} |
Start-Process -Wait |
(Start-Job).WaitForExit() |
Start-Transcript |
Remove-Service |
Add-Type -Path “p/to/my.dll” |
|
|
|