Machine Specific Profiles for a Multiple OS Client / Server 2K Domain

Posted on 2004-09-24
Medium Priority
Last Modified: 2010-04-14

Hope someone can help with this.

Here we have a Windows 2000 Server domain with 3 Different Microsoft OS Clients (NT4, 2000, XP). Any user must be able to log on to any of the 700 Machines at any time. We operate a manatory user profile for all users.

Here is the problem, the profile has always been fine with just NT4 / 2000. It takes some fiddling to get it right but it works. XP However doesnt seem to work so well with the profile, it manages to pick up all the desktop settings but other things like regional and print settings dont seem to work properly (paper and language sizes always end up out).

What i would like to do is make three different profiles, one for each OS and apply them to computer OU's but as far as i can see that is not possible as the profile paths are user specific rather than machine specfic. Plus there is the fact that NT4 machines seem to ignore OU's entirely.

Does anyone know a way that I could make a machine specific mandatory profile for anyt user that logs on. I did think of making a madatory local profile on future machines, but it would not be feasable to do this to all the existing ones.

Thanks for reading
Question by:disinformation
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1

Expert Comment

ID: 12141271
Maybe a logon script that checks the machine it's running on and applies the relevant profile?  Unfortunately, the standard OS environment variable for NT, W2K and XP is 'Windows_NT' so you'd be faced with creating your own variable on each of your 700 boxes...


Author Comment

ID: 12141407
jthow, i had considered this.

The distribution of the new enviorment variable wouldnt be too difficult, i could just add a reg clip to the top level of my computer accounts OU (and manually add it to NT's machines, not too many)

However, i wouldnt even know where to start in creating a script (or 3 scripts) to implement a profile

Expert Comment

ID: 12143949

Sorry, I'm not a scripting expert.. ;-(

There's a couple of articles at:-


and http://www.tycho7.com/Software/Win2k/logon_scripts.htm

that might give you some clues.

I don't think you'd need 3 scripts, just 1 with the 3 variations you have and a test for your environment variable which decides the appropriate settings for the particular flavour of windoze.  (But, like i said I'm not a scripting expert...)

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

LVL 17

Expert Comment

ID: 12144880
LVL 85

Expert Comment

ID: 12146866
You don't need a script.
On each of your three machine types, set an environment variable in the machine(!) environment, named, for example, "OSVersion" (well, you can do that with a script ...).
On XP, set it to XP, on W2k, set it to W2k, and on NT4, set it to NT4.
In the folder where your mandatory profile currently resides, create three subdirectories, named like the three possible settings: NT4, W2k, XP. Put the respective profiles in there.
Now all you have to do is adjust the path to the profile in the user's properties. Set it to \\SomeServer\YourProfileShare\%OSVersion%, instead of (probably) \\SomeServer\YourProfileShare.

As for the script, you can use setx.exe (from the other link), but do not forget the -m switch.
This will check the OS version and set the OSVersion variable accordingly, if necessary.

@echo off
ver | find /i "Windows 2000" && set CurrentOSVersion=W2k
ver | find /i "Windows XP" && set CurrentOSVersion=XP
ver | find /i "Windows NT" && set CurrentOSVersion=NT4
if "%OSVersion%"=="%CurrentOSVersion%" goto :eof
set OSVersion=%CurrentOSVersion%
ECHO setx.exe OSVersion %CurrentOSVersion% -m

Author Comment

ID: 12158780
Excellent, I never thought of refering to enviroment variables from active directory.

Im at a conference today so i wont be able to test it, I should get some time this week and hopefully i will close the question.


Author Comment

ID: 12160201
Unfortunately oBdA your idea doesnt seem to work, the new env variable needs to be on the server as well as the workstation it seems.
LVL 85

Expert Comment

ID: 12160925
Yes, you're correct; for this to work, the environment variable needs to be set on all workstations, in the machine environment.
You can first run the script as machine logon script (just noted that I orgot to mention that the script is still in test mode; remove the "ECHO" in front of the "setx" line to run it for real.), until the variable is defined at least on your W2k/XP machines (you'll have to add the UNC path to setx.exe as well). On your NT4 clients, you only have the logon script, and this runs in the user's context, who doesn't have enough permissions to set a machine environment variable.
Once the environment variable is set, you can change the profile paths.

Author Comment

ID: 12167249
oBda, i will explain the set up as im testing it now.

Using one windows 2k workstation to test;

I've created the env variable "OSVersion" and pointed it to WIN2k. I then copied the contents of our current working WIN2k profile into there to test functionality. I've created a test user (from a copy of a working user) however I have entered \\server5\netlogon\%OSVersion% in the profile path rather that \\server5\netlogon\username. I then tested the system variable was resolving correnclty from the 2K client by simply replicating the test users profile path in a run dialogue - It worked.


When i try to log the users on (from the machine with the new varaible installed) it did not work giving me the usual could not load profile error and quoting "\\server5\netlogon\%OSVersion%" as the path, as if it had not succesfully resolved the system variable.

However, i tried putting the same enviroment variable that id put on the workstation on the domain controller that the machine was attempting to log on to and it worked. So becasue i need to have a single env variable in every users path it could not work at present.

LVL 85

Accepted Solution

oBdA earned 2000 total points
ID: 12168220
I've used a similar construction for different user profiles in a mixed NT4/W2k Terminal Server environment.
Let's do it step by step.
On your W2k test workstation, right-click "My Computer", choose Properties, go to the Advanced tab, click the "Environment variables" button; in the "System(!) variables" section, click "New", enter (without the quotes) "OSVersion" as name, "Win2K" as value.
Reboot(!) the machine.
If your (physical) user profile path for your test user was \\server5\netlogon\%username% until now, create a subdirectory "Win2K" in your test users profile folder. Move the appropriate profile in there.
In ADUC, in the test user's profile, set the path to the roaming profile to \\server5\netlogon\%username%\%OSVersion%
Log on to the workstation with the test account, and it should now pull the Win2K profile.

Author Comment

ID: 12168361

it works, it was a very stupid gotcha. Id included a trailing \ in the system variable which was causing it not to work.

Thank you very much for this solution it has given me many ideas for improving the domain as a whole.


Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question