If you've had it with users mucking up NT 4.0 roaming profiles, and have decided to make some or all mandatory, here's how I did it in 5 minutes (code took longer.) Usrmgr.exe allows you to ctrl-select individual users and change the profile directory location for the selected users (something I've not enjoyed with the Win2k Users and Groups MMC).
Ctrl-select the desired users, and in the profile path field change the profile path to:
[servername][profileshare]%username%.man
Then play with the following code according to your configuration.
Perl Code:
#ActivePerl 5.6.1.628
#script to rename profile folders and ntuser.dat to *.man
#kjc@jax.org 12.5.01
#create profile list where folder=%username%
system ("dir /B [driveletter]:[profileshare]profiles > proflist.txt");
# if you want to pick which profiles to
# make mandatory, stop the script here by uncommenting this line:
#end;
# and edit proflist.txt, deleting the
# folder names you don't want to make
# mandatory. Then comment out the above system command
# and let the steps below run.
# open for input
open(MYINPUTFILE, "proflist.txt");
# read file into list
my(@profiles) = <MYINPUTFILE>;
for $x (0 .. $#profiles) {
#remove the trailing carriage return
chomp $profiles[$x];
#add
Requires Free Membership to View
system ("rename [driveletter]:profiles$profiles[$x] $profiles[$x].man");
#change ntuser.dat to ntuser.man
system ("rename [driveletter]:profiles$profiles[$x].manntuser.dat
ntuser.man");
}
close(MYINPUTFILE);
This was first published in December 2001
Enterprise Server Strategies for the CIO
Join the conversationComment
Share
Comments
Results
Contribute to the conversation