Wednesday, 2 July 2008

Monitoring Without System Center Operations Manager

http://technet.microsoft.com/en-us/library/bb201720(EXCHG.80).aspx

How to generate HTML reports with the Exchange Management Shell (EMS)

Get-MailboxStatistics | Select DisplayName, ItemCount | Sort ItemCount | ConvertTo-HTML –Property DisplayName, ItemCount >C:\report.htm

How to increas size of Signature in OWA

You can create the key as a DWORD. The default decimal value is 4096 (4KB) and the max is 16672 (16KB).
It must go on the back-end server.
This will set it to the maximum value of 16KB:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeWeb\OWA]
"SignatureMaxLength"=dword:00004120

Sunday, 30 March 2008

Top 10 Exchange administration tasks using Power Shell

# Mailbox User
# input password such as: "Mypassword=01"
$pass = new-SecureString new-Mailbox -alias "testmailboxuser" -name MailboxUser -password $pass -database db1 -org users

# Conference Room Mailbox
New-Mailbox -alias testconfmbx -name ConfMailbox -database db1 -org users -resourceType Room

# Equipment Mailbox
New-Mailbox -alias testequpmbx -name EquipMailbox -database db1 -org users -resourceType Equipment

# Mail Enabled Universal Distribution Group
new-distributiongroup -alias testdisgroup -name MailEnabledUniversalDistributionGroup -type distribution -org users

# Mail Enabled Universal Security Group
new-distributiongroup -alias testsecgroup -name MailEnabledUniversalSecurityGroup -type security -org users # Mail Enabled Dynamic Distribution Groupnew-DynamicDistributionGroup -alias testddl -name QuerybasedDistributionGroup -recipientfilter {Company -eq "foo"} -org users

# Mail Enabled Contact
new-mailcontact -alias testcontact -name MailEnabledContact -ExternalEmailAddress contact@foo.com -org users

# Shared Mailbox
new-Mailbox -alias testsharedmbx -name SharedMailbox -database db1 -org users -shared

# Linked Mailbox
New-Mailbox -alias testlinkmbx -name LinkedMailbox -database db1 -org users -LinkedMasterAccount account@foo.com -LinkedDomainController

Adds a disclaimer to all message sent from the mailbox Brettjo@fabrikam.com
$ConditionArray = Get-TransportRulePredicate $Condition = @($ConditionArray[0])
$Condition[0].addresses = get-mailbox Brettjo@fabrikam.com
$ActionArray = Get-TransportRuleAction
$Action = @($ActionArray[14])
$Action[0].Text = "Test disclaim message for one liner"
New-TransportRule "newrule" -Conditions $condition -Actions $action

Gives the user account Brettjo the right to create items in the public folder Finance Public Folder.
Add-PublicFolderPermission "Finance Public Folder" -User Brettjo -AccessRights "CreateItems"
Checks the mount status for all mailbox databases.

Get-MailboxDatabase -status fl Name,Mounted

Disables the Out of Office feature for external email.

get-MailboxDatabase "Finance Mailbox Database" set-mailbox -ExternalOOF InternalOnly


With thanks to Brettjo for his help

Thursday, 13 March 2008

Exchange 2007 Powershell Export - Import PST Files

Export/Import to PST Requirements

In order to export or import mailboxes to PST files the following requirements must be met:

1) Export/Import to PST must be run from a 32 bit client machine with Exchange Management Tools installed (Version Exchange 2007 SP1 or later). The 32bit requirement comes from a dependency with the Outlook client.
2) Either Outlook 2003 or Outlook 2007 must be installed on the client machine.
3) The user running the task must be an Exchange Organization Admin or an Exchange Server Admin on the server where the mailbox to export/import lives.



Export a mailbox to a PST File
Export-Mailbox -Identity ALIAS -PSTFolderpath C:\

This will export a PST file to the path specified and name that pst as the alias

Import is much the same
Import-Mailbox -Identity ALIAS -PSTFolderpath C:\




