Tags

Howto (51) Free Software (35) Powershell (33) Windows Server (23) AD (16) Hyper-V (16) Exchange (13) Office (13) Group Policy (10) Windows Server 2012 (9) Scripts (7) Symantec BE (5) Windows 8 (5) Cisco (4) TMG (4) Terminal Server (4) Cluster (3) HP (3) RDS (3) UAG (3) Citrix (2) DC (2) DNS (2) IE10 (2) OpenID (2) PKI (2) SCVMM (2) Windows Live (2) iLO (2) Backup (1) DPM (1) Fileserver (1) IE (1) SQL; DPM (1) Security (1) Sharepoint (1) Switch (1) VMWare (1) Veeam (1)
Posts tonen met het label Exchange. Alle posts tonen
Posts tonen met het label Exchange. Alle posts tonen

maandag 30 september 2013

Installatie Exchange 2010 SP3 in hybrid omgeving

In het kort de volgende stappen uitgevoerd op de Exchange servers uitgevoerd:
  • SP3 geinstalleerd op Mailbox server
  • SP3 geinstalleerd op CAS/HUB
  • SP3 geinstalleerd op EDGE
  • OWA web.config files nagelopen op wijzigingen
  • IIS Default Web Site aangepast (SSL / redirection)
  • Casredirect.aspx aangepast ivm Hybrid omgeving url
 
Voor de OWA op de “Default Web Site” redirection aangezet en require SSL uitgevinkt, dir zodat “http://fqdn” redirect wordt naar “https://fqdn/owa”
 
Omdat de redirection doorgegeven wordt naar de onderliggende Virtual Directories, deze daar weer uit moeten zetten met:
 
C:\Windows\System32\inetsrv>
appcmd set config "Default Web Site/autodiscover" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/ecp" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/ews" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/owa" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/oab" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/powershell" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/rpc" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/rpcwithcert" /section:httpredirect /enabled:false -commit:apphost
appcmd set config "Default Web Site/Microsoft-Server-ActiveSync" /section:httpredirect /enabled:false -commit:apphost
 
Dit geeft het volgende resultaat:
 
 
Meer info:
 
 
 
Office365 hybrid omgeving tuning:
 
Ivm onze hybrid Exchange omgeving zijn de volgende regels toegevoegd aan bestand “C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Owa\casredirect.aspx”:
 
<%
if (RedirectionUrl.Contains("https://outlook.com/owa")) {
Response.Redirect(RedirectionUrl);
Response.End();
}
%>
 
Dit zodat alle gebruikers dezelfde url kunnen gebruiken en geredirect worden naar outlook.com indien nodig.
 
 

woensdag 4 september 2013

Exchange Distribution Group Warning: "the object must be upgraded to the current Exchange version"

When you make a change to an Exchange Distribution Group and you get a Warning message like: "the object must be upgraded to the current Exchange version", you can click yes to upgrade.
But having hundreds of those groups you might want to upgrade de Exchangeversion of a Distribution Group through Powershell.
 
Warning:
 
 
 
To get an overview of the Distribution Groups with their version:
 
Get-DistributionGroup | sort exchangeversion | ft name,exchangeversion –a
 
To upgrade from a particular version to the current version:
 
Get-DistributionGroup | where {$_.Exchangeversion -like "0.1 *"} | Set-DistributionGroup
 
 

vrijdag 22 februari 2013

Exporteer Exchange Messagelog naar CSV

Met de Tracking Log Explorer van Exchange kun je de mail log bekijken, je hebt echter vanuit de GUI niet de mogelijkheid om het resultaat naar een CSV te exporteren.
Met Powershell heb je wel die mogelijkheid.
 
 
Powershell:
 
Get-MessageTrackingLog -Sender "mailer@domein.nl" -Server "EXCH1" -EventID "SEND" -Start "2/22/2013 8:00:00 AM" -End "2/22/2013 9:00:00 AM" | Select Timestamp,Sender,@{Name='Recipients';Expression={[string]::join(";", ($_.Recipients))}},MessageSubject | export-csv c:\temp\export-mail.csv –NoTypeInformation
 
 

