Here's a good one. Tell me if you've heard it before... ;-)

We are going to be consolidating ~4500 users' home directories to a common location on the SAN, placing a quota of 1GB ea. per user. We have a 5TB chunk of space in which to do this, however, we will not have one large 5TB volume for user data. Instead, owing to backup time issues, we will be creating five 1TB volumes, and the users will be distributed across these.

Now, the only logical way I can see to do this is alphabetically, based on User ID. To that end, I have figured that since first names never* change, I can break the users up by first initial. I have further determined where in the alphabet to break them up to keep the numbers fairly even across each volume. Now I am trying to figure out a way to actually do this in login script syntax.

This much I know works:


Now I could do this in a batch file:

for %%a in (a,b,c) do if /i "%%a"=="%FIRST_INITIAL%" map F:=STAFF1_AC:\USERS\%CN%
for %%a in (d,e,f,g,h,i) do if /i "%%a"=="%FIRST_INITIAL%" map F:=STAFF1_DI:\USERS\%CN%
for %%a in (j,k,l) do if /i "%%a"=="%FIRST_INITIAL%" map F:=STAFF1_JL:\USERS\%CN%
for %%a in (m,n,o,p,q,r) do if /i "%%a"=="%FIRST_INITIAL%" map F:=STAFF1_MR:\USERS\%CN%
for %%a in (s,t,u,v,w,x,y,z) do if /i "%%a"=="%FIRST_INITIAL%" map F:=STAFF1_SZ:\USERS\%CN%

But I'd rather accomplish this in the Login Script itself. Is this possible?


* O(+-> = Prince