Windows/powershell: Unterschied zwischen den Versionen
Aus SchnallIchNet
< Windows
Cbs (Diskussion | Beiträge) |
Cbs (Diskussion | Beiträge) |
||
Zeile 2: | Zeile 2: | ||
Snippets for powershell<br/> | Snippets for powershell<br/> | ||
Note that Exchange-related powershell commands should be listed [[Windows/exchange|here]]<br/> | Note that Exchange-related powershell commands should be listed [[Windows/exchange|here]]<br/> | ||
+ | |||
+ | == get loadable modules == | ||
+ | |||
+ | Get-Module -ListAvailable | ||
+ | |||
== Get Service names == | == Get Service names == |
Version vom 28. September 2015, 10:03 Uhr
Snippets for powershell
Note that Exchange-related powershell commands should be listed here
get loadable modules
Get-Module -ListAvailable
Get Service names
Get-Service | Where-Object {$_.displayName.StartsWith("watch")} | Select name
get list of services that start with watch* (case sensitive)
Get-Service | Where-Object {$_.displayName.StartsWith("watch")} | Start-Service Get-Service | Where-Object {$_.displayName.StartsWith("watch")} | Stop-Service Get-Service | Where-Object {$_.displayName.StartsWith("watch")} | Restart-Service
Filter Users
Get-ADUser -Filter * -Properties DisplayName, EmailAddress, Title -SearchBase 'OU=Fleetservices User,DC=fleetservices,DC=intra' \ -Server 'Fleetservices.intra'
or export result to CSV-File
Get-ADUser -Filter * -Properties DisplayName, EmailAddress, Title -SearchBase 'OU=HPI,DC=fleet,DC=int' \ -Server 'Fleet.int' | Export-CSV c:\temp\FleetInt.csv