Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| pub:powershell [2015/10/23 08:55] – Marco Krage | pub:powershell [2019/05/18 11:49] (aktuell) – Marco Krage | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Powershell ====== | ====== Powershell ====== | ||
| + | |||
| + | Display Powershell Version | ||
| + | $PSVersionTable.PSVersion | ||
| + | If the variable does not exist, it is safe to assume the engine is version 1.0. | ||
| Ausgabe aus mehreren Befehlen zusammen | Ausgabe aus mehreren Befehlen zusammen | ||
| Zeile 7: | Zeile 11: | ||
| Select @{N=" | Select @{N=" | ||
| </ | </ | ||
| + | |||
| ===== Windows Powershell ===== | ===== Windows Powershell ===== | ||
| + | ==== Remote Session ==== | ||
| + | Enter-PSSession -ComputerName $computerName -Credential user@domain.local | ||
| - | ==== Gesperrte Benutzer ==== | + | $cred = Get-Credential user@domain.local |
| - | <code powershell> | + | |
| - | Import-Module activedirectory | + | |
| - | Search-ADAccount –LockedOut | + | ==== Get Registry Value ==== |
| + | Get-ItemPropertyValue " | ||
| - | Search-ADAccount | + | ==== Log Date ==== |
| - | </ | + | Write-Host (get-date).DateTime |
| - | <code powershell> | + | ==== Delete RAW if no matching JPG exists ==== |
| - | Alter Computer Konten finden | + | |
| - | $then = (Get-Date).AddDays(-60) # The 60 is the number of days from today since the last logon. | + | |
| - | Get-ADComputer -Property Name, | ||
| - | Set-ADComputer -Enabled $false | ||
| - | </ | ||
| ==== Drucker Migration ==== | ==== Drucker Migration ==== | ||
| Zeile 72: | Zeile 75: | ||
| </ | </ | ||
| - | ===== Exchange | + | ===== Active Directory ===== |
| + | |||
| + | ==== Gesperrte Benutzer ==== | ||
| + | <code powershell> | ||
| + | Import-Module activedirectory | ||
| + | |||
| + | Search-ADAccount –LockedOut | ||
| + | |||
| + | Search-ADAccount -LockedOut | Unlock-ADAccount | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Alte Computerkonten finden ==== | ||
| + | <code powershell> | ||
| + | $then = (Get-Date).AddDays(-60) # The 60 is the number of days from today since the last logon. | ||
| + | |||
| + | Get-ADComputer -Property Name, | ||
| + | |||
| + | Set-ADComputer -Enabled $false | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Exchange ===== | ||
| Die Powershell und auch die Exchange-Verwaltungsshell nutzen s.g. Cmdlets. Diese setzt sich aus einem Verb und einem Hauptwort zusammen. Zum Beispiel '' | Die Powershell und auch die Exchange-Verwaltungsshell nutzen s.g. Cmdlets. Diese setzt sich aus einem Verb und einem Hauptwort zusammen. Zum Beispiel '' | ||