Monday, November 11, 2013

One Liner Useful Random Collection of snippets # 1

 

Below are collection of one Liner snippets you can copy and paste them into EMS and use it for your needs. Please make sure you understand the power of using Pipe ( | ) and Set commands  in PS.

### List Mailbox Databases

Get-MailboxDatabase

image

###Locate DB which has the string  the *22*  ( locate a specific DB )

Get-mailboxdatabase  *22*

###Enabling CL on the Specific DB

Get-MailboxDatabase db01elt | Set-MailboxDatabase -CircularloggingEnabled:$true

###Disabling CL on the Specific DB

Get-MailboxDatabase db01elt | Set-MailboxDatabase -CircularloggingEnabled:$False

### After CL is Enable in order CL to work you need to Dismount and Mount the database

This snippet will dismount DB01elt and it will NOT ask confirmation

###Enabling CL on the ALL Databases

Get-MailboxDatabase | Set-MailboxDatabase -CircularloggingEnabled:$true

###Disabling CL on the ALL Databases

Get-MailboxDatabase | Set-MailboxDatabase -CircularloggingEnabled:$false

### Dismount all Databases

Get-MailboxDatabase | Dismount-Database -Confirm:$false

### Mount all Databases

Get-MailboxDatabase | Mount-Database -Confirm:$false

### Dismount Specific Database

Get-MailboxDatabase db01elt | Dismount-Database -Confirm:$False

### Mount Specific Database

Get-MailboxDatabase db01elt | Mount-Database -Confirm:$False

### CL Enabled

Get Databases CL is enabled

Get-MailboxDatabase | where {$_.CircularLoggingEnabled -eq $true}

image

### CL is NOT Enabled

Get Databases CL is NOT enabled

Get-MailboxDatabase | where {$_.CircularLoggingEnabled -eq $False}

 

image

More to come……….

Oz Casey, Dedeal

( Exchange Server North America MVP)

MCITP (EMA), MCITP (SA)
MCSE 2003, M+, S+, MCDST
Security+, Project +, Server +
http://smtp25.blogspot.com/ (Blog)
http://telnet25.wordpress.com/ (Blog)

1 comment:

Unknown said...

I have read you post ,One Liner Useful Random Collection of snippets, I cant understand why so many commentators are out of topic.
Big and Tall Chair