New PowerShell Scriptomatic

Labels: PowerShell, scripts, tip, utilities
Random musings of a senior IT systems consultant

Labels: PowerShell, scripts, tip, utilities
Yes, it is possible.
Labels: PowerShell, tip
By default, Exchange Server 2007 uses port 25 to send SMTP email using Send Connectors. On occasion you may be required to configure an Exchange Send Connector to use a different port - For example, TCP port 465 is commonly used for SMTP over SSL for secure SMTP communication using the SSL protocol. Configuring the port is not expoosed through the Exchange Management Console (EMC), it must be configured from the Exchange Management Shell (EMS).
Get-SendConnector
Set-SendConnector "Your SMTP Send Connector" -Port 465If you're using a Microsoft Edge server, you will need to configure this from any server that is not running the Edge role. You will also need to wait for an EdgeSync operation or force it manually:
Start-EdgeSynchronizationNo services need to be restarted for this change to go into effect.
Labels: Edge, Microsoft Exchange 2007, PowerShell
The Microsoft 2008 Scripting Games begin today! Labels: contests, PowerShell, scripts
It's always good to know who is using the technology we support. I have a customer who needed to know which users were utilizing Windows Mobile devices to access their Exchange servers.
Get-CASMailbox WHERE {$_.HasActiveSyncDevicePartnership} SELECT identityIn Exchange 2003, it's not quite that simple. The ActiveSync partnership is stored in a hidden folder within the user's Exchange mailbox. This folder can be exposed using mfcmapi (the Microsoft Exchange Server MAPI Editor).
Labels: Microsoft Exchange 2003, Microsoft Exchange 2007, PowerShell, scripts, Windows Mobile
This command will stop the MSExchangeSearch service, remove the entire search database and restart the MSExchangeSearch service. The MSExchangeSearch will immediately begin crawling the database(s) and rebuild the index(s). It took about 3 minutes on my 550MB database in a VM. You can use Perfmon to watch the Full Crawl Mode Status counter in the MSExchange Search Indices performance object to monitor when it's done. The counter value will be 1 while it's rebuilding, 0 when it's done.ResetSearchIndex -Force -All
ResetSearchIndex.ps1 [-force][ ] ...
ResetSearchIndex.ps1 [-force] -all
get-mailboxdatabaseResetSearchIndex.ps1 [-force]
Labels: Microsoft Exchange 2007, PowerShell, Search, tip
Sometimes administrators need access to another user's mailbox (for example, resource mailboxes). The PowerShell one-liner for this is:
Add-MailboxPermission SF-Conference -AccessRights FullAccess -user admin1234(where SF-Conference is the mailbox to assign rights to, and admin1234 is the user who gets the rights)
Get-Mailbox | Add-MailboxPermission -AccessRights FullAccess -user admin1234
Labels: Microsoft Exchange 2007, PowerShell
Customers with Exchange in a single domain usually ask how to change OWA so users can log in using just a username instead of domain\username. This was problematic in Exchange 2003 because of the DS2MB background process, but simple to do in Exchange 2007.
Or, even easier using PowerShell:
Set-OWAVirtualDirectory -Identity "owa (default web site)" -LogonFormat username -DefaultDomain companyabc.com
Then run IISRESET /NOFORCE to restart IIS and enforce the change.
Note that this will automatically change the logon page to display the new logon requirements.
Labels: Microsoft Exchange 2007, OWA 2007, PowerShell