I've not tested this (just hashed it up as I read your post, so there's probably going to be some syntax errors, etc. --please test first).

But here's a quick and dirty vbscript that should change all uppercase accounts to lowercase.


set oConn=createObject("ADODB.Connection")
set oComm=createObject("ADODB.Command")

' configure provider and define command
oConn.provider="ADsDSOObject"
oConn.open"Active Directory Provider"
oComm.activeConnection=oConn

' build query
sADsPath= "<LDAP://"&oRootDse.get("defaultNamingContext")&">;"
sFilter = "(&(objectCategory=person)(objectClass=user));"
sAttrs = "ADsPath,sAMAccountName;"
sScope = "SubTree"
sQuery = sADsPath&sFilter&sAttrs&sScope

' configure command properties
oComm.commandText=sQuery
oComm.properties("Page Size")=128
oComm.properties("Size Limit")=100000
oComm.properties("Cache Results")=false

' execute query
set oRs=oComm.execute

if(not oRs.eOF)then ' check to see if any results
oRs.moveFirst ' were returned

' iterate result set
while not oRs.eOF
    sAMAccountName = oRs.fields(1).value
    if(uCase(sAMAccountName) = sAMAccountName)then
     sAMAccountName = lCase(sAMAccountName)
     set oUser = getObject(oRs.Fields(0))
     oUser.put"sAMAccountName",sAMAccountName
     oUser.setInfo
    end if
    oRs.moveNext
wend
else
' empty record set (no results returned)
end if


--Paul

----- Original Message ----- From: "Irwan Hadi" <[EMAIL PROTECTED]>
To: <ActiveDir@mail.activedir.org>
Sent: Wednesday, August 09, 2006 2:14 AM
Subject: [ActiveDir] UPPER case for username


We are in the process of bringin in a couple hundred users from a
Novell Groupwise system to our AD 2003 + Exchange 2003 system. Our AD
is in Windows 2003 Native mode for forest and domain.

Because of the need to integrate Groupwise and Exchange, we need to
use Microsoft Exchange Connector for Groupwise (and Quest Migration
Wizard). The problem is, the administrator of the Novell Groupwise has
set their standard username to be in UPPER CASE, eg: JDOE, instead of
lower case eg: jdoe, and Exchange Connector for Groupwise will create
the username with the same case it is now in Groupwise.

This means in our AD domain, we will have a couple hundred users who
use UPPER CASE for their username.

Now the questions are:
- Will this cause any problem with any of Microsoft product in the
future (eg: Sharepoint).
- Is there a way to change the username  in CAPS to be in lower
letter, once Exchange connector for Groupwise creates the user?

Thanks
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ml/threads.aspx

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ml/threads.aspx

Reply via email to