dinsdag 31 juli 2012

Verwijderde items herstellen in Outlook

Afhankelijk van de Exchange server instellingen kun je items die je in Outlook hebt verwijderd toch terughalen:

How To Recover Deleted Items In Outlook Client Or Outlook Web Access

When you delete items (e-mail messages, contacts, calendar, tasks, etc.) from your mailbox, they are first transferred to the Deleted Items folder of that mailbox.
You can also remove items from the Deleted Items folder either manually or automatically.
  • In Outlook, automatic deletion is set in the Empty the Deleted Items folder upon exiting option in Tools > Options > Other > General.
    • Outlook 2010: File > Options > Advanced

  • In OWA, automatic deletion is set in the Empty the Deleted Items folder on logoff option in Options > Delete Items.
    • OWA 2010: Options > Settings > Mail
After an item has been removed from the Deleted Items folder, it can still be recovered if the Exchange Server has been configured to retain deleted items. This provides a measure of protection in case of accidental deletion. By default, permanently deleted items will be held on the server for 14 days on Exchange 2007/2010 accounts and for 7 days on Exchange 2003 accounts. If you own a Dedicated Exchange account, you can change this setting by changing the value for the Keep deleted items for (days) option in HostPilot® Control Panel on the MS Exchange Server > Mailboxes > Storage Management page.
During this retention period, you can either restore or purge deleted items in Outlook or OWA.

Outlook 2010:
  • To restore or purge items deleted from a folder that contains mail items, including the Deleted Items folder, select the folder, then choose the Folder tab on the Ribbon and click Recover Deleted Items.


    Select the items and click either Recover or Purge icons.

  • When you are viewing a non-mail item folder (Calendar, Contacts, etc.), the Recover Deleted Items icon is no longer available. Follow these steps to enable it:
    1. Click the File tab on the Ribbon, then click the Options button.
    2. Select Customize Ribbon in the left pane of the Outlook Options window.
    3. On the right-hand side, in the Customize the Ribbon list, select the Folder main tab.
    4. Click the New Group button. You can rename it after it is created.

    5. Make sure that the newly created group is selected. In Choose commands from, select All Commands.
    6. Scroll down and select the Recover Deleted Items option, then click the Add >> button to add this option to your newly created custom group.

    7. Click OK in the Outlook Options window.

    8. You will now see your new group and the Recover Deleted Items icon in the Folder tab on all folders. If you click the button, you will see that you have access to any purged/shift-deleted items from that folder. 

dinsdag 15 mei 2012

Handige Powershell scripts voor Exchange

Voor een overzicht van de database omvang en de vrije ruimte daarin:

Get-MailboxDatabase -Status | ft Identity,DatabaseSize,AvailableNewMailboxSpace -auto

Voor een overzicht van mailboxen groter dan 1000MB:

Get-MailboxStatistics -Server mailserver | where {$_.TotalItemSize -gt 1000MB} | sort -Descending TotalItemSize | ft Displayname,ItemCount,TotalItemSize,Database -auto

vrijdag 17 februari 2012

Exporteren van een Mailbox naar een PST bestand

Om een mailbox te kunnen exporteren naar een PST bestand dien je rechten te hebben op de Exchange Role “Mailbox Import Export”.

Ik zie dat onderstaande rechten hebben om een Mailbox te importeren of te exporteren (van/naar PST).


Het is echter beter om een groep deze rechten te geven ipv individuele gebruikers.

