windows:pstriks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
windows:pstriks [2013/04/30 10:06] – larserik | windows:pstriks [2018/10/20 23:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Powershelltriks ====== | ====== Powershelltriks ====== | ||
+ | |||
+ | ==== Alle nøstede gruppemedlemskaper til en bruker ==== | ||
+ | <code powershell> | ||
+ | $username = ' | ||
+ | $dn = (Get-ADUser $username).DistinguishedName | ||
+ | Get-ADGroup -LDAPFilter (" | ||
+ | </ | ||
==== Finn brukernavnet til en SID ==== | ==== Finn brukernavnet til en SID ==== | ||
Line 9: | Line 16: | ||
==== Tail ekvivalent ==== | ==== Tail ekvivalent ==== | ||
- | *Follow* | + | **Follow** |
<code powershell> | <code powershell> | ||
Get-Content -Patch "< | Get-Content -Patch "< | ||
</ | </ | ||
- | *Standard tail, print 10 siste* | + | **Standard tail, print 10 siste** |
<code powershell> | <code powershell> | ||
Get-Content <fil> | Select-Object -Last < | Get-Content <fil> | Select-Object -Last < | ||
+ | </ | ||
+ | |||
+ | ==== Finn og drep prosesser ==== | ||
+ | <code powershell> | ||
+ | gps < | ||
+ | Get-Process -Name < | ||
+ | </ | ||
+ | |||
+ | ==== Kjør kommandoer på en remote server ==== | ||
+ | <code powershell> | ||
+ | Invoke-Command -ComputerName < | ||
+ | </ | ||
+ | |||
+ | ==== Rename mengder av filer ==== | ||
+ | <code powershell> | ||
+ | Get-ChildItem *.jpg | % { Rename-Item $_ $_.Name.Replace(" | ||
</ | </ |
windows/pstriks.1367309182.txt.gz · Last modified: (external edit)