Shunze 學園 >電腦資訊學系 >Exchange 2010 > 《分享》AD群組名稱修改Exchange顯示名稱未同步 哈囉,還沒有註冊或者登入。請你[註冊|登入]
« 上一篇主題 下一篇主題 » 顯示成列印模式 | 增加到我的最愛
發表新主題 發表回覆
作者
主題
shunze
工友伯伯


註冊日期: 2002 04
來自: 潮汐終止之地
文章: 2320

shunze 離線
《分享》AD群組名稱修改Exchange顯示名稱未同步引用回覆 編輯/刪除文章 搜尋由  發表的其他文章 回報給版主 IP 位置 回此頁最上方

AD網域內的群組名稱做了修改,
Exchange中的email群組也自動同步做了更新,
但在Exchagne群組一般頁籤堛 DisplayName 卻還是舊的?


↑Name及SamAccountName同步為新名稱


↑但DisplayName還是舊的群組名稱

除了手動逐一修改外,還可以透過以下簡單的powershell script來一次達成。

$GroupBoxes = Get-Group -recipienttype "MailUniversalSecurityGroup"
foreach ($GroupBox in $GroupBoxes)
{
    $DisplayName = $GroupBox.DisplayName
    $Name = $GroupBox.Name

    if ($DisplayName -notlike $Name)
    {
        Write-Host "將群組顯示名稱由 $DisplayName 改為 $Name"
        Set-Group $GroupBox -DisplayName "$Name" -Confirm
    }
}

指令碼簡單說明如下
  • Get-Group 取得群組清單集合
  • -recipienttype "MailUniversalSecurityGroup" 以具有email功能的條件對群組進行篩選
  • -Confirm 由操作者來做設定與否的最後確認

將此script另存為副檔名 ps1 的檔案後以 powershell 執行它,就會出現如下的確認畫面。



按下 Y,就會把 DisplayNameName 來進行修改。


PS.
GroupBox的所有屬性透過 Get-Group | FL 擷取後陳列如下
RunspaceId : 2eee0497-1940-43f8-93b1-cdaaf67d0794
DisplayName : monitor
GroupType : Universal, SecurityEnabled
ManagedBy : {}
SamAccountName : monitor
Sid : S-1-5-21-2025429265-113007714-1708537768-13816
SidHistory : {}
SimpleDisplayName :
RecipientType : MailUniversalSecurityGroup
RecipientTypeDetails : MailUniversalSecurityGroup
WindowsEmailAddress : monitor@test.com.tw
Notes :
Members : {test.com.tw/系統服務帳戶/Shunze}
PhoneticDisplayName :
OrganizationalUnit : test.com.tw/系統服務帳戶
SeniorityIndex :
IsHierarchicalGroup : False
IsValid : True
ExchangeVersion : 0.10 (14.0.100.0)
Name : monitor
DistinguishedName : CN=monitor,OU=系統服務帳戶,DC=test,DC=com,DC=tw
Identity : test.com.tw/系統服務帳戶/monitor
Guid : f24522d0-3071-4aad-994c-45c0407fa1ea
ObjectCategory : test.com.tw/Configuration/Schema/Group
ObjectClass : {top, group}
WhenChanged : 2014/1/2 下午 04:23:53
WhenCreated : 2012/1/3 上午 08:59:32
WhenChangedUTC : 2014/1/2 上午 08:23:53
WhenCreatedUTC : 2012/1/3 上午 12:59:32
OrganizationId :
OriginatingServer : AD1.test.com.tw


Mailbox的所有屬性透過 Get-Mailbox | FL 擷取後陳列如下

RunspaceId : 2eee0497-1940-43f8-93b1-cdaaf67d0794
Database : Mailbox_Default
UseDatabaseRetentionDefaults : True
RetainDeletedItemsUntilBackup : False
DeliverToMailboxAndForward : False
LitigationHoldEnabled : False
SingleItemRecoveryEnabled : False
RetentionHoldEnabled : False
EndDateForRetentionHold :
StartDateForRetentionHold :
RetentionComment :
RetentionUrl :
LitigationHoldDate :
LitigationHoldOwner :
ManagedFolderMailboxPolicy :
RetentionPolicy :
AddressBookPolicy :
CalendarRepairDisabled : False
ExchangeGuid : 5713a932-771b-4bc5-928d-bb1092e10c36
ExchangeSecurityDescriptor : System.Security.AccessControl.RawSecurityDescriptor
ExchangeUserAccountControl : None
MessageTrackingReadStatusEnabled : True
ExternalOofOptions : External
ForwardingAddress : test.com.tw/系統服務帳戶/Shunze.Lee 李順源
ForwardingSmtpAddress :
RetainDeletedItemsFor : 2.00:00:00
IsMailboxEnabled : True
Languages : {zh-TW}
OfflineAddressBook :
ProhibitSendQuota : unlimited
ProhibitSendReceiveQuota : unlimited
RecoverableItemsQuota : unlimited
RecoverableItemsWarningQuota : unlimited
DowngradeHighPriorityMessagesEnabled : False
ProtocolSettings : {RemotePowerShell§1}
RecipientLimits : unlimited
IsResource : False
IsLinked : False
IsShared : False
LinkedMasterAccount :
ResourceCapacity :
ResourceCustom : {}
ResourceType :
SamAccountName : it
SCLDeleteThreshold :
SCLDeleteEnabled :
SCLRejectThreshold :
SCLRejectEnabled :
SCLQuarantineThreshold :
SCLQuarantineEnabled :
SCLJunkThreshold :
SCLJunkEnabled :
AntispamBypassEnabled : False
ServerLegacyDN : /o=test/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuratio
n/cn=Servers/cn=Mail-Exchg2010
ServerName : Mail-Exchg2010
UseDatabaseQuotaDefaults : True
IssueWarningQuota : unlimited
RulesQuota : 64 KB (65,536 bytes)
Office : password:Pa$sw0rd
UserPrincipalName : it@test.com.tw
UMEnabled : False
MaxSafeSenders :
MaxBlockedSenders :
ReconciliationId :
WindowsLiveID :
ThrottlingPolicy :
RoleAssignmentPolicy : Default Role Assignment Policy
SharingPolicy : 預設共用原則
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,
SendOnBehalf, Create}
AuditDelegate : {Update, SoftDelete, HardDelete, SendAs, Create}
AuditOwner : {}
WhenMailboxCreated : 2013/9/17 下午 04:56:12
UsageLocation :
Extensions : {}
HasPicture : False
HasSpokenName : False
AcceptMessagesOnlyFrom : {}
AcceptMessagesOnlyFromDLMembers : {}
AcceptMessagesOnlyFromSendersOrMembers : {}
AddressListMembership : {\Mailboxes(VLV), \All Mailboxes(VLV), \All Recipients(VLV), \預設全域通訊清單, \所有使用者
}
Alias : it
ArbitrationMailbox :
BypassModerationFromSendersOrMembers : {}
OrganizationalUnit : test.com.tw/Users
CustomAttribute1 :
CustomAttribute10 :
CustomAttribute11 :
CustomAttribute12 :
CustomAttribute13 :
CustomAttribute14 :
CustomAttribute15 :
CustomAttribute2 :
CustomAttribute3 :
CustomAttribute4 :
CustomAttribute5 :
CustomAttribute6 :
CustomAttribute7 :
CustomAttribute8 :
CustomAttribute9 :
ExtensionCustomAttribute1 : {}
ExtensionCustomAttribute2 : {}
ExtensionCustomAttribute3 : {}
ExtensionCustomAttribute4 : {}
ExtensionCustomAttribute5 : {}
DisplayName : it
EmailAddresses : {SMTP:it@test.com.tw}
GrantSendOnBehalfTo : {}
ExternalDirectoryObjectId :
HiddenFromAddressListsEnabled : False
LastExchangeChangedTime :
LegacyExchangeDN : /o=test/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/c
n=it
MaxSendSize : unlimited
MaxReceiveSize : unlimited
ModeratedBy : {}
ModerationEnabled : False
PoliciesIncluded : {7e488cb3-b39d-4d2e-8586-3cddbd4429e6, {26491cfc-9e50-4857-861b-0cb8df22b5d7}}
PoliciesExcluded : {}
EmailAddressPolicyEnabled : True
PrimarySmtpAddress : it@test.com.tw
RecipientType : UserMailbox
RecipientTypeDetails : UserMailbox
RejectMessagesFrom : {}
RejectMessagesFromDLMembers : {}
RejectMessagesFromSendersOrMembers : {}
RequireSenderAuthenticationEnabled : False
SimpleDisplayName :
SendModerationNotifications : Always
UMDtmfMap : {emailAddress:48, lastNameFirstName:48, firstNameLastName:48}
WindowsEmailAddress : it@test.com.tw
MailTip :
MailTipTranslations : {}
PartnerObjectId : 00000000-0000-0000-0000-000000000000
IsValid : True
ExchangeVersion : 0.10 (14.0.100.0)
Name : it
DistinguishedName : CN=it,CN=Users,DC=test,DC=com,DC=tw
Identity : test.com.tw/Users/it
Guid : d9077408-1d36-4215-b836-dd15e8f4caed
ObjectCategory : test.com.tw/Configuration/Schema/Person
ObjectClass : {top, person, organizationalPerson, user}
WhenChanged : 2014/1/9 上午 01:18:09
WhenCreated : 2005/10/21 上午 10:16:20
WhenChangedUTC : 2014/1/8 下午 05:18:09
WhenCreatedUTC : 2005/10/21 上午 02:16:20
OrganizationId :
OriginatingServer : Mail-Exchg2010.test.com.tw



PowerShell參考資料:
Windows PowerShell講座—運算子



♥順子老婆的網拍,請多關照∼

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!




2014-01-25, 19:40 shunze 的個人資料 把 shunze 加入好友列表 發送Email給 shunze 瀏覽 shunze 的網站 MSN : shunze@gmail.com
  « 上一篇主題 下一篇主題 »
發表新主題 發表回覆
跳到:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR