Powershell – output

If you have a problem with size of powershell command output take this

get-process | ft processname -autosize

or get-process | ft processname -autosize | out-file -width 1000 -filepath

 

next nice output feature is out-gridview

start powershell as administrator  and install feature

import-module servermanager

add-windowsfeature powershell-ISE

now you can run this output command

get-service | out-gridview

 

 

Rubriky: Powershell | Komentáře nejsou povolené u textu s názvem Powershell – output

MS Exchange 2010 Message tracking log – send, receive message

here is a realy good web site with useful commands

http://exchangeserverpro.com/exchange-2010-message-tracking-log-search-powershell

[PS] C:\Windows\system32>$start=(get-date).addDays(-1)

[PS] C:\Windows\system32>$end=(ged-date)example 1: Get-MessageTrackingLog -ResultSize Unlimited |

Group-Object -Property:EventId | Sort-Object Count -Desc | Select Name,Count

example 2:

Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited  -Start $start -End $end |

Where-Object {$_.EventID -eq „SEND“} | Where-Object { $_.Sender -like „*@*“ } | select TimeStamp, Sender, RecipientCount | Group-object Sender |select count, name

example3:

Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited  -Start $start -End $end |

Where-Object {$_.EventID -eq „SEND“-or $_.EventID -eq „DELIVER“ } | Where-Object { $_.Sender -like „*@*“ } |

select TimeStamp, Sender, RecipientCount | Group-object Sender |select count, name

Rubriky: Exchange Server / Exchange Online, Powershell | Komentáře nejsou povolené u textu s názvem MS Exchange 2010 Message tracking log – send, receive message

Number of mailboxes in specific databases – MS Exchange

[PS] C:\xxxxxx>Get-MailboxDatabase *sk* | Select-Object Name,status,@{Name=“Number of users“;Expression={(Get-Mailbox -Database $_.name).Count}}
Name                                    status                                                          Number of users
—-                                    ——                                                          —————
xxxDB1                                                                                                         258
xxxDB2                                                                                                          40
xxxDB3                                                                                                         242
Rubriky: Exchange Server / Exchange Online, Powershell | Komentáře nejsou povolené u textu s názvem Number of mailboxes in specific databases – MS Exchange

enable recycle bin Server 2008 r2

Enable-ADOptionalFeature –Identity ‘CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=mydomain,DC=local’ –Scope ForestOrConfigurationSet –Target ‘mydomain.local

you can use -whatif on the end of command and check up what will happen without risk

 

🙂

 

 

Rubriky: Active Directory | Komentáře nejsou povolené u textu s názvem enable recycle bin Server 2008 r2

Set certificate for MS Exchange services

get-ExchangeCertificate | fl

 

Enable-ExchangeCertificate -Thumbprint DCF0F9768C7451DBC69F5E42E432A251EF5FE349 -services SMTP, IIS, OWA, POP, IMAP

 

 

 

Rubriky: Exchange Server / Exchange Online | Komentáře nejsou povolené u textu s názvem Set certificate for MS Exchange services