Flappy Shoot

Monday, March 29, 2010

How to find startup type of a service in Powershell.

Get-Service cmdlet does not have a property to find the startup type of a service. So we need to use Get-WMIObject.
(Get-WmiObject Win32_Service -filter "Name='W32Time'").StartMode

Reference: http://www.bhargavs.com/index.php/powershell/2009/06/powershell-get-service-startuptype/

Thursday, March 4, 2010

Exchange 2007 / 2010: Upgrading your default Email Address Policy and Address List

Error:"Unable to edit the specified E-mail address policy. E-mail address policies created with legacy versions of Exchange must be upgraded using the 'Set-EmailAddressPolicy' task, with the Exchange 2007 Recipient Filter specified."

Check for legacy filter "RecipientFilterType is "Legacy" " using the commandlet below

Get-EmailAddressPolicy | Format-List Name,*RecipientFilter*,ExchangeVersion

or

Get-EmailAddressPolicy | where { $_.RecipientFilterType -eq "Legacy" }

Upgrading the legacy EAP

Set-EmailAddressPolicy "Default Policy" -IncludedRecipients AllRecipients

Upgrading your Default Address Lists

Check for legacy filter "RecipientFilterType is "Legacy" " using the commandlet below

Get-AddressList | Format-List Name,*RecipientFilter*,ExchangeVersion

Get-GlobalAddressList | Format-List Name,*RecipientFilter*,ExchangeVersion

Upgrading the legacy AL

Set-AddressList "All Users" -IncludedRecipients MailboxUsers

Set-AddressList "All Groups" -IncludedRecipients MailGroups

Set-AddressList "All Contacts" -IncludedRecipients MailContacts

Set-AddressList "Public Folders" -RecipientFilter { RecipientType -eq 'PublicFolder' }

Set-GlobalAddressList "Default Global Address List" -RecipientFilter {(Alias -ne $null -and (ObjectClass -eq 'user' -or ObjectClass -eq 'contact' -or ObjectClass -eq 'msExchSystemMailbox' -or ObjectClass -eq 'msExchDynamicDistributionList' -or ObjectClass -eq 'group' -or ObjectClass -eq 'publicFolder'))}


Reference: http://msexchangeteam.com/archive/2007/01/11/432158.aspx