Add mail attribute active directory
To add a mail attribute to an Active Directory object, you can use the following methods:
Method 1: Using the Active Directory Users and Computers snap-in
- Open the Active Directory Users and Computers snap-in.
- Navigate to the container or OU where the user or group you want to add the mail attribute is located.
- Right-click on the user or group and select "Properties".
- In the Properties window, click on the "Attribute Editor" tab.
- Scroll down and find the "mail" attribute, then click on the "Edit" button.
- Enter the email address you want to assign to the user or group, and click "OK".
Method 2: Using the PowerShell cmdlet
- Open PowerShell as an administrator.
- Import the Active Directory module:
Import-Module ActiveDirectory
- Use the following command to add the mail attribute to a user or group:
Set-ADObject -Identity <ObjectDN> -Add @{mail=<emailaddress>}
Replace
<ObjectDN>
with the distinguished name of the user or group, and<emailaddress>
with the email address you want to assign.
For example:
Set-ADObject -Identity CN=John Doe,CN=Users,DC=example,DC=com -Add @{[email protected]}
Method 3: Using the LDIFDE command-line tool
- Open a command prompt as an administrator.
- Use the following command to add the mail attribute to a user or group:
ldifde -i -f -d "CN=<ObjectDN>,CN=Users,DC=<Domain>,DC=com" -c "mail:<emailaddress>"
Replace
<ObjectDN>
with the distinguished name of the user or group,<Domain>
with the domain name, and<emailaddress>
with the email address you want to assign.
For example:
ldifde -i -f -d "CN=John Doe,CN=Users,DC=example,DC=com" -c "mail:[email protected]"
Note: The LDIFDE command-line tool is only available on Windows Server 2008 and later versions.