Automate switch from roaming to MANDATORY roaming profiles

Had it with users mucking up NT 4.0 roaming profiles? Make some or all mandatory in just five minutes with this tip.

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 .man to the profile folder
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

Dig deeper on Windows File Management

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close