Announcement

Collapse
No announcement yet.

Changing attribute to uppercase

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing attribute to uppercase

    I am trying to change the Active Directory Lastname attribute to all uppercase for 3000+ staff members at my University. Is there a script to do this?

  • #2
    Re: Changing attribute to uppercase

    i have two suggestions...

    you can do an LDIFDE export to a text, then use any of the hundreds of editing programs to do the work for you, then do an LDIFDE import on the modified export...

    or *i think* you can modify how the schema display the surname field... ill have to dig to find that paper though...
    its easier to beg forgiveness than ask permission.
    Give karma where karma is due...

    Comment


    • #3
      Re: Changing attribute to uppercase

      Thanks James. I was hoping for a vbscript that I can run against the attribute, but I will look into your LDIFDE opton. Thanks again.

      vjardine

      Comment


      • #4
        Re: Changing attribute to uppercase

        Code:
        Dim rs,conn
        Dim objRootDSE, domainContainer, ldapSearchStr
        Dim strUserDN, objUser 
        
        Set conn = CreateObject("ADODB.Connection")
        conn.Provider = "ADSDSOObject"
        conn.Open "ADs Provider"
        
        Set objRootDSE	= GetObject("LDAP://RootDSE")
        domainContainer = objRootDSE.Get("defaultNamingContext")
        WScript.Echo domainContainer
        ldapSearchStr = "<LDAP://" & domainContainer & _
        		">;(&(objectCategory=person)(objectclass=user)(sn=*));adspath;subtree"
        Set rs = conn.Execute(ldapSearchStr)
        
        rs.MoveFirst
        While Not rs.EOF 
        	strUserDN = rs.Fields(0).Value
        	Set objUser = GetObject(strUserDN)
        	objUser.sn = Ucase(objUser.sn)
        	objUser.SetInfo
        	WScript.Echo objUser.sn
        	rs.MoveNext
        Wend
        That should do it
        Guy Teverovsky
        "Smith & Wesson - the original point and click interface"

        Comment

        Working...
        X