windows:pstriks
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| windows:pstriks [2012/12/11 08:30] – [Finn brukernavnet til en SID] 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 6: | Line 13: | ||
| $objUser = $objSID.Translate( [System.Security.Principal.NTAccount] ) | $objUser = $objSID.Translate( [System.Security.Principal.NTAccount] ) | ||
| $objUser.Value | $objUser.Value | ||
| + | </ | ||
| + | |||
| + | ==== Tail ekvivalent ==== | ||
| + | **Follow** | ||
| + | <code powershell> | ||
| + | Get-Content -Patch "< | ||
| + | </ | ||
| + | |||
| + | **Standard tail, print 10 siste** | ||
| + | <code powershell> | ||
| + | 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.1355211024.txt.gz · Last modified: (external edit)
