Created
September 23, 2025 17:23
-
-
Save NiKiZe/71053fa306109a9bfc4ae529800b4483 to your computer and use it in GitHub Desktop.
Add msExchHideFromAddressLists attribute to Active Directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2007/aa565483(v=exchg.80) | |
| $schemaPath = (Get-ADRootDSE).schemaNamingContext | |
| $attributes = @{ | |
| adminDescription = 'ms-Exch-Hide-From-Address-Lists'; | |
| adminDisplayName = 'ms-Exch-Hide-From-Address-Lists'; | |
| attributeID = '1.2.840.113556.1.4.7000.102.73'; | |
| attributeSyntax = '2.5.5.8'; | |
| isMemberOfPartialAttributeSet = $true; | |
| isSingleValued = $true; | |
| lDAPDisplayName = 'msExchHideFromAddressLists'; | |
| CN = 'ms-Exch-Hide-From-Address-Lists'; | |
| oMSyntax = 1; | |
| objectCategory = "CN=Attribute-Schema,$schemaPath"; | |
| objectClass = 'attributeSchema'; | |
| schemaIdGuid = New-Object Guid (, [byte[]](150,11,28,162,147,176,210,17,170,6,0,192,79,142,237,216)); | |
| searchFlags = 16; | |
| attributeSecurityGuid = New-Object Guid (, [System.Convert]::FromBase64String("VAGN5Pi80RGHAgDAT7lgUA==")); | |
| showInAdvancedViewOnly = $true; | |
| } | |
| New-ADObject -Name $attributes.CN -Type attributeSchema -Path $schemapath -OtherAttributes $attributes | |
| $userSchema = Get-ADObject -SearchBase $schemapath -Filter 'name -eq "user"' | |
| $userSchema | Set-ADObject -Add @{mayContain = $attributes.lDAPDisplayName} |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also posted as answer at https://learn.microsoft.com/en-sg/answers/questions/1791320/how-can-i-add-msexchhidefromaddresslists-attribute