Wednesday, January 23, 2008

Powershell - various subjects

Want to do something but don’t know the command? Help…
I need a do something with routing groups…
Help *routing*

Just bought a new company? Add their domain email address to all mailboxes
New-emailaddresspolicy –name whatever –recipientfilter {Company –Eq “Whatever”} –EnabledPrimarySMTPAddressTemplate “@whatever.com”

Want to check the event log event that are Exchange specific?
Get-eventlog application | where { $.Source –Ilike “*Exchange*” }

Standard or Enterprise?
Get-exchangeserver servername

Pipe smoking
Get-mailboxailboxes in the organisation
Get-mailboxes *nick* will return all mailboxes with “nick” in the name
Get-mailboxes nick* will return all mailboxes with “nick” at the start
Set-mailbox “Nick Gillott” –prohibitsendquota 1000 will set my mailbox quota to 1000 bytes
Set-mailbox “Nick Gillott” –prohibitsendquota 2GB will set my mailbox quota to 2GB (yes, GB works and so does MB)
Set-mailbox “Nick Gillott” –prohibitsendquota unlimited will set my mailbox quota to unlimited
Inflexible to type that for each user…so…
Get-mailboxes servername –Eq E2007.domainname.com | Set-mailbox –prohibitsendquota 6GB will set a 6GB mailbox send quota for all users on that server

Queues full following a problem?
Remove-Message –withndr $false will remove all messages in the queue

New meeting room Sir?
New-mailbox –name “Meeting Room 27” –upn meetingroom27@yourdomain.com –database “Your mailbox database” –ou “Your OU” –Room
Notice the last part says “-room” – this creates a different and new type of entry in AD.

Want to easily see the size of mailboxes within a store?
Use Exchange System Manager from an Exchange 2003 server. :-)

Oops, I forgot.
Get-mailbox – and then you forget what you are supposed to type. Just hit tab, just like Unix

In fact there is more Unix than you might think
Dir ~ gives a directory listing of your home directory

Did the backup work?
Get-mailboxserver –status | format-table name, lastfullbackup

No comments: