Shunze ¾Ç¶é >¹q¸£¸ê°T¾Ç¨t >Exchange 2010 > ¡m¤À¨É¡nAD¸s²Õ¦WºÙ­×§ïExchangeÅã¥Ü¦WºÙ¥¼¦P¨B «¢Åo¡AÁÙ¨S¦³µù¥U©ÎªÌµn¤J¡C½Ð§A[µù¥U|µn¤J]
« ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD » Åã¥Ü¦¨¦C¦L¼Ò¦¡ | ¼W¥[¨ì§Úªº³Ì·R
µoªí·s¥DÃD µoªí¦^ÂÐ
§@ªÌ
¥DÃD
shunze
¤u¤Í§B§B


µù¥U¤é´Á: 2002 04
¨Ó¦Û: ¼é¦Á²×¤î¤§¦a
¤å³¹: 2370

shunze Â÷½u
¡m¤À¨É¡nAD¸s²Õ¦WºÙ­×§ïExchangeÅã¥Ü¦WºÙ¥¼¦P¨B¤Þ¥Î¦^ÂÐ ½s¿è/§R°£¤å³¹ ·j´M¥Ñ  µoªíªº¨ä¥L¤å³¹ ¦^³øµ¹ª©¥D IP ¦ì¸m ¦^¦¹­¶³Ì¤W¤è

ADºô°ì¤ºªº¸s²Õ¦WºÙ°µ¤F­×§ï¡A
Exchange¤¤ªºemail¸s²Õ¤]¦Û°Ê¦P¨B°µ¤F§ó·s¡A
¦ý¦bExchagne¸s²Õ¤@¯ë­¶ÅÒùتº DisplayName «oÁÙ¬Oªº¡H


¡ôName¤ÎSamAccountName¦P¨B¬°·s¦WºÙ


¡ô¦ýDisplayNameÁÙ¬Oªº¸s²Õ¦WºÙ

°£¤F¤â°Ê³v¤@­×§ï¥~¡AÁÙ¥i¥H³z¹L¥H¤U²³æªºpowershell script¨Ó¤@¦¸¹F¦¨¡C

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

    if ($DisplayName -notlike $Name)
    {
        Write-Host "±N¸s²ÕÅã¥Ü¦WºÙ¥Ñ $DisplayName §ï¬° $Name"
        Set-Group $GroupBox -DisplayName "$Name" -Confirm
    }
}

«ü¥O½X²³æ»¡©ú¦p¤U
  • Get-Group ¨ú±o¸s²Õ²M³æ¶°¦X
  • -recipienttype "MailUniversalSecurityGroup" ¥H¨ã¦³email¥\¯àªº±ø¥ó¹ï¸s²Õ¶i¦æ¿z¿ï
  • -Confirm ¥Ñ¾Þ§@ªÌ¨Ó°µ³]©w»P§_ªº³Ì«á½T»{

±N¦¹script¥t¦s¬°°ÆÀɦW ps1 ªºÀɮ׫á¥H powershell °õ¦æ¥¦¡A´N·|¥X²{¦p¤Uªº½T»{µe­±¡C



«ö¤U Y¡A´N·|§â DisplayName ¥H Name ¨Ó¶i¦æ­×§ï¡C


PS.
GroupBoxªº©Ò¦³Äݩʳz¹L Get-Group | FL Â^¨ú«á³¯¦C¦p¤U
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/¨t²ÎªA°È±b¤á/Shunze}
PhoneticDisplayName :
OrganizationalUnit : test.com.tw/¨t²ÎªA°È±b¤á
SeniorityIndex :
IsHierarchicalGroup : False
IsValid : True
ExchangeVersion : 0.10 (14.0.100.0)
Name : monitor
DistinguishedName : CN=monitor,OU=¨t²ÎªA°È±b¤á,DC=test,DC=com,DC=tw
Identity : test.com.tw/¨t²ÎªA°È±b¤á/monitor
Guid : f24522d0-3071-4aad-994c-45c0407fa1ea
ObjectCategory : test.com.tw/Configuration/Schema/Group
ObjectClass : {top, group}
WhenChanged : 2014/1/2 ¤U¤È 04:23:53
WhenCreated : 2012/1/3 ¤W¤È 08:59:32
WhenChangedUTC : 2014/1/2 ¤W¤È 08:23:53
WhenCreatedUTC : 2012/1/3 ¤W¤È 12:59:32
OrganizationId :
OriginatingServer : AD1.test.com.tw


Mailboxªº©Ò¦³Äݩʳz¹L Get-Mailbox | FL Â^¨ú«á³¯¦C¦p¤U

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/¨t²ÎªA°È±b¤á/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 : ¹w³]¦@¥Î­ì«h
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 ¤U¤È 04:56:12
UsageLocation :
Extensions : {}
HasPicture : False
HasSpokenName : False
AcceptMessagesOnlyFrom : {}
AcceptMessagesOnlyFromDLMembers : {}
AcceptMessagesOnlyFromSendersOrMembers : {}
AddressListMembership : {\Mailboxes(VLV), \All Mailboxes(VLV), \All Recipients(VLV), \¹w³]¥þ°ì³q°T²M³æ, \©Ò¦³¨Ï¥ÎªÌ
}
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 ¤W¤È 01:18:09
WhenCreated : 2005/10/21 ¤W¤È 10:16:20
WhenChangedUTC : 2014/1/8 ¤U¤È 05:18:09
WhenCreatedUTC : 2005/10/21 ¤W¤È 02:16:20
OrganizationId :
OriginatingServer : Mail-Exchg2010.test.com.tw



PowerShell°Ñ¦Ò¸ê®Æ¡G
Windows PowerShellÁ¿®y¡X¹Bºâ¤l



♥¶¶¤l¦Ñ±Cªººô©ç¡A½Ð¦hÃö·Ó¡ã

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 ªº­Ó¤H¸ê®Æ §â shunze ¥[¤J¦n¤Í¦Cªí µo°eEmailµ¹ shunze ÂsÄý shunze ªººô¯¸ MSN : shunze@gmail.com
  « ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD »
µoªí·s¥DÃD µoªí¦^ÂÐ
¸õ¨ì:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR