Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | Nächste ÜberarbeitungBeide Seiten der Revision | ||
pub:powershell [2015/10/23 08:55] – Marco Krage | pub:powershell [2017/03/29 09:48] – Marco Krage | ||
---|---|---|---|
Zeile 8: | Zeile 8: | ||
</ | </ | ||
- | ===== Windows Powershell ===== | ||
- | ==== Gesperrte Benutzer ==== | ||
- | <code powershell> | ||
- | Import-Module activedirectory | ||
- | Search-ADAccount –LockedOut | ||
- | Search-ADAccount | + | ===== Windows Powershell ===== |
- | </ | + | ==== Remote Session ==== |
+ | Enter-PSSession | ||
- | <code powershell> | + | |
- | Alter Computer Konten finden | + | Enter-PSSession -ComputerName $computerName -Credential $cred |
- | $then = (Get-Date).AddDays(-60) # The 60 is the number of days from today since the last logon. | + | |
- | Get-ADComputer | + | ==== Get Registry Value ==== |
+ | | ||
+ | |||
+ | ==== Log Date ==== | ||
+ | Write-Host (get-date).DateTime | ||
- | Set-ADComputer -Enabled $false | ||
- | </ | ||
==== Drucker Migration ==== | ==== Drucker Migration ==== | ||
Zeile 72: | Zeile 69: | ||
</ | </ | ||
- | ===== 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 '' |