To export all mailboxes to pst files the following commands are used
Get-Mailbox -Database MYDB Export-Mailbox -PSTFolderPath D:\PSTs


Mailboxes can also be exported to PST files via a scheduled task.

Running a scheduled task is a two step process:
1) Create the powershell script and save it as a .ps1 file.
get-mailbox export-mailbox -PSTFolderPath C:\ -Confirm:$false
1b) OR
get-mailbox -server exchangemail -resultsize unlimited export-mailbox -pstfolderpath Z:\ -baditemlimit 1000 -maxthreads 15 -confirm:$false

2) Create the scheduled task to run powershell and load the exchange snappin; then run your script. The action of your scheduled task should look like:
powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1" -Command ". 'C:\script.ps1'"

A common Exchange Administrator task for might also be the extraction into a PST from a mailbox that is a Recovery Storage Group (RSG) for legal or compliance.
Exporting content directly from a RSG database to a PST file is not supported. To accomplish this task you'd have to first restore the mailbox content to an online mailbox using restore-mailbox and then export the online mailbox to a PST.
You could for example create a new mailbox to hold the recovered content and only grant access to it to the legal department; then export its contents to a PST file. To restore an RSG mailbox to a "different" mailbox you only need to use two additional parameters:

Restore-Mailbox -Identity legalDepartmentMailbox -RSGDatabase "Recovery Storage Group\My Database" -RSGMailbox mailboxToRecover -TargetFolder "Recovered Content"

Exchange 2007 Powershell Disconnected Mailbox

Remove Disconnected Mailboxes in Exchange 2007

List all Disconnected Mailboxes
Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid


Remove single mailbox
Remove-Mailbox -Database -StoreMailboxIdentity -confirm:$false

Remove all at the same time
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid




Remove from all databases:

$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid,Database

$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

Tuesday, 11 March 2008

Lately I've been measuring......

Seems my time is growing thin...........

Wind me up and watch me spin. Watch me spin..................
I'm just skin and bones

Sunday, 10 February 2008

Mount Windows share on Linux

Before I forget (Again)
This is how I mount my windows servers on my linux box......

Click below to see the proper command due to formatting issue with blogger....

mount -t cifs /// /mnt/Shared -o username=/,password=







Tuesday, 5 February 2008

No substitute for a backup

Soooo... where do I begin..
Backup drive fails so order a shiny new Dell Powervault tl4000 48 slot LTO3 SCSI and a TL 2000 24 Slot LTO3 Fibre Channel Library......
In the Interim use NT Backups to store .bkf backups to secondary Promise VTRAK array and backoff to disk when new drive arrives.....

Meanwhile secondary Vtrak throws a disk ok so force online after full backup to Primary array...

Secondary Array reboots and somehow the SCSI card decides the Primary array on the same SCSI card but different array (you with me?) resets and reboots, taking windows with it.... Windows boots up and decides it needs to run chkdsk ...... 12 hours later and the data is there but all corrupt, including all backups... ummmmmmm

Restore from the last good backup tape and spend the next weeks repairing files.


Well thats got to be the worst luck i have ever had, so now its time to place a bet on the lotto hell knows i'm due some luck after all that...

And the moral to the story, your only as good as your last backup, and theres no substitute!

Wednesday, 23 January 2008

Penguin VS M$






Well having just setup Fedora 8 as a Mail relay, Web Filter and Samba Server, I now want to use this box as the middle man to share files between my M$ and Mac clients using the sambs winbind options...

I'll be updating this post as I go along, and plan to write my first how - to on this later, which will include a full step by step guide to setting up Fedora 8 for this purpose

Tuesday, 22 January 2008

First Light

Well i thought it was about time i had a blog, more of a brain dump than anything with a few geeky ramblings thrown in!

over the weeks i will be blogging my technical acievements and stumblings so i have a record for when i need to accomplish the same thing again, and hopefully help some other people along the way who might be stumbling upon the same problems.

So stay tuned for a bumpy ride and some bizaar ramblings!