Partial change of Display Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi folks

I need to to a partial change of the display name of users in a number of
OUs. The users currently have a display name of "Year 11 - Bloggs, Joe".
They need to be changed to "Year 12 - Bloggs, Joe".

I exported the users to a text file and could do a quick find & replace to
update all the records, but I'm not quite certain how I can then import the
records to overwrite the current data.

If there's a way of renaming the field, I'd be keen to do it that way.

Cheers

Chris
 
Hi folks

I need to to a partial change of the display name of users in a number of
OUs. The users currently have a display name of "Year 11 - Bloggs, Joe".
They need to be changed to "Year 12 - Bloggs, Joe".

I exported the users to a text file and could do a quick find & replace to
update all the records, but I'm not quite certain how I can then import the
records to overwrite the current data.

If there's a way of renaming the field, I'd be keen to do it that way.

Cheers

Chris

Using tip 5898 » Freeware ADFind
and
tip 8233 » AdMod freeware.
in the 'Tips & Tricks' at http://www.jsifaq.com



@echo off
setlocal
set qry=adfind -default -nodn -csv NUL -nocsvheader -csvdelim # -f "&(objectcategory=Person)(objectClass=User)" distinguishedName displayName
for /f "Tokens=1,2 Delims=#" %%a in ('%qry%^|find "Year 11 - "') do (
call :chkit %%a %%b
)
endlocal
goto :EOF
:chkit
set display=%2
set display=%display:"=%
if "%display:~0,10%" NEQ "Year 11 - " goto :EOF
set display=%display:Year 11 - =Year 12 - %
admod -b %1 "displayName::%display%"


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Hi Jerry

Mate, this looks the goods. I've downloaded the program. Looking at the
script you have written (I'm still a bit of a newb) I take it Adfind needs to
in the same folder as the script (or is it just a .bat) and it will run.

Cheers

Chris
Brisbane, Aus
 
Back
Top