Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungLetzte ÜberarbeitungBeide Seiten der Revision | ||
pub:powershell [2015/10/07 08:09] – Marco Krage | pub:powershell [2017/03/30 19:56] – Marco Krage | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Powershell ====== | ====== Powershell ====== | ||
+ | |||
+ | Ausgabe aus mehreren Befehlen zusammen | ||
+ | <code powershell> | ||
+ | Get-VM | Get-NetworkAdapter | | ||
+ | Where-object {$_.Type -ne " | ||
+ | Select @{N=" | ||
+ | </ | ||
===== Windows Powershell ===== | ===== Windows Powershell ===== | ||
+ | ==== Remote Session ==== | ||
+ | Enter-PSSession -ComputerName $computerName -Credential adi@marien-kh.mkh | ||
- | ==== Gesperrte Benutzer ==== | + | $cred = Get-Credential adi@marien-kh.mkh |
- | <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 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 66: | Zeile 71: | ||
</ | </ | ||
- | ===== 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 '' |