modify usernames from csv

D

Dogface

Anyone know a tool that would allow me to take usernames from an NT 4.0
Domain and modify the naming standard? I have the usernames (along with
first and last names) from the NT 4.0 domain in a csv file, and need to
change the username to a different naming standard. I know this has got to
be easy. I need to create the new the usernames in another text or csv
file.

Example:

Under NT 4.0

Last Name:
Johnson

First Name:
Paul

Username:
PJohnson

----------------------------------------------------------------------

For Active Directory

Last Name:
Johnson

First Name:
Paul

Username:
JohnsonPa
 
J

Jerold Schulman

Anyone know a tool that would allow me to take usernames from an NT 4.0
Domain and modify the naming standard? I have the usernames (along with
first and last names) from the NT 4.0 domain in a csv file, and need to
change the username to a different naming standard. I know this has got to
be easy. I need to create the new the usernames in another text or csv
file.

Example:

Under NT 4.0

Last Name:
Johnson

First Name:
Paul

Username:
PJohnson

----------------------------------------------------------------------

For Active Directory

Last Name:
Johnson

First Name:
Paul

Username:
JohnsonPa

----------------------------------------------------------------------

In the CSV file:

Johnson, Paul
@echo off
setlocal
for /f "Tokens=1* Delims=," %%a in ('type filename.csv') do (
set last=%%a
set first=%%b
call :doit
)
endlocal
goto :EOF
:doit
if "%First:~0,1%" EQU " " set first=%First:~1%
set fullname=%first% %last%
set username=%last%%first:~0,2%
@echo "%userName%" "%fullname%"


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
J

Jerold Schulman

**** Revised *****

@echo off
setlocal
for /f "Tokens=1* Delims=," %%a in ('type filename.csv') do (
set last=%%a
set first=%%b
call :doit
)
endlocal
goto :EOF
:doit
if "%First:~0,1%" EQU " " set first=%First:~1%
set fullname=%first% %last%
set first=%first: =%
set first=%first:.=%
set last=%last: =%
set username=%last%%first:~0,2%
@echo %userName% "%fullname%"


Filename.csv contains:

Schulman,Jerold
Schulman, Jason
De Polo,Vivian
Van Der Killer,Jamie Lee
Johnson, Paul
smith, J. H.

Output:

SchulmanJe "Jerold Schulman"
SchulmanJa "Jason Schulman"
DePoloVi "Vivian De Polo"
VanDerKillerJa "Jamie Lee Van Der Killer"
JohnsonPa "Paul Johnson"
smithJH "J. H. smith"






Anyone know a tool that would allow me to take usernames from an NT 4.0
Domain and modify the naming standard? I have the usernames (along with
first and last names) from the NT 4.0 domain in a csv file, and need to
change the username to a different naming standard. I know this has got to
be easy. I need to create the new the usernames in another text or csv
file.

Example:

Under NT 4.0

Last Name:
Johnson

First Name:
Paul

Username:
PJohnson

----------------------------------------------------------------------

For Active Directory

Last Name:
Johnson

First Name:
Paul

Username:
JohnsonPa

----------------------------------------------------------------------

In the CSV file:

Johnson, Paul


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top