Add X500 for a user

Hi,

Add X500 for a user
I want help with adding X500 to all users in a txt file
Can anyone help.

REgards
sharath
LVL 11
bsharathAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bsharathAuthor Commented:
I will have the txt file as
Samaccount name;/o=Group/ou=First Administrative Group/cn=Recipients/cn=Samaccountname
Samaccount i mean as Ntlogin
0
evetsleepCommented:
are you looking to add the x500 address to a matching sAMAccountName  in Active Directory (in the proxyAddresses attribute)?
0
bsharathAuthor Commented:
Yes
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

markdmacCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bsharathAuthor Commented:
Thanks Mark its perfect
One question with the script
This line
x500Base = "/o=ExampleAB/ou=Organizationalunit1/cn=Recipients/cn="
Will the script run on every user and add like this
x500Base = "/o=ExampleAB/ou=Organizationalunit1/cn=Recipients/cn=Samaccount"
0
markdmacCommented:
Yes it will.
0
bsharathAuthor Commented:
as you stated some may faile if renamed. how can i find which failed
I have few users Samaccount that i have renamed those may fail i guess
0
markdmacCommented:
you would need to query against sAMAccountName and compare that to the email address.  How many users are we talking about there?  You could probably grab that info quickly with a custom AD Query in ADUC and just quickly scan the results by eye.  Or dump into Excel and use a formula to compare the two columns.
0
bsharathAuthor Commented:
But
Samaccounts in mine will look as
Sharathy
Email
Sharath.yui@plc.com

I have totally 5000+ users
0
markdmacCommented:
This is untested but hopefully will give you a list of the accounts that will be in trouble.
On Error Resume Next

Dim qQuery, objConnection, objCommand, objRecordSet, obj
Dim oRootDSE, strDomain

Set oRootDSE = GetObject("LDAP://rootDSE")
strDomain = oRootDSE.get("defaultNamingContext")

' other categories = computer, user, printqueue, group
qQuery = "<LDAP://" & strDomain &">;" & _
		"(objectCategory=person)" & _
       ";sAMAccountName,mailNickname;subtree"

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Open "Provider=ADsDSOObject;"
objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 999 
objCommand.CommandText = qQuery
Set objRecordSet = objCommand.Execute

While Not objRecordSet.EOF
	If objRecordSet.Fields("sAMAccountName") & "@domain.com" <> objRecordSet.Fields("mailNickname") Then
    	report = report & objRecordSet.Fields("sAMAccountName") & " is different from " & objRecordSet.Fields("mailNickname") & vbCrLf
    End If
    objrecordset.MoveNext
Wend

objConnection.Close

WScript.Echo report

Open in new window

0
bsharathAuthor Commented:
I get all the usrs listed even though they are correct
0
markdmacCommented:
Sorry I don't have a test environment that I can use for this at the moment.  If they are just one off instances then why not wait for someone to yell and fix them?  
0
bsharathAuthor Commented:
Thanks Mark...
I guess will do it on all and wait for some one who might have a mail bounce thank U
What is the time out there for you.?
Can you have a look at this please... Vbs is also fine on this
http://www.experts-exchange.com/Programming/Languages/Q_25660679.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.