De onderste RoleGroup “Import Export Mailbox Admins” heb ik zelf via de ECP (Exchange Control Panel) (https://mail.domein.nl/ecp) aangemaakt.
Je kunt deze natuurlijk ook via Powershell aanmaken dmv commando:

New-ManagementRoleAssignment -Name "Import Export Mailbox Admins" -SecurityGroup "Exchange Mailbox Import Export" -Role "Mailbox Import Export"



Onderstaand het commando om de individuele gebruikers de rechten op deze role te ontnemen:




Het exporteren van een mailbox naar een PST bestand:





woensdag 4 januari 2012

Office365 MoveRequests opschonen

Om een mailbox na een (mislukte) move actie opnieuw te moven, moet je eerst de Move Request eerst verwijderen.
Je kunt dit doen via de GUI of via Powershell:



Het Powershell commando om alle mislukte moveacties te verwijderen is:

Get-MoveRequest -MoveStatus Failed | Remove-MoveRequest

donderdag 15 december 2011

Verplaats Mailbox van Exchange lokaal naar Office365

Verbinding maken met de Remote Powershell

Connect Windows PowerShell to the Cloud-based service

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection

Import-PSSession $Session


Disconnect Windows PowerShell from the Cloud-based service

Als je klaar bent met de acties in de Remote Powershell kun je de sessie met het volgende commando beëindigen

Remove-PSSession $Session

Important If you close the Windows PowerShell window without disconnecting from the server-side session, your connection will remain open for 15 minutes. Your account can only have three connections to the server-side session at one time.


Plaats lokale credentials in een variabele

$RemoteCredential = Get-Credential

Verplaats de mailbox naar de cloud

New-MoveRequest -Identity "gebruiker@domein.nl" -Remote -RemoteHostName 'mail.domein.nl' -RemoteCredential $RemoteCredential -TargetDeliveryDomain 'service.domein.nl'

De status van de move actie kun je bekijken met:

Get-MoveRequest

Om meerdere mailboxen te verplaatsen kun je gebruik maken van onderstaand script:

Import-CSV movemb1.txt | ForEach {New-MoveRequest -Identity $_.UserPrincipalName -Remote -RemoteHostName 'mail.domein.nl' -RemoteCredential $RemoteCredential -TargetDeliveryDomain 'service.domein.nl'}

In het bestand movemb1.txt staan de identities. De eerste regel in het bestand is “UserPrincipalName”

ß snippet à

UserPrincipalName
gebruikera@domein.nl
gebruikerb@domein.nl
gebruikerc@domein.nl
gebruikerd@domein.nl
gebruikerd@domein.nl
etc..

ß snippet à

De status van de move actie kun je bekijken met:

Get-MoveRequest –MoveStatus InProgress

Om Requests te verwijderen kun je onderstaand gebruiken:

Remove-MoveRequest

dinsdag 13 december 2011

Aanmaken van een groot aantal mailboxen voor bestaande AD gebruikers

Export maken alle gebruikers in een bepaalde OU die nog geen mailbox hebben
Eerst een export gemaakt van alle gebruikers in de OU PMedewerkers die nog geen mailaccount ($_.mail –eq $null) hebben:

Get-ADUser -Filter * -Properties * -SearchBase "OU=PMedewerkers,OU=Bedrijf,DC=domein,DC=local" | where {$_.mail -eq $null} | ft UserPrincipalName -auto | Out-File c:\temp\pm_no_mail.txt

Bewerken van het export bestand
Hieronder een snippet van de export:

UserPrincipalName                  
-----------------                  

l.ascder@domein.local 
a.fefsen@domein.local  
m.vblmen@domein.local       

Alle spaties en de stippellijn uit bovenstaande export halen.

TEST:
Weergeven van de gebruikers in het bewerkte export bestand mbv loopscript

Import-CSV pm_no_mail.txt | ForEach {Write-host $_.UserPrincipalName}

Aanmaken van de mailboxen voor de gebruikers
Als de test er goed uit ziet voer je onderstaand commando uit om de mailboxen aan te maken:

Import-CSV pm_no_mail.txt | ForEach {Enable-Mailbox -Identity $_.UserPrincipalName –Database “Mailbox DB1”}

Extra info:
De gebruikersaccounts dienen wel enabled te zijn anders kun je geen mailbox aanmaken.

dinsdag 11 oktober 2011

Generate Exchange Environment Reports using Powershell

Wat een groot gemis was met de komst van Exchange 2007 was het feit dat je in de GUI niet meer te zien kreeg hoe groot een bepaalde mailbox was. Om dat toch te kunnen monitoren heb ik een batchfile geschreven die gescheduled stond en die vervolgens  een bepaald powershell script uitvoerde.

Het is niet geweldig gedocumenteerd maar hier de batch en het powershell script:

@echo off
h:
cd\
cd psscripts
ren mailboxinfo.html mailboxinfo1.html
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'h:\psscripts\mailboxreport.ps1'"
exit
start iexplore "h:\psscripts\mailboxinfo.html"
exit



# S.Salfischberger 09-03-2009
# Hiermee genereer je een rapport per Exchange database

# in HTML formaat van de mailboxen groter dan 200MB en
# dat wordt dan verstuurd naar het aangegeven email adres.

function OutputHTML
{
param([string]$Naam, [string]$Database)
$BodyStyle = Get-Content -Path "$Locatie\salfischbergerit.css"
$BodyStyle = ""
$BodyStyle += "$Naam Mailbox Report"
#$BodyStyle = $BodyStyle + ""

$MBXOutput = Get-MailboxStatistics -Database "$MailServer\$Database" |where {$_.TotalItemSize –gt 200MB} | sort TotalItemSize -descending | ConvertTo-HTML DisplayName,ItemCount,@{label="Mailbox grootte (MB)";expression={$_.TotalItemSize.Value.ToMB()}} -Title "Mailbox Overview" -Head $BodyStyle$MBXOutput = $MBXOutput -replace "","
$Naam mailbox rapportage $($now) "
$MBXOutput = $MBXOutput -replace "","Weergave: mailboxen > 200MB"
$MBXOutput | Out-File $Locatie\MBReportDB_$Naam.html

$global:att += new-object Net.Mail.Attachment("$Locatie\MBReportDB_$Naam.html")
$msg.Attachments.Add($global:att[$global:att.length - 1])
}


$Now=Get-Date
$global:att = @()

$msg = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($MailServer)
$msg.Body = "..."


####### AANPASBAAR #######
$MailServer = "EX01"
$msg.From = s.salfischberger@.nl
$msg.To.Add(
s.salfischberger@.nl)
$msg.Subject = "Mailbox Report"

$Locatie = "H:\PSScripts"
OutputHTML "Spam" "Spam Database"
OutputHTML "Mailbox1" "Mailbox1 Database"
OutputHTML "Mailbox2" "Mailbox2 Database"

####### AANPASBAAR #######

$smtp.Send($msg)
for($x = 0; $x -lt $global:att.length; $x++) {
 $global:att[$x].Dispose()

}



Met de komst van Exchange 2010 kwam ik erachter dat bovenstaand script niet meer werkt. Met een paar kleine aanpassingen kun je het echter zo weer werkend krijgen.

Ik heb ondertussen ook een prachtig ander script gevonden dat een overzicht geeft van je Exchange omgeving:





Zie onderstaand blog:

http://www.stevieg.org/2011/06/exchange-environment-report/

maandag 10 oktober 2011

Windows Phone vraagt vaak om je credentials voor syncen met Exchange



Het kan voorkomen dat een windows phone vaak prompt om je username/password om te syncen met Exchange, hieronder wordt uitgelegd wat het probleem is:


Open up Forefront TMG Management, Click on “Firewall Policy” in the tree in the left-hand pane and then find your OWA / Activesync rule.

Double-click on your OWA / Activesync Publishing Rule, then click on the Listener Tab, then the Properties Button for the Listener, then click on the Forms Tab, then the Advanced button on the Forms Tab and you will see a Check box call “Apply Session Timeout to Non-Browser Clients”.

Untick this check box, click on OK 3 times, Apply the rule changes and then the Password Prompt on your Windows Mobile phone should have stopped and syncing will resume normally.

As Activesync needs to keep a connection open with the Exchange server, with this setting selected, the connection is dropped and thus the phone thinks it needs to re-authenticate with the server. With the setting not selected, then phone is allowed to keep a connection open with the Exchange server and thus the password prompt doesn’t pop up.

Bron:
http://alanhardisty.wordpress.com/2010/11/05/forefront-threat-management-gateway-and-activesync-password-prompt-issues-on-windows-phones/

maandag 3 oktober 2011

Eventid 67 op UAG

Op de UAG van een klant hadden we een hoop events met event ID 67.
Dit schijnt te komen door een verkeerde UAG rule.
Event op UAG:



Op de MX01 staat het bestand owasl.xap (en niet owasi.xap):


owasi.xap moet worden gewijzigd naar owasl.xap



Zie laatste post van Christopher Comarato (2-8-2011):

http://social.technet.microsoft.com/Forums/en-US/forefrontedgeiag/thread/9074b01d-26e3-4b12-81d2-ec3bc3d0542a/

The reason this event is still being logged is because both the KB article (http://support.microsoft.com/kb/2444842) as well as the update that fixes this in UAG both contain the same error with regards to ExchangePub2010_Rule42.

Both modify the URL set with a new ExchangePub2010_Rule42 that includes the following URL:
/owa(/[a-z0-9._-]+@[a-z0-9.-]+)?/[0-9.]+/clientbin/owasi.xap This is incorrect!

When you look at the file in mixed case it looks like this might be the file name; however, the actual file on the CAS server is OWASL.xap, not OWASI.xap.

To resolve this error you should change this rule in the UAG rule set to use the following URL: /owa(/[a-z0-9._-]+@[a-z0-9.-]+)?/[0-9.]+/clientbin/owasl.xap I would recommend that Microsoft fix this in a future update to UAG.

vrijdag 30 september 2011

Powershell stappen om EAP voor alle gebruikers aan te zetten

De volgende stappen uitgevoerd om EAP voor alle gebruikers aan te zetten.

Stap 1:
Als eerste de setting in powershell getest op één gebruiker (testcitrix).
Daarvoor had ik eerst de identity van de mailbox nodig:

[PS] C:\psscripts>Get-MailboxStatistics -identity testcitrix | FT Identity

Identity
--------
66baa611-e107-4679-b3bd-ab2e3259cd9e

Stap 2:
Vervolgens identity gebruikt om de huidige setting te bekijken:

[PS] C:\psscripts>Get-Mailbox 66baa611-e107-4679-b3bd-ab2e3259cd9e | FT EmailAddressPolicyEnabled -auto

EmailAddressPolicyEnabled
-------------------------
                     True

Stap 3:
Identity gebruikt om de EAP op false te zetten en daarna bovenstaand commando gebruikt om te kijken of deze was uitgevoerd:

[PS] C:\psscripts>Set-Mailbox 66baa611-e107-4679-b3bd-ab2e3259cd9e -EmailAddressPolicyEnabled:$False
[PS] C:\psscripts>Get-Mailbox 66baa611-e107-4679-b3bd-ab2e3259cd9e | FT EmailAddressPolicyEnabled -auto

EmailAddressPolicyEnabled
-------------------------
                    False

Stap 4:
Om de velden van de tabel Mailbox te bekijken om te kijken welke ik kon gebruiken om het een en ander te controleren heb ik het volgende commando uitgevoerd:
(om het in een tekst bestand te kunnen bekijken kun je de output met pipe (|) en Out-File naar een bestand sturen)

[PS] C:\psscripts>Get-Mailbox 66baa611-e107-4679-b3bd-ab2e3259cd9e | format-list


RunspaceId                             : 797848ce-d2f3-4786-8e53-a34e62af3087
Database                               : Salfischbergerit Mailbox DB1
UseDatabaseRetentionDefaults           : True
RetainDeletedItemsUntilBackup          : False
DeliverToMailboxAndForward             : False
LitigationHoldEnabled                  : False
SingleItemRecoveryEnabled              : False
RetentionHoldEnabled                   : False
EndDateForRetentionHold                :
StartDateForRetentionHold              :
RetentionComment                       :
RetentionUrl                           :
LitigationHoldDate                     :
LitigationHoldOwner                    :
ManagedFolderMailboxPolicy             :
RetentionPolicy                        :
CalendarRepairDisabled                 : False
ExchangeGuid                           : 66baa611-e107-4679-b3bd-ab2e3259cd9e
ExchangeSecurityDescriptor             : System.Security.AccessControl.RawSecurityDescriptor
ExchangeUserAccountControl             : None
MessageTrackingReadStatusEnabled       : True
ExternalOofOptions                     : External
ForwardingAddress                      :
ForwardingSmtpAddress                  :
RetainDeletedItemsFor                  : 31.00:00:00
IsMailboxEnabled                       : True
Languages                              : {nl-NL}
OfflineAddressBook                     :
ProhibitSendQuota                      : unlimited
ProhibitSendReceiveQuota               : unlimited
RecoverableItemsQuota                  : unlimited
RecoverableItemsWarningQuota           : unlimited
DowngradeHighPriorityMessagesEnabled   : False
ProtocolSettings                       : {}
RecipientLimits                        : unlimited
IsResource                             : False
IsLinked                               : False
IsShared                               : False
LinkedMasterAccount                    :
ResourceCapacity                       :
ResourceCustom                         : {}
ResourceType                           :
SamAccountName                         : testcitrix
SCLDeleteThreshold                     :
SCLDeleteEnabled                       :
SCLRejectThreshold                     :
SCLRejectEnabled                       :
SCLQuarantineThreshold                 :
SCLQuarantineEnabled                   :
SCLJunkThreshold                       :
SCLJunkEnabled                         :
AntispamBypassEnabled                  : False
ServerLegacyDN                         : /o=Salfischbergerit Exchange/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configurat
                                         cn=MX02
ServerName                             : mx02
UseDatabaseQuotaDefaults               : True
IssueWarningQuota                      : unlimited
RulesQuota                             : 64 KB (65,536 bytes)
Office                                 :
UserPrincipalName                      : testcitrix@ISALFISCHBERGERIT.Local
UMEnabled                              : False
MaxSafeSenders                         :
MaxBlockedSenders                      :
ReconciliationId                       :
WindowsLiveID                          :
ThrottlingPolicy                       :
RoleAssignmentPolicy                   : Default Role Assignment Policy
SharingPolicy                          : Default Sharing Policy
RemoteAccountPolicy                    :
MailboxPlan                            :
ArchiveDatabase                        :
ArchiveGuid                            : 00000000-0000-0000-0000-000000000000
ArchiveName                            : {}
ArchiveQuota                           : unlimited
ArchiveWarningQuota                    : unlimited
ArchiveDomain                          :
ArchiveStatus                          : None
RemoteRecipientType                    : None
DisabledArchiveDatabase                :
DisabledArchiveGuid                    : 00000000-0000-0000-0000-000000000000
QueryBaseDNRestrictionEnabled          : False
MailboxMoveTargetMDB                   :
MailboxMoveSourceMDB                   :
MailboxMoveFlags                       : None
MailboxMoveRemoteHostName              :
MailboxMoveBatchName                   :
MailboxMoveStatus                      : None
IsPersonToPersonTextMessagingEnabled   : False
IsMachineToPersonTextMessagingEnabled  : True
UserSMimeCertificate                   : {}
UserCertificate                        : {}
CalendarVersionStoreDisabled           : False
ImmutableId                            :
PersistedCapabilities                  : {}
SKUAssigned                            : False
AuditEnabled                           : False
AuditLogAgeLimit                       : 90.00:00:00
AuditAdmin                             : {Update, Move, MoveToDeletedItems, SoftDelete, HardDelete, FolderBind, SendAs, Send
                                         e}
AuditDelegate                          : {Update, SoftDelete, HardDelete, SendAs, Create}
AuditOwner                             : {}
WhenMailboxCreated                     : 9-2-2011 16:55:18
UsageLocation                          :
Extensions                             : {}
HasPicture                             : False
HasSpokenName                          : False
AcceptMessagesOnlyFrom                 : {}
AcceptMessagesOnlyFromDLMembers        : {}
AcceptMessagesOnlyFromSendersOrMembers : {}
AddressListMembership                  : {\Alle Medewerkers, \Default Global Address List}
Alias                                  : testcitrix
ArbitrationMailbox                     :
BypassModerationFromSendersOrMembers   : {}
OrganizationalUnit                     : isalfischbergerit.local/Salfischbergerit/Hoofdkantoor
CustomAttribute1                       :
CustomAttribute10                      :
CustomAttribute11                      :
CustomAttribute12                      :
CustomAttribute13                      :
CustomAttribute14                      :
CustomAttribute15                      :
CustomAttribute2                       :
CustomAttribute3                       :
CustomAttribute4                       :
CustomAttribute5                       :
CustomAttribute6                       :
CustomAttribute7                       :
CustomAttribute8                       :
CustomAttribute9                       :
DisplayName                            : Test Citrix
EmailAddresses                         : {smtp:testcitrix@service.salfischbergerit.nl, SMTP:T.Citrix@salfischbergerit.nl}
GrantSendOnBehalfTo                    : {ISALFISCHBERGERIT.Local/Salfischbergerit/Hoofdkantoor/_Test Policy OU/Test}
ExternalDirectoryObjectId              :
HiddenFromAddressListsEnabled          : False
LastExchangeChangedTime                :
LegacyExchangeDN                       : /o=Salfischbergerit Exchange/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients
MaxSendSize                            : unlimited
MaxReceiveSize                         : unlimited
ModeratedBy                            : {}
ModerationEnabled                      : False
PoliciesIncluded                       : {8aef93df-6bab-4949-854e-4db85d0c32cb, {26491cfc-9e50-4857-861b-0cb8df22b5d7}}
PoliciesExcluded                       : {}
EmailAddressPolicyEnabled              : True
PrimarySmtpAddress                     : T.Citrix@salfischbergerit.nl
RecipientType                          : UserMailbox
RecipientTypeDetails                   : UserMailbox
RejectMessagesFrom                     : {}
RejectMessagesFromDLMembers            : {}
RejectMessagesFromSendersOrMembers     : {}
RequireSenderAuthenticationEnabled     : False
SimpleDisplayName                      :
SendModerationNotifications            : Always
UMDtmfMap                              : {emailAddress:8248749, lastNameFirstName:2487498378, firstNameLastName:8378248749}
WindowsEmailAddress                    : T.Citrix@salfischbergerit.nl
MailTip                                :
MailTipTranslations                    : {}
PartnerObjectId                        : 00000000-0000-0000-0000-000000000000
IsValid                                : True
ExchangeVersion                        : 0.10 (14.0.100.0)
Name                                   : Test Citrix
DistinguishedName                      : CN=Test Citrix,OU=Hoofdkantoor,OU=Salfischbergerit,DC=ISALFISCHBERGERIT,DC=Local
Identity                               : ISALFISCHBERGERIT.Local/Salfischbergerit/Hoofdkantoor/Test Citrix
Guid                                   : 78067c1f-0fb0-4dff-8f4e-f749528ee715
ObjectCategory                         : ISALFISCHBERGERIT.Local/Configuration/Schema/Person
ObjectClass                            : {top, person, organizationalPerson, user}
WhenChanged                            : 23-8-2011 16:53:05
WhenCreated                            : 23-7-2009 11:45:29
WhenChangedUTC                         : 23-8-2011 14:53:05
WhenCreatedUTC                         : 23-7-2009 9:45:29
OrganizationId                         :
OriginatingServer                      : dc01.ISALFISCHBERGERIT.Local

Stap 5:
De velden DisplayName, EmailAddressPolicyEnabled en PrimarySmtpAddress gebruikt om een controlebestand aan te maken:

[PS] C:\psscripts>Get-Mailbox * | FT DisplayName,EmailAddressPolicyEnabled,PrimarySmtpAddress -auto | Out-File PreEnabledEmailAddressPolicy.txt

Uit bovenstaand bestand blijkt dat er 230 mailboxen de EAP optie uit hebben staan.

Stap 6:
Met onderstaand commando EAP op alle mailboxen enabled:

[PS] C:\psscripts>Get-Mailbox | Set-Mailbox -EmailAddressPolicyEnabled:$True

Stap 7:
Nu weer een controlebestand aangemaakt en deze met het vorige controlebestand vergeleken met WinMerge.
Hieruit blijkt dat alle mailboxen nu EAP enabled hebben en dat er 48 PrimarySmtpAddresses zijn gewijzigd:

[PS] C:\psscripts>Get-Mailbox * | FT DisplayName,EmailAddressPolicyEnabled,PrimarySmtpAddress -auto | Out-File PostEnabledEmailAddressPolicy.txt