genesis Posted September 4, 2018 Posted September 4, 2018 Hi We have windows 2012 domain controllers and the domain is Domain.com. Under this I have a OU called STU and under this OU I have 5 sub OU’s STU -OU14 -OU15 -OU16 -OU17 -OU18 Each of these OUs have 200 users and now I would like to change the mail attribute and the primary SMTP address for every users This value is under :User Properties-Attribute editor-Mail & proxyAddress Example: If I take the students under OU17, I would like to put 17 in front of their mail and SMTP address in the user attribute for evey user. Please can a script be provided with syntax to do this task for all users in each of the OU. Any help will be great and thanks in advance
timbo343 Posted September 4, 2018 Posted September 4, 2018 You might be able to do it with this https://4sysops.com/archives/free-admodifynet-modify-multiple-user-accounts-in-active-directory/ as you can edit the attributes and edit the email address field on mass using variables. I did it to populate our users when we set them up for emails.
genesis Posted September 4, 2018 Author Posted September 4, 2018 When I click the link, it takes to the download archive and when I down the archive and extract the zip file It gives the a list of folders- discussions, issues, license, release, source code and wiki. I can’t see the installer file . Please guide me if I am doing something wrong, and I need to get this sorted by tomorrow. Thanks
timbo343 Posted September 4, 2018 Posted September 4, 2018 Try this link - i have it zipped up with some other AD tools. https://drive.google.com/open?id=0B9ftsS4ZT8WhZ0gwazl1blA5Vkk
genesis Posted September 4, 2018 Author Posted September 4, 2018 Thanks I have downloaded the ADModify.exe and not familiar using this utility and don't want to mess up . Please can you take me through steps as per my AD structure as I posted first.
timbo343 Posted September 4, 2018 Posted September 4, 2018 Launch the exe > Click on Modify Attributes > drop down the domain list - choose your domain > Choose your DC and click the green arrow. Untick groups, contacts and public folders and untick show containers only to show the user objects - click the green arrow again. Browse through the domain to your OU. highlight the OU and click on add to list. On the right of the window click select all - this will now edit the highlighted items. Now we need to go and edit the Email Address field. What format are your email addresses in as this will build the string for your Primary email address. The mail attribute is linked to the email field. I guess these are different to what the primary email address will be? or should this be the primary email address? How many email addresses are in the attribute editor tab > Proxy Addresses as this is where the issue may arrise.
genesis Posted September 4, 2018 Author Posted September 4, 2018 Thanks please see the attached and have gone till 3rd step Example: So at the moment the “mail” attribute for the current user is who is located in OU16 is [email protected] . I would like to put 16 in front of all the users in OU16 and it needs be changed to this format: [email protected] Also the same with the “Primary SMTP” address-need to put 16 for all the users in OU16 and the format needs to be [email protected] These are the two values I need to change for all users really, so not sure on the AdModify .net , I need to select E-Mail Address tab or Custom Will be easier to change the “mail” attribute first and second the Primary “SMTP” address Any steps would be greatCustom attribute.bmp
timbo343 Posted September 4, 2018 Posted September 4, 2018 right ok, ive just put a 17 in front of an ex staff member so i know this should work. Try it on one of your users first to see if it works. In admodify select the Email addresses tab. Tick Add SMTP Address and type this: 16%'mail'% Tick set as primary and leave update email address on general tab ticked too what this will do is take the mail attribute and alter the email addresses so it will add 16 to the existing entry setting it to primary and make the proxyaddresses the same too.
genesis Posted September 4, 2018 Author Posted September 4, 2018 (edited) It gives this error as attached and also I noticed with the test account Previous to running this software, the address was in this format the capital primary "SMTP:[email protected] ." in the AD account of the user( attribute) When I ran this is shows as smtp:[email protected] " and it dosent put the vale of 14 for the primary SMTP address. It must be in this format SMTP:[email protected] Edited September 4, 2018 by genesis
genesis Posted September 4, 2018 Author Posted September 4, 2018 Also on general tab update email address is not there
timbo343 Posted September 4, 2018 Posted September 4, 2018 (edited) Its missing the other tick box next to set as primary. Ive just tried it on another ex staff member as used what youve set. I set the variable to 14%'mail'% and it only changed the proxyaddresses and didnt change the mail attribute. Im not sure why its not applying. What about running the exe as administrator. Edited September 4, 2018 by timbo343
timbo343 Posted September 4, 2018 Posted September 4, 2018 (edited) Quick question, why does it need the SMTP:.... part? Are you running onprem exchange or do you connect to a cloud provider? Ive just checked a new member of staff as we connect to O365 and thsi user doesnt have the SMTP: variable part in their account. Edit... none of our users have the SMTP:.. under proxyaddresses. I have it as i have so many alais however no one else has it, even those that were connected to our old onprem exhange server dont have it. Edited September 4, 2018 by timbo343
genesis Posted September 4, 2018 Author Posted September 4, 2018 I ran the exe as a domain\administrator and still it is doing the same. Iam running this on windows 2012 DC, do I need to run on our exchange 2013?
timbo343 Posted September 4, 2018 Posted September 4, 2018 No you shouldnt need to, i run it on my win10 machine connecting to one of our 2012 r2 DCs and we were using exchange 2010 before o365. What are you seeing in the attributes tab of AD? What is changing in there?
genesis Posted September 4, 2018 Author Posted September 4, 2018 We have on prem Exchange and have migrated the mail box to 0365. Because we changed the email domain name and the new domain must contain the SMTP value with 14 . The old address has the 14 in front of the email address in the attributes , but not the new email domain SMTP address. sorry for the trouble , need to resolve this by tomorrow morning
timbo343 Posted September 4, 2018 Posted September 4, 2018 You can undo the changes too if you need to. Ive just reverted the email address back to how it was.
timbo343 Posted September 4, 2018 Posted September 4, 2018 So you have the old domain.. [email protected] and you have [email protected] in proxyaddresses and you need to keep both domains but set newdomain.com as SMTP:[email protected] and the email address field needs to read [email protected]? As you are having an issue with the email addresses tab, try the general tab > email.
genesis Posted September 4, 2018 Author Posted September 4, 2018 Please see the attached of snapshot of attribute editor and when I run the ADModify.exe, it only changes the SMTP into small letters smtp and it doesn't put 14 in from of the email address.
genesis Posted September 4, 2018 Author Posted September 4, 2018 Please see the snap shot of the attribute editor. When run the Ad modify , it changes the SMTP into lowercase smtp and doesn't put14 in front of the email address.
genesis Posted September 4, 2018 Author Posted September 4, 2018 Please see the snap shot of the attribute editor. When run the Ad modify , it changes the SMTP into lowercase smtp and doesn't put 14 in front of the email address.
timbo343 Posted September 4, 2018 Posted September 4, 2018 Ah! I see the issue and without seeing it live im struggling. Im startng to think this is going to be a bigger job than what i thought it was. Im wondering if it wont set it to the primary address as it already has a primary address there. I have a feeling that you may need to export the addresses to csv work on them then import telling powershell which column is the primary address.
genesis Posted September 4, 2018 Author Posted September 4, 2018 snapshot taken before I ran the ADModify
timbo343 Posted September 4, 2018 Posted September 4, 2018 It should be doing this https://www.google.co.uk/amp/techgenix.com/office-365-changing-primary-e-mail-address-users-bulk-using-gui-tool/amp/ All the articles ive seen online state CSVs [emoji853]
genesis Posted September 4, 2018 Author Posted September 4, 2018 The previous post is missing . I can export the email address of all the students by each OU level and can export their email address . I use cjwdev to import the email address. Please provide as how to go from here suing the powershell to change the SMTP and the mail in the attribute of a user in AD http://www.cjwdev.co.uk/Software/ADReportingTool/Info.html
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now