# ExchangeOrganization 的默认 Install 步骤。
# 在 2012/7/14 10:17:50 上以编程方式生成。
#
# 变量声明
#
$RoleDatacenterServiceEndpointDomainPartnerManageDelegation = "<ServiceEndpoint><Url>
https://domains.live.com/service/managedelegation.asmx</Url></ServiceEndpoint>"
$RoleIndustry = "Other"
$RoleDatacenterServiceEndpointLiveServiceLogin2 = "<ServiceEndpoint><Url>
https://login.live.com/RST2.srf</Url></ServiceEndpoint>"
$RoleCustomerFeedbackEnabled = $null
$RoleDomainController = "OSA-DC.osavip.com"
$RoleIsDatacenter = $False
$RoleOrgConfigVersion = "12640"
$RoleInvocationID = "20120714-1017500107446958618"
$RoleDatacenterServiceEndpointLiveRmsPublishingService = "<ServiceEndpoint><Url>
https://licensing.drm.microsoft.com/licensing/publish.asmx</Url><CertificateSubjectName>TO BE FILLED IN </CertificateSubjectName></ServiceEndpoint>"
$RolePrepareLegacyExchangePermissions = $False
$RolePrepareOrganization = $True
$RoleInstallationMode = "BuildToBuildUpgrade"
$RoleOrganizationName = "第一个组织"
$RoleDatacenterServiceEndpointLiveRmsCertificationService = "<ServiceEndpoint><Url>
https://licensing.drm.microsoft.com/licensing/licensing.asmx</Url><CertificateSubjectName>TO BE FILLED IN </CertificateSubjectName></ServiceEndpoint>"
$RoleBinPath = "C:\Windows\Temp\ExchangeSetup"
$RoleDatacenterServiceEndpointRmsPremiseAuthenticationCertificate = "<ServiceEndpoint><CertificateSubjectName>CN=exchangelabs.live-int.com, OU=Exchange, O=Microsoft, L=Redmond, S=Washington, C=US</CertificateSubjectName></ServiceEndpoint>"
$RolePrepareAllDomains = $False
$RoleDatacenterServiceEndpointLiveRmsLicensingService = "<ServiceEndpoint><Url>
https://certification.drm.microsoft.com/certification/certification.asmx</Url><CertificateSubjectName>TO BE FILLED IN </CertificateSubjectName></ServiceEndpoint>"
$RoleDatacenterServiceEndpointLiveGetUserRealm = "<ServiceEndpoint><Url>
https://login.live.com/GetUserRealm.srf</Url></ServiceEndpoint>"
$RoleDatacenterServiceEndpointLiveFederationMetadata = "<ServiceEndpoint><Url>
https://nexus.passport.com/FederationMetadata/2006-12/FederationMetadata.xml</Url></ServiceEndpoint>"
$RoleFullyQualifiedDomainName = "osavip.com"
$RoleProductPlatform = "amd64"
$RolePrepareSchema = $False
$RolePrepareDomain = $True
$RoleDatacenterServiceEndpointABCHContactService = "<ServiceEndpoint><Url>
http://pvt-contacts.msn.com/abservice/abservice.asmx</Url></ServiceEndpoint>"
#
# 组件任务
#
#“Common Global AD Configuration”组件的任务
# [ID = fe007758, Wt = 1, isFatal = False] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:50:if ((Get-OrganizationConfig).ObjectVersion -lt 10649) { Get-OfflineAddressBook | foreach { if ((Get-ExchangeServer $_.Server.ObjectGuid.ToString()).IsExchange2007OrLater) { $_ | Set-OfflineAddressBook -DiffRetentionPeriod:30 } } } if ((Get-OrganizationConfig).ObjectVersion -lt 12424) { Get-OfflineAddressBook | foreach { if ((Get-ExchangeServer $_.Server.ObjectGuid.ToString()).IsExchange2007OrLater) { $_ | Set-OfflineAddressBook -UseDefaultAttributes -MaxBinaryPropertySize:32768 -MaxMultivaluedBinaryPropertySize:65536 -MaxStringPropertySize:3400 -MaxMultivaluedStringPropertySize:65536 } } }
# [ID = e17c8d34, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:50:buildToBuildUpgrade-ExsetDataAtom -AtomName OrgLevelCt -DomainController $RoleDomainController
# [ID = 1ce902f4, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:51:install-RootOrganizationContainer -DomainController $RoleDomainController
# [ID = 5eef978d, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:51:Install-Container "ServiceEndpoints"
# [ID = bd5d3e68, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:51:Get-Variable RoleDatacenterServiceEndpoint* | foreach { Write-ExchangeSetupLog -Info ("Adding endpoint from variable " + $_.Name); $epName = $_.Name.Substring("RoleDatacenterServiceEndpoint".Length); $epXml = [xml]$_.Value; $epUrl = $epXml.ServiceEndpoint.Url; $epCert = $epXml.ServiceEndpoint.CertificateSubjectName; Write-ExchangeSetupLog -Info ("Calling New-ServiceEndPoint for endpoint $epName with URL $epUrl and certificate subject $epCert"); New-ServiceEndpoint -Name $epName -Url $epUrl -CertificateSubjectName $epCert -DomainController $RoleDomainController; }
# [ID = 76b5193a, Wt = 1, isFatal = True] "正在创建自动发现容器。"
2012/7/14 10:17:51:Install-AutoDiscoverContainer -DomainController $RoleDomainController
# [ID = 198f6454, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:51:if ($RoleCustomerFeedbackEnabled -ne $null) { Set-OrganizationConfig -CustomerFeedbackEnabled $RoleCustomerFeedbackEnabled; }
# [ID = 85b9f72e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:51:Set-OrganizationConfig -Industry $RoleIndustry;
# [ID = c84a007e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:if ($RoleIsDatacenter -eq $true) { install-ConfigurationUnitsContainer -DomainController $RoleDomainController }
# [ID = 5bc37cce, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-Container -Name:"Provisioning Policy Container" -DomainController $RoleDomainController
# [ID = e222733e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-Container -Name:"Provisioning Policy Container","Template" -DomainController $RoleDomainController
# [ID = 10e2cdbe, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-Container -Name:"Provisioning Policy Container","Enforcement" -DomainController $RoleDomainController
# [ID = fbdd6bd0, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:$policy = Get-RecipientEnforcementProvisioningPolicy -DomainController $RoleDomainController; if ($policy -ne $null -and (($policy.Name -ne "Recipient Quota Policy") -or (-not $policy.TargetObjects.Contains("SyncMailbox")))) { $r3_dlQuota = $policy.R3_Deprecated_DLCountQuota; $dlQuota = $policy.DistributionListCountQuota; if ($dlQuota.IsUnlimited -and -not $r3_dlQuota.IsUnlimited) { $dlQuota = $r3_dlQuota; } $mbQuota = $policy.MailboxCountQuota; $muQuota = $policy.MailUserCountQuota; $mcQuota = $policy.ContactCountQuota; Remove-RecipientEnforcementProvisioningPolicy -Identity $policy.Identity -Confirm:$false -DomainController $RoleDomainController; $newPolicy = New-RecipientEnforcementProvisioningPolicy -DomainController $RoleDomainController; Set-RecipientEnforcementProvisioningPolicy -Identity $newPolicy.Identity -R3_Deprecated_DLCountQuota $r3_dlQuota -DistributionListCountQuota $dlQuota -MailboxCountQuota $mbQuota -MailUserCountQuota $muQuota -ContactCountQuota $mcQuota -DomainController $RoleDomainController; }
# [ID = aaeb50f2, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-Container -Name:"Address Lists Container" -DomainController $RoleDomainController
# [ID = 5fd54056, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-Container -Name:"Address Lists Container","Offline Address Lists" -DomainController $RoleDomainController
# [ID = 67d50d1e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-CannedAddressLists -DomainController $RoleDomainController
# [ID = b0ec19e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-GlobalAddressLists -DomainController $RoleDomainController
# [ID = 12bfdbfe, Wt = 1, isFatal = True] "正在为管理角色对象创建容器。"
2012/7/14 10:17:52:install-Container -Name:"RBAC" -DomainController $RoleDomainController
# [ID = 708bdb5e, Wt = 1, isFatal = True] "正在为 Exchange 角色创建容器。"
2012/7/14 10:17:52:install-Container -Name:"RBAC","Roles" -DomainController $RoleDomainController
# [ID = 463accf8, Wt = 1, isFatal = True] "正在为 Exchange 作用域创建容器。"
2012/7/14 10:17:52:install-Container -Name:"RBAC","Scopes" -DomainController $RoleDomainController
# [ID = aa71076, Wt = 1, isFatal = True] "正在为 Exchange 角色分配创建容器"
2012/7/14 10:17:52:install-Container -Name:"RBAC","Role Assignments" -DomainController $RoleDomainController
# [ID = f9016c2, Wt = 1, isFatal = True] "正在创建 Exchange 角色策略的容器。"
2012/7/14 10:17:52:install-Container -Name:"RBAC","Policies" -DomainController $RoleDomainController
# [ID = 4c51328, Wt = 1, isFatal = True] "正在创建传输设置容器。"
2012/7/14 10:17:52:install-TransportConfigContainer -Name:"Transport Settings" -DomainController $RoleDomainController
# [ID = fbe0742, Wt = 1, isFatal = True] "正在创建接受域容器。"
2012/7/14 10:17:52:install-Container -Name:"Transport Settings","Accepted Domains" -DomainController $RoleDomainController
# [ID = 2f0220d4, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:install-DefaultAcceptedDomain -Name $RoleFullyQualifiedDomainName -DomainName $RoleFullyQualifiedDomainName -DomainController $RoleDomainController
# [ID = d77911de, Wt = 1, isFatal = True] "正在创建默认电子邮件地址策略对象。"
2012/7/14 10:17:52:install-EmailAddressPolicy -DomainController $RoleDomainController
# [ID = d78a581e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:$acceptedDomains = @{}; Get-AcceptedDomain | foreach { $domainName = $_.DomainName.ToString(); if ($acceptedDomains.Contains($domainName)) { Write-ExchangeSetupLog -Warning "Duplicate AcceptedDomain found. '$($acceptedDomains[$domainName])' and '$($_.Name)' both reference domain '$domainName'"; } else { $acceptedDomains.Add($domainName, $_.Name); }; }; function getSmtpTemplates ([string]$property) { $input | Select-Object -ExpandProperty $property | Where-Object {$_.PrefixString -eq "SMTP"} | Foreach-Object {$_.AddressTemplateString -replace ".*@", ""}; } function addDomains ([Microsoft.Exchange.Data.Directory.SystemConfiguration.AcceptedDomainType]$domainType) { $domain = $null; $input | Where-Object {-not $acceptedDomains.ContainsKey($_)} | Where-Object {[Microsoft.Exchange.Data.SmtpDomainWithSubdomains]::TryParse($_, [ref] $domain)} | Foreach-Object { $name = $domain.ToString(); if ($name.Length -gt 64) { $name = $name.Substring(0, 64) }; if ($acceptedDomains.ContainsValue($name) ) {$name = [System.Guid]::NewGuid().ToString()}; new-AcceptedDomain -Name:$name -DomainName:$domain -DomainType:$domainType; $acceptedDomains[$domain.ToString()] = $name; }; } $emailAddressPolicies = Get-EmailAddressPolicy; $emailAddressPolicies | getSmtpTemplates "NonAuthoritativeDomains" | addDomains "InternalRelay"; $emailAddressPolicies | getSmtpTemplates "EnabledEmailAddressTemplates" | addDomains "Authoritative";
# [ID = ae1b4cbe, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:52:Write-ExchangeSetupLog -Info "Set the default Accepted domain from the default recipient policy"; $defaultEmailAddressPolicy = get-EmailAddressPolicy -Identity:"Default Policy"; $defaultSmtpTemplate = $defaultEmailAddressPolicy.EnabledPrimarySMTPAddressTemplate; $index = $defaultSmtpTemplate.IndexOf("@"); $eapAuthoritativeDomain = $defaultSmtpTemplate.Substring($index+1); $defaultDomain = get-accepteddomain | where {$_.DomainName -eq $eapAuthoritativeDomain }; $defaultDomain | set-accepteddomain -MakeDefault:$true; Write-ExchangeSetupLog -Info "Default domain $defaultDomain";
# [ID = f387f784, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:53:Install-Container -Name:"Connections" -DomainController $RoleDomainController
# [ID = 2d02627e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:53:New-ExchangeAssistanceConfig -DomainController $RoleDomainController
# [ID = 68548c32, Wt = 1, isFatal = True] "正在创建全局设置容器。"
2012/7/14 10:17:53:Install-GlobalSettingsContainer -Name:"Global Settings" -DomainController $RoleDomainController
# [ID = 92082d7e, Wt = 1, isFatal = True] "正在创建邮件 DeliveryContainer。"
2012/7/14 10:17:53:Install-MessageDeliveryContainer -DomainController $RoleDomainController
# [ID = 4e7531b2, Wt = 1, isFatal = True] "正在创建默认邮件筛选器容器。"
2012/7/14 10:17:53:Install-DefaultMessageFilterContainer -DomainController $RoleDomainController
# [ID = 81765bfe, Wt = 1, isFatal = True] "正在创建默认连接筛选器容器。"
2012/7/14 10:17:53:Install-DefaultConnectionFilterContainer -DomainController $RoleDomainController
# [ID = b14c69ca, Wt = 1, isFatal = True] "正在安装默认的 Internet 邮件格式。"
2012/7/14 10:17:53:Install-InternetMessageFormat -DomainController $RoleDomainController
# [ID = 13547f7b, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:17:53:buildToBuildUpgrade-ExsetDataAtom -AtomName OrgCtChildren -DomainController $RoleDomainController
# [ID = 7920e70d, Wt = 5, isFatal = True] "正在创建全局 Exchange USG。"
2012/7/14 10:18:33:initialize-ExchangeUniversalGroups -DomainController $RoleDomainController
# [ID = d2f246de, Wt = 1, isFatal = True] "正在创建管理组容器。"
2012/7/14 10:18:34:Install-AdministrativeGroupContainer -Name:"Administrative Groups" -DomainController $RoleDomainController
# [ID = ab3e4b4a, Wt = 1, isFatal = True] "正在配置 Exchange 管理组。"
2012/7/14 10:18:34:install-AdministrativeGroup -DomainController $RoleDomainController
# [ID = d0e2d7f4, Wt = 5, isFatal = True] "正在配置 Exchange 配置容器。"
2012/7/14 10:18:34:initialize-ExchangeConfigurationPermissions -DomainController $RoleDomainController
# [ID = 525f6cbe, Wt = 1, isFatal = True] "正在设置 Administrators 组的权限。"
2012/7/14 10:18:34:initialize-AdminGroupPermissions -DomainController $RoleDomainController
# [ID = 28d31d92, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:34:New-MicrosoftExchangeRecipient -DomainController $RoleDomainController
# [ID = 61d85b88, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:34:$tc=Get-TransportConfig -DomainController $RoleDomainController; if (!$tc.SupervisionTags.Contains("Allow")) { $tc.SupervisionTags.Add("Allow"); } if (!$tc.SupervisionTags.Contains("Reject")) { $tc.SupervisionTags.Add("Reject"); } Set-TransportConfig -DomainController $RoleDomainController -SupervisionTags $tc.SupervisionTags;
# [ID = fb821a4c, Wt = 1, isFatal = True] "正在创建内置的 Exchange 角色"
2012/7/14 10:18:34:Install-CannedRbacRoles -DomainController $RoleDomainController
# [ID = 24dda20, Wt = 1, isFatal = True] "正在创建内置的 Exchange 角色分配。"
2012/7/14 10:18:53:Install-CannedRbacRoleAssignments -InvocationMode $RoleInstallationMode -DomainController $RoleDomainController
# [ID = 43a63f72, Wt = 1, isFatal = True] "正在创建 CmdletExtensionAgent 设置容器。"
2012/7/14 10:18:54:install-Container -Name:"Global Settings","CmdletExtensionAgent Settings" -DomainController $RoleDomainController
# [ID = c8a7bdd2, Wt = 1, isFatal = True] "正在为联合身份验证信任创建容器。"
2012/7/14 10:18:54:Install-Container -Name "Federation Trusts" -DomainController $RoleDomainController
# [ID = 8f2a1114, Wt = 1, isFatal = True] "正在创建联合身份验证容器。"
2012/7/14 10:18:54:Install-FederationContainer -DomainController $RoleDomainController
# [ID = 8ecad8fe, Wt = 1, isFatal = True] "正在创建默认共享策略。"
2012/7/14 10:18:54:Install-DefaultSharingPolicy -DomainController $RoleDomainController
# [ID = c54116be, Wt = 1, isFatal = True] "正在创建默认限制策略。"
2012/7/14 10:18:54:$policy = Get-ThrottlingPolicy -DomainController $RoleDomainController | ? {$_.IsDefault }; if ($policy -ne $null) { $policy | Upgrade-ThrottlingPolicy -DomainController $RoleDomainController; } else { Install-DefaultThrottlingPolicy -DomainController $RoleDomainController; }
# [ID = ee9b8064, Wt = 1, isFatal = True] "正在配置邮件提示。"
2012/7/14 10:18:54:Set-OrganizationConfig -MailTipsAllTipsEnabled $true; Set-OrganizationConfig -MailTipsGroupMetricsEnabled $true; Set-OrganizationConfig -MailTipsMailboxSourcedTipsEnabled $true; Set-OrganizationConfig -MailTipsLargeAudienceThreshold 25
# [ID = 3d4816fe, Wt = 1, isFatal = True] "正在启用自我管理权限。"
2012/7/14 10:18:54:$policyName = [Microsoft.Exchange.Data.Directory.SystemConfiguration.RoleAssignmentPolicy]::DefaultRoleAssignmentPolicyName; $p = get-RoleAssignmentPolicy -DomainController $RoleDomainController; if($p -eq $null) { $policyDescription = [Microsoft.Exchange.Data.Directory.SystemConfiguration.RoleAssignmentPolicy]::PrecannedRoleAssignmentPolicyDescription; $p = new-RoleAssignmentPolicy -IsDefault -name $policyName -DomainController $RoleDomainController -Description $policyDescription; $selfManagementRoles = @(); $selfManagementRoles+= Get-ManagementRole -RoleType MyBaseOptions -DomainController $RoleDomainController | where {$_.IsRootRole}; $selfManagementRoles+= Get-ManagementRole -RoleType MyContactInformation -DomainController $RoleDomainController | where {$_.IsRootRole}; $selfManagementRoles+= Get-ManagementRole -RoleType MyVoiceMail -DomainController $RoleDomainController | where {$_.IsRootRole}; $selfManagementRoles+= Get-ManagementRole -RoleType MyTextMessaging -DomainController $RoleDomainController | where {$_.IsRootRole}; $selfManagementRoles+= Get-ManagementRole -RoleType MyDistributionGroupMembership -DomainController $RoleDomainController | where {$_.IsRootRole}; $selfManagementRoles=$selfManagementRoles | where {$_ -ne $null}; foreach($role in $selfManagementRoles) { New-ManagementRoleAssignment -Policy $p.Identity -Role $role.Name -DomainController $RoleDomainController; } }
# [ID = b1f12210, Wt = 1, isFatal = True] "正在安装 AdminAuditLogConfig 对象。"
2012/7/14 10:18:54:Install-AdminAuditLogConfig -DomainController $RoleDomainController; $adminAuditLogConfig = Get-AdminAuditLogConfig -DomainController $RoleDomainController; if ($adminAuditLogConfig.AdminAuditLogCmdlets -eq $null -or ($adminAuditLogConfig.AdminAuditLogCmdlets.Count -eq 0 -and $adminAuditLogConfig.AdminAuditLogParameters.Count -eq 0)) { Set-AdminAuditLogConfig -DomainController $RoleDomainController -AdminAuditLogCmdlets * -AdminAuditLogParameters *; }
# [ID = 5a34907e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:54:install-Container -Name:"Remote Accounts Policies Container" -DomainController $RoleDomainController
# [ID = f8d6b60a, Wt = 1, isFatal = True] "正在注册 CmdletExtension 代理。"
2012/7/14 10:18:54:$assembly = "Microsoft.Exchange.ProvisioningAgent.dll"; $installedAgents = Get-CmdletExtensionAgent -DomainController $RoleDomainController; $classFactory = "Microsoft.Exchange.ProvisioningAgent.AdminLogAgentClassFactory"; if($null -eq ($installedAgents | where {$_.ClassFactory -ieq $classFactory})) { New-CmdletExtensionAgent -Name "Admin Audit Log Agent" -ClassFactory $classFactory -Assembly $assembly -Priority 255 -DomainController $RoleDomainController; } $classFactory = "Microsoft.Exchange.ProvisioningAgent.ScriptingAgentClassFactory"; if($null -eq ($installedAgents | where {$_.ClassFactory -ieq $classFactory})) { New-CmdletExtensionAgent -Name "Scripting Agent" -ClassFactory $classFactory -Assembly $assembly -Enabled:$false -DomainController $RoleDomainController; } $h = new-object System.Collections.Hashtable; $h.Add("Rus Agent", "Microsoft.Exchange.ProvisioningAgent.RusAgentClassFactory"); $h.Add("Mailbox Resources Management Agent", "Microsoft.Exchange.ProvisioningAgent.MailboxResourcesManagementAgentClassFactory"); $h.Add("OAB Resources Management Agent", "Microsoft.Exchange.ProvisioningAgent.OABResourcesManagementAgentClassFactory"); $h.Add("Provisioning Policy Agent", "Microsoft.Exchange.ProvisioningAgent.ProvisioningPolicyAgentClassFactory"); $h.Add("Query Base DN Agent", "Microsoft.Exchange.ProvisioningAgent.QueryBaseDNRestrictionAgentClassFactory"); $h.Keys | foreach { $name = $_; $classFactory = $h[$_]; if($null -eq ($installedAgents | where {$_.ClassFactory -ieq $classFactory})) { New-CmdletExtensionAgent -Name $name -ClassFactory $classFactory -Assembly $assembly -DomainController $RoleDomainController; } }
# [ID = f0c73e5e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:54:$arbMbxname = "SystemMailbox{1f05a927-" + [System.Guid]::NewGuid().ToString().Substring(9) + "}"; $arbMbxLastName = "MSExchApproval 1f05a927-3be2-4fb9-aa03-b59fe3b56f4c"; $arbUser = @(Get-User -Filter {LastName -eq $arbMbxLastName} -IgnoreDefaultScope -ResultSize 1); if ($arbUser.Length -eq 0) { $arbUser = @(Get-User -Arbitration -Filter {LastName -eq $arbMbxLastName} -IgnoreDefaultScope -ResultSize 1); } if ($arbUser.Length -eq 0) { Install-UserAccount -Name $arbMbxname -LastName $arbMbxLastName; }
# [ID = 8cb0c07e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:55:$arbMbxname = "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}"; $arbMbxLastName = "MsExchDiscovery e0dc1c29-89c3-4034-b678-e6c29d823ed9"; $arbUser = @(Get-User -Filter {LastName -eq $arbMbxLastName} -IgnoreDefaultScope -ResultSize 1); if ($arbUser.Length -eq 0) { $arbUser = @(Get-User -Arbitration -Filter {LastName -eq $arbMbxLastName} -IgnoreDefaultScope -ResultSize 1); } if ($arbUser.Length -eq 0) { Install-UserAccount -Name $arbMbxname -LastName $arbMbxLastName; }
# [ID = ac596d3e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:55:$arbMbxname = [Microsoft.Exchange.Management.RecipientTasks.EnableMailbox]::DiscoveryMailboxUniqueName; $arbMbxLastName = "MsExchDiscoveryMailbox D919BA05-46A6-415f-80AD-7E09334BB852"; $arbUser = @(Get-User -Filter {LastName -eq $arbMbxLastName} -IgnoreDefaultScope -ResultSize 1); if ($arbUser.Length -eq 0) { Install-UserAccount -Name $arbMbxname -LastName $arbMbxLastName; }
# [ID = e448df1e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:55:$federatedMailboxId = [Microsoft.Exchange.Management.Deployment.UpdateRmsSharedIdentity]::SharedIdentityCommonName; $federatedEmailUsers = @(Get-User -Filter {LastName -eq $federatedMailboxId} -IgnoreDefaultScope -ResultSize 1); if ($federatedEmailUsers.Length -eq 0) { $federatedEmailUsers = @(Get-User -Arbitration -Filter {LastName -eq $federatedMailboxId} -IgnoreDefaultScope -ResultSize 1); } if ($federatedEmailUsers.Length -eq 0) { Install-UserAccount -Name $federatedMailboxId -LastName $federatedMailboxId; }
# [ID = 28ba89e, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:55:New-ServiceConnectionPoint -Name "Microsoft Exchange Online" -TrustedHoster -TrustedHostnames "*.outlook.com" -DomainController $RoleDomainController
# [ID = 78b70254, Wt = 1, isFatal = True] "正在 Active Directory 中创建 Exchange 配置对象"
2012/7/14 10:18:55:New-ServiceConnectionPoint -Name "Windows Live Calendar" -DomainToApplicationUri -Domains "hotmail.com","msn.com","live.com" -ApplicationUri "http://calendar.live.com" -DomainController $RoleDomainController
#“Transport Global AD Configuration”组件的任务
# [ID = 9e34717e, Wt = 1, isFatal = True] "正在创建 DSN 自定义容器。"
2012/7/14 10:18:55:install-Container -Name:"Transport Settings","DSN Customization" -DomainController $RoleDomainController
# [ID = 451977e, Wt = 1, isFatal = True] "正在配置邮件分类容器。"
2012/7/14 10:18:55:install-Container -Name:"Transport Settings","Message Classifications" -DomainController $RoleDomainController
# [ID = 7d55abfe, Wt = 1, isFatal = True] "正在创建默认邮件分类容器。"
2012/7/14 10:18:55:install-Container -Name:"Transport Settings","Message Classifications","Default" -DomainController $RoleDomainController
# [ID = 3d2f8f3e, Wt = 1, isFatal = True] "安装程序正在配置系统邮件分类。"
2012/7/14 10:18:55:install-SystemMessageClassification -Name:"Transport Settings","Message Classifications" -DomainController $RoleDomainController
# [ID = 4bcb77e, Wt = 1, isFatal = True] "安装程序正在创建规则容器。"
2012/7/14 10:18:55:install-Container -Name:"Transport Settings","Rules" -DomainController $RoleDomainController
# [ID = 5daf1b7e, Wt = 1, isFatal = True] "正在创建邮件清洁容器。"
2012/7/14 10:18:55:install-Container -Name:"Transport Settings","Message Hygiene" -DomainController $RoleDomainController
# [ID = 863145a, Wt = 1, isFatal = True] "正在创建发件人信誉对象。"
2012/7/14 10:18:55:new-SenderReputationConfig -Name:"Transport Settings","Message Hygiene","Sender Reputation" -DomainController $RoleDomainController
# [ID = 23bd407e, Wt = 1, isFatal = True] "正在为支持的 DSN 语言创建容器。"
2012/7/14 10:18:55:foreach ($lcid in (get-DsnSupportedLanguages)) { $lcidStr = $lcid.ToString("", [System.Globalization.NumberFormatInfo].InvariantInfo); install-Container -Name:"Transport Settings","DSN Customization",$lcidStr -DomainController $RoleDomainController; install-Container -Name:"Transport Settings","DSN Customization",$lcidStr,"Internal" -DomainController $RoleDomainController; install-Container -Name:"Transport Settings","DSN Customization",$lcidStr,"External" -DomainController $RoleDomainController; }
# [ID = 2845d40a, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-ContentFilterConfig -DomainController $RoleDomainController
# [ID = 5ff880de, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-SenderIDConfig -DomainController $RoleDomainController
# [ID = b3af07fe, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-SenderFilterConfig -DomainController $RoleDomainController
# [ID = bdccbe1e, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-RecipientFilterConfig -DomainController $RoleDomainController
# [ID = 593fbf08, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-IPAllowListConfig -DomainController $RoleDomainController
# [ID = ea26b9e, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-IPAllowListProvidersConfig -DomainController $RoleDomainController
# [ID = a99239a8, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-IPBlockListConfig -DomainController $RoleDomainController
# [ID = ec6c01de, Wt = 1, isFatal = True] "正在配置反垃圾邮件对象。"
2012/7/14 10:18:56:install-IPBlockListProvidersConfig -DomainController $RoleDomainController
#“Bridgehead Global AD Configuration”组件的任务
# [ID = 844aedde, Wt = 1, isFatal = True] "正在创建传输规则集合。"
2012/7/14 10:18:56:install-RuleCollection -Name:"Transport" -DomainController $RoleDomainController; install-RuleCollection -Name:"TransportVersioned" -DomainController $RoleDomainController;
# [ID = 6e087cbe, Wt = 1, isFatal = True] "正在创建日志规则集合。"
2012/7/14 10:18:56:install-RuleCollection -Name:"Journaling" -DomainController $RoleDomainController; install-RuleCollection -Name:"JournalingVersioned" -DomainController $RoleDomainController;
# [ID = 8f1a92ba, Wt = 1, isFatal = True] "正在升级规则集合。"
2012/7/14 10:18:56:$a = get-transportrule; if ($a -eq $null) { $rulefile = export-transportrulecollection -ExportLegacyRules -WarningAction:SilentlyContinue; } else { $rulefile = export-transportrulecollection; } if ($rulefile -ne $null) { import-transportrulecollection -FileData $rulefile.FileData; } $a = get-journalrule; if ($a -eq $null) { $rulefile = export-journalrulecollection -ExportLegacyRules -WarningAction:SilentlyContinue; } else { $rulefile = export-journalrulecollection; } if ($rulefile -ne $null) { import-journalrulecollection -FileData $rulefile.FileData; }
# [ID = 5931f55e, Wt = 1, isFatal = True] "正在创建 Outlook 保护规则容器。"
2012/7/14 10:18:57:install-RuleCollection -Name:"OutlookProtectionRules" -DomainController $RoleDomainController;
# [ID = 2a60599e, Wt = 1, isFatal = True] "正在创建信息权限管理(IRM)配置容器。"
2012/7/14 10:18:57:install-IRMConfiguration -Name:"Transport Settings","ControlPoint Config" -DomainController $RoleDomainController;
# [ID = a913191a, Wt = 1, isFatal = True] "正在创建 UCE 内容筛选器对象。"
2012/7/14 10:18:57:Install-UceContentFilterConfig -DomainController $RoleDomainController;
#“Client Access Global AD Configuration”组件的任务
# [ID = f8a4a814, Wt = 1, isFatal = True] "正在创建客户端访问容器。"
2012/7/14 10:18:57:install-Container -Name:"Client Access" -DomainController $RoleDomainController
# [ID = df69b5e, Wt = 1, isFatal = True] "正在创建自动发现容器。"
2012/7/14 10:18:57:install-Container -Name:"Client Access","AutoDiscover" -DomainController $RoleDomainController
# [ID = b792a83e, Wt = 1, isFatal = True] "正在创建 Outlook 容器。"
2012/7/14 10:18:57:install-Container -Name:"Client Access","AutoDiscover","Outlook" -DomainController $RoleDomainController
# [ID = d887277e, Wt = 1, isFatal = True] "正在创建 Exchange MIME 类型。"
2012/7/14 10:18:57:initialize-ExchangeMimeTypes
# [ID = 60e6f05e, Wt = 1, isFatal = True] "正在为 Outlook Web App 邮箱策略创建容器。"
2012/7/14 10:18:57:install-Container -Name "OWA Mailbox Policies" -DomainController $RoleDomainController
# [ID = f0344cbe, Wt = 1, isFatal = True] "正在创建默认 Outlook Web App 邮箱策略。"
2012/7/14 10:18:57:$policyDefault = Get-OwaMailboxPolicy -DomainController $RoleDomainController | where {$_.Identity -eq "Default"}; if($policyDefault -eq $null) { New-OwaMailboxPolicy -Name "Default" -DomainController $RoleDomainController }
#“Mailbox Global AD Configuration”组件的任务
# [ID = ccd8c77e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "ELC Mailbox Policies" -DomainController $RoleDomainController
# [ID = ce26135e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "Retention Policies Container" -DomainController $RoleDomainController
# [ID = 9c2eb902, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "UM Mailbox Policies" -DomainController $RoleDomainController
# [ID = 35566b72, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "Mobile Mailbox Policies" -DomainController $RoleDomainController
# [ID = a0d83e5e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-ResourceConfig -DomainController $RoleDomainController
# [ID = ca740abe, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-container -Name "Retention Policy Tag Container" -DomainController $RoleDomainController
# [ID = 6bdb01be, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局容器。"
2012/7/14 10:18:57:install-container -Name "ELC Folders Container"-DomainController $RoleDomainController
# [ID = 350d3d9e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Calendar" -FolderType Calendar -DomainController $RoleDomainController
# [ID = 680764de, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Contacts" -FolderType Contacts -DomainController $RoleDomainController
# [ID = 836e3210, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Deleted Items" -FolderType DeletedItems -DomainController $RoleDomainController
# [ID = 7078a41e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Drafts" -FolderType Drafts -DomainController $RoleDomainController
# [ID = 188b46fe, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Inbox" -FolderType Inbox -DomainController $RoleDomainController
# [ID = 8ec1fb7e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Junk E-mail" -FolderType JunkEmail -DomainController $RoleDomainController
# [ID = 7a26e9be, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Journal" -FolderType Journal -DomainController $RoleDomainController
# [ID = 197657be, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Notes" -FolderType Notes -DomainController $RoleDomainController
# [ID = 64b2099e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Outbox" -FolderType Outbox -DomainController $RoleDomainController
# [ID = f56954f0, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Sent Items" -FolderType SentItems -DomainController $RoleDomainController
# [ID = 4925207e, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Tasks" -FolderType Tasks -DomainController $RoleDomainController
# [ID = 29a45998, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Entire Mailbox" -FolderType All -DomainController $RoleDomainController
# [ID = 39659ef6, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "RSS Feeds" -FolderType RssSubscriptions -DomainController $RoleDomainController
# [ID = d0765750, Wt = 1, isFatal = True] "正在为邮箱服务器角色创建全局托管文件夹。"
2012/7/14 10:18:57:new-ManagedDefaultFolder -Name "Sync Issues" -FolderType SyncIssues -DomainController $RoleDomainController
# [ID = 5aefb69e, Wt = 1, isFatal = True] "正在为组自服务审批应用程序创建保留策略标记。"
2012/7/14 10:18:57:$autoGroupRPT = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq 'AutoGroup'}); if ($autoGroupRPT.length -eq 0) { new-RetentionPolicyTag -Name AutoGroup -Type Personal -SystemTag:$true -RetentionEnabled:$true -RetentionAction DeleteAndAllowRecovery -AgeLimitForRetention 30 -MessageClass * -DomainController $RoleDomainController; }
# [ID = 19d22838, Wt = 1, isFatal = True] "已为中继收件人审批创建保留策略标记。"
2012/7/14 10:18:57:$moderatedRPT = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq 'ModeratedRecipients'}); if ($moderatedRPT.length -eq 0) { new-RetentionPolicyTag -Name ModeratedRecipients -Type Personal -SystemTag:$true -RetentionEnabled:$true -RetentionAction DeleteAndAllowRecovery -AgeLimitForRetention 5 -MessageClass * -DomainController $RoleDomainController; }
# [ID = ebf94ed6, Wt = 1, isFatal = True] "正在为存档邮箱创建保留策略。"
2012/7/14 10:18:57:$rptNames = 'Personal 1 Year move to archive', 'Default 2 year move to archive', 'Personal 5 year move to archive', 'Personal never move to archive'; $rptTypes = 'Personal', 'All', 'Personal', 'Personal'; $rptMCs = '*', 'IPM.Note', '*', '*'; $rptAges = '365', '730', '1825', '0'; for($i=0; $i -lt $rptNames.Length; $i++) { $moderatedRPT = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq $rptNames[$i]}); if ( $moderatedRPT.length -eq 0 ) { if( $i -ne $rptNames.Length-1 ) { new-RetentionPolicyTag -Name $rptNames[$i] -Type $rptTypes[$i] -SystemTag:$true -RetentionEnabled:$true -RetentionAction MoveToArchive -AgeLimitForRetention $rptAges[$i] -MessageClass $rptMCs[$i] -DomainController $RoleDomainController; } else { new-RetentionPolicyTag -Name $rptNames[$i] -Type $rptTypes[$i] -SystemTag:$true -RetentionEnabled:$false -RetentionAction MoveToArchive -MessageClass $rptMCs[$i] -DomainController $RoleDomainController; } } } $policyName = [Microsoft.Exchange.Management.RecipientTasks.EnableMailbox]::DefaultArchivePolicyName; $defaultArchivePolicy = @(Get-RetentionPolicy -DomainController $RoleDomainController | where {$_.Name -eq $policyName}); if ($defaultArchivePolicy.length -eq 0) { new-RetentionPolicy -Name $policyName -RetentionPolicyTagLinks $rptNames[0],$rptNames[1],$rptNames[2],$rptNames[3] -DomainController $RoleDomainController; }
# [ID = a52f873e, Wt = 1, isFatal = True] "正在为仲裁邮箱创建保留策略。"
2012/7/14 10:18:57:$arbitrationRetentionPolicy = @(Get-RetentionPolicy -DomainController $RoleDomainController | where {$_.Name -eq 'ArbitrationMailbox'}); if ($arbitrationRetentionPolicy.length -eq 0) { $moderatedRPT = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq 'ModeratedRecipients'}); $autoGroupRPT = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq 'AutoGroup'}); new-RetentionPolicy -Name ArbitrationMailbox -RetentionPolicyTagLinks $moderatedRPT[0].Identity,$autoGroupRPT[0].Identity -DomainController $RoleDomainController; }
# [ID = c93d43be, Wt = 1, isFatal = True] "正在创建审批应用程序容器。"
2012/7/14 10:18:57:new-ApprovalApplicationContainer -DomainController $RoleDomainController
# [ID = cfc0d1fe, Wt = 1, isFatal = True] "正在创建组自服务审批应用程序。"
2012/7/14 10:18:57:$rpt = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq 'AutoGroup'}); new-ApprovalApplication -AutoGroup -ELCRetentionPolicyTag $rpt[0].Identity -DomainController $RoleDomainController;
# [ID = 7ba933e, Wt = 1, isFatal = True] "正在创建中继收件人审批应用程序。"
2012/7/14 10:18:57:$rpt = @(Get-RetentionPolicyTag -IncludeSystemTags -DomainController $RoleDomainController | where {$_.Name -eq 'ModeratedRecipients'}); new-ApprovalApplication -ModeratedRecipients -ELCRetentionPolicyTag $rpt[0].Identity -DomainController $RoleDomainController;
#“Unified Messaging Global AD Configuration”组件的任务
# [ID = 12c995fe, Wt = 1, isFatal = True] "正在为统一消息服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "UM DialPlan Container" -DomainController $RoleDomainController
# [ID = 8f547abe, Wt = 1, isFatal = True] "正在为统一消息服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "UM IPGateway Container" -DomainController $RoleDomainController
# [ID = d0b466fe, Wt = 1, isFatal = True] "正在为统一消息服务器角色创建全局容器。"
2012/7/14 10:18:57:install-Container -Name "UM AutoAttendant Container" -DomainController $RoleDomainController
#“Domain-specific AD Configuration”组件的任务
# [ID = d263b8ba, Wt = 1, isFatal = True] "正在配置 Exchange 的域。"
2012/7/14 10:18:57:if ($RolePrepareAllDomains) { initialize-DomainPermissions -AllDomains:$true -CreateTenantRoot:$RoleIsDatacenter; } elseif ($RoleDomain -ne $null) { initialize-DomainPermissions -Domain $RoleDomain -CreateTenantRoot:$RoleIsDatacenter; } else { initialize-DomainPermissions -CreateTenantRoot:$RoleIsDatacenter; }
#“PostPrepForest Global AD Configuration”组件的任务
# [ID = 6fcfc93e, Wt = 1, isFatal = True] "正在配置 Exchange 对象版本。"
2012/7/14 10:19:13:Set-SetupOnlyOrganizationConfig -ObjectVersion $RoleOrgConfigVersion -DomainController $RoleDomainController