View Full Version : Env Variable %username% works strange


Sasi
09-27-2006, 10:45 AM
Hi,
I created a template user from which delegated admins make copy to create
new accounts.
the problem is that when I set that user profiles path like:

\\SciDC01\BSprof$\Bio\%username%\Roaming

the %sername% is NOT resolved to username after copy,it sticks to that
template user's logon name.
but when I set it to:

\\SciDC01\BSprof$\Bio\%username%

everything goes as expected.the %username% is resolved to each newly copied
account's logon name.

why is it like that?I want the first one to work.

Tim Timrawi
09-28-2006, 07:46 PM
Sasi,

That should work fine. We are doing that in many different places. Check if
you have a folder called %username% in Bio folder.

"Sasi" wrote:

> Hi,
> I created a template user from which delegated admins make copy to create
> new accounts.
> the problem is that when I set that user profiles path like:
>
> \\SciDC01\BSprof$\Bio\%username%\Roaming
>
> the %sername% is NOT resolved to username after copy,it sticks to that
> template user's logon name.
> but when I set it to:
>
> \\SciDC01\BSprof$\Bio\%username%
>
> everything goes as expected.the %username% is resolved to each newly copied
> account's logon name.
>
> why is it like that?I want the first one to work.

Sasi
09-30-2006, 02:34 PM
I think I did not make myself clear.
I have a template user named "temp01" from which I make copies to make new
user account.this user has \\SciDC01\BSprof$\Bio\%username%\Roaming
as its roaming profile path and there is NOT a %username% folder in bio;so
as there is documented in many places,windows will resolve the %username% to
"temp01" and creates the folder with that "temp01" name and with proper
permissions.
the problem is that it is documented that if I make copies from this temp01
(say "user01"),the %username% should change to the logon name of the newly
created user (here "user01").but in my case,it is still the old "temp01" name
and is NOT updated upon creating a new copy ,on the newly created user object.
the strange part is that when it is the last phrase in the roaming profiles
path,everything goes as expected,the %username% part is correctly updated to
"user01" and the folder is craeted under "user01" name and so on.but when
there is something after %username% (like %username%\roaming),it is updated
once for the template user and is NOT updated to user01.



"Tim Timrawi" wrote:

> Sasi,
>
> That should work fine. We are doing that in many different places. Check if
> you have a folder called %username% in Bio folder.
>
> "Sasi" wrote:
>
> > Hi,
> > I created a template user from which delegated admins make copy to create
> > new accounts.
> > the problem is that when I set that user profiles path like:
> >
> > \\SciDC01\BSprof$\Bio\%username%\Roaming
> >
> > the %sername% is NOT resolved to username after copy,it sticks to that
> > template user's logon name.
> > but when I set it to:
> >
> > \\SciDC01\BSprof$\Bio\%username%
> >
> > everything goes as expected.the %username% is resolved to each newly copied
> > account's logon name.
> >
> > why is it like that?I want the first one to work.