Windows Server - Mass update of sapUsername attribute
Asked By sin.e.bouli
11-Jun-08 03:27 PM
Hi there,
I have a list of users (not all) in one of my OUs that I need to update
by adding the attribute sapUsername with the value specific for them.
e.g.
sAMAccountName is Test.User1 then sapUsername is TUSER1
sAMAccountName is Test.User2 then sapUsername is TUSER2
However, i have over 300 users to update and doing this manually is not
an ideal situation! Is their any way i can mass upload these?
Thanks,
Bouli
--
sin.e.bouli
------------------------------------------------------------------------
sin.e.bouli's Profile: http://forums.techarena.in/member.php?userid=51422
View this thread: http://forums.techarena.in/showthread.php?t=984659
http://forums.techarena.in
SAMAccountName
(1)
SamAccountname1
(1)
SapUsername
(1)
Bouli
(1)
Samaccountname300
(1)
Samaccountname3
(1)
Samaccountname2
(1)
Sapuser300
(1)
Tomasz Onyszko replied...
Your favorite scripting language is Your solution. Or use combination of
cmd.exe, adfind.exe and admod.exe (last two from joe - www.joeware.net).
Assuming that You can have Your samaccountnames in a text file, each of
them in separate line, separated with semicolon from sapUsername.
Something like that:
samAccountname1;sapuser1
samaccountname2;sapuser2
samaccountname3;sapuser3
..
..
..
samaccountname300;sapuser300
You can use command line like this:
for /F "tokens=1,2* delims=;" %i in (sapUsernames.txt) do adfind.exe -b
dc=<domain>,dc=<tld> -s subtree -f "(&(samaccountname=%i))" -adcsv |
admod.exe sapUsername::%j
--
Tomasz Onyszko
http://www.w2k.pl/ - (PL)
http://blogs.dirteam.com/blogs/tomek/ - (EN)
sin.e.bouli replied...
Thanks for these updates - i will try out and let you know how i get on!
--
sin.e.bouli
------------------------------------------------------------------------
sin.e.bouli's Profile: http://forums.techarena.in/member.php?userid=51422
View this thread: http://forums.techarena.in/showthread.php?t=984660
http://forums.techarena.in

Modify SAmAccountName Windows Server I have several SAmAccountNames that are mixed case and I need ti change Server Scripting Discussions ADODB.Connection (1) ADODB.Command (1) Active Directory (1) ADsDSOObject (1) ObjUser.sAMAccountName (1) ADODB (1) SAmAccountName (1) StrDNSDomain (1) Attributes in AD are case aware but not case sensitive. However, I objUser = GetObject("LDAP: / / cn = Jim Smith, ou = Sales, dc = MyDomain, dc = com") strNTName = LCase(objUser.sAMAccountName) objUser.sAMAccountName = strNTName objUser.SetInfo = = = = = = = = = You can use ADO to retrieve sAMAccountName for all users. Since ADO cannot be used to modify attributes, also retrieve distinguishedName so this link: http: / / www.rlmueller.net / ADOSearchTips.htm The following VBScript program will make all sAMAccountName values lower case: = = = = = = = = = = = = = = Option Explicit Dim adoCommand, adoConnection, strBase, strFilter, strAttributes Dim objRootDSE, strDNSDomain, strQuery objects. strFilter = "(&(objectCategory = person)(objectClass = user))" ' Comma delimited list of attribute values to retrieve. strAttributes = "sAMAccountName, distinguishedName" ' Construct the LDAP syntax query. strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree" adoCommand.CommandText = strQuery adoCommand
How to include samAccountName in mayContain in User Class for ADAM Windows Server Hi, I've updated the schema on my instance of ADAM with samAccountName attribute and I can see it in the schema but when I pull up Target and Base schema with SchemaAnalyzer I see samAccountName is not part of user Class. What are the steps to add the attribute to the Class? Thanks, Dylan Windows Server Active Directory Discussions InetOrgPerson (1) SchemaUpgradeNow (1) SamAccountName (1) SchemaAnalyzer (1) ObjectClass (1) MayContain (1) Dylan (1) Uid (1) Edit user objectClass in schema container and add samAccountName to mayContains attribute value. - - Dmitri Gavrilov SDE, Exchange This posting is provided "AS IS" with http: / / www.microsoft.com / info / cpyright.htm Thank you. Now that I've done that, samAccountName is still not showing as an available attribute for the user property in ADAM. Is there anything else that I need to do to make samAccountName as an attribute for the user? I've also added samAccountName in mayContain for InetOrgPerson because uid is part of both "user" and "inetOrgPerson" and is
samaccountname trouble after renaming Windows Server Hello, I have renamed the samaccountname of a user but I encounter some authentication issues on a Windows 2003 R2 SP2 server and IIS especially. I have renamed a user (samaccountname and userprincipalname) from Domain \ John (or john@domain.loc) to Domain \ UI003. Then, nearly 50 When we use Process Explorer, we can see that authentication token still shows the old samaccountname. And in Security log we can see this event : Event Type: Success Audit Event Source Server Active Directory Discussions ASP.NET (1) IIS (1) NtLmSsp (1) Windows (1) Userprincipalname (1) Samaccountname (1) Attributes (1) SRV2003 (1) Hello BZP, Did you check with adsiedit.msc also the surname) of the user. And theses data are different from the old and the new samaccountname. Why does the system use the old one in several console and the new one only in some details pane ? Thanks ! keywords: samaccountname, trouble, after, renaming description: Hello, I have renamed the samaccountname of a user but I encounter some authentication issues on a Windows 2003 R2 SP2