Question Locked

DS Utilities & $username$

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm adding a user to 2003 server using

dsadd user "cn=masha,cn=users,dc=domain,dc=local" -samid masha -display masha -profile "\\server\profiles\$username$"

When I open up AD users & computers, the profile reads exactly "\\server\profiles\$username$"

In other words the $username$ never resolves into the user's username. When the user logs off, the new roaming profile folder is named $username$ for the username, not masha.

If I user %username%, it correctly resolves, exept it resolves to the admin account.

It doesn't matter if I use quotes or not.

My question is how do I get $username$ to resolve correctly to the user's username with the DS Utilities.

6 replies

by cg it

ok so is what your saying that when you put in $Joe User$ Active Directory doesn't properly create the user account rather puts in $username$ instead of the actual user name?

by dawgit

I would try it this way:
dsadd user "cn=masha,cn=users,dc=domain,dc=local" -samid masha -display masha -profile "\\server\profiles\$masha$"

Loose 'username' and replace with 'masha', the actual users name.

by multiplexed

Thanks for everyone's reponse so far. Unfortunately, this still isn't working.

I just tried replacing $username$ with $masha$, but the same thing happens. Masha's profle is set to "\\server\profiles\$masha$". It's still not resolving. The helpfiles say I should be able to use $username$ in the -profile parameter.

My book calls $username$ a "token", which I'm assuming is like a variable similar to %username%, that should resolve to the user's username.

by p.j.hutchison

Try:
set username=masha
then run the dsuser command using %username%.

by lowlands

using the %username% variable to set the homedirectory is great if you want to change this setting for a bunch of users at the same time. you're right, it is supposed to change it to the actual username. But since you add only the one user, why use it?

Why not use:
dsadd user "cn=masha,cn=users,dc=domain,dc=local" -samid masha -display masha -profile "\\server\profiles\masha"

Another thing to try would be to use %username%, instead of $username$

This discussion is closed to new replies.