Re: Good Day, Scripting Guru's
- From: Scott Cummins <scummins@xxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Apr 2007 13:16:01 -0700
Jeremy
I took your suggestion and just renamed the folders, It is easier and Yes, a
good practice to get into.
--
Scott A Cummins
Sr. Systems Engineer
Equity Analytics
( A division of Merrill Lynch)
14614 N. Keirland Blvd
Scottsdale, AZ 85254
480-998-3515
"Jeremy" wrote:
You can pull the display name out of AD with a vbscript. The normal.
practice is to use their usernames because that variable is available
everywhere, even when you create the user. Say you create a user called Bob
Smith whose user name is BSmith. When you put in their home path and
profile path variables and you type \\server\share\%username% ADUC does
variable iterpolation. This way a template user with all those paths can be
created.
I recommend you go through the pain of renaming them all now and changing
your practice to user the user name instead of the display name. It will be
better in the long run.
If you don't, here is some code that will get the display name into a
variable:
' Get full username from AD
Set oADSystemInfo = CreateObject("ADSystemInfo")
' get AD user object
Set oADsUser = GetObject("LDAP://" & oADSystemInfo.UserName)
' get full name of the current user
sDisplayName = oADsUser.DisplayName
'map the drive
Set WshNetwork = WScript.CreateObject("WScript.Network")
WSHNetwork.MapNetworkDrive "J:", "\\server\share\" & sDisplayName
I haven't tested this, but it should word.
"Scott Cummins" <scummins@xxxxxxxxxxxxxxxxx> wrote in message
news:E981048C-B5E9-460D-B755-20777CBD02AD@xxxxxxxxxxxxxxxx
Jeremy
Thanks for your input, Unfortuantely that doesn't seem to work, Unless i
am
doing something wrong. I may change the folder names to their username,
But
If I could use their display name somewhere it would be so helpful. Any
other
suggestions, from anyone?
--
Scott A Cummins
Sr. Systems Engineer
Equity Analytics
( A division of Merrill Lynch)
14614 N. Keirland Blvd
Scottsdale, AZ 85254
480-998-3515
"Jeremy" wrote:
Try:
net use J: \\servername\sharename\%username%
There is no environment variable called DISPLAYNAME on windows clients.
"Scott Cummins" wrote:
I am trying to write a little logon script that will map a user to his
own
folder on a seperate network drive, The folders are named the same as
their
display names, so I am basically trying to map a drive through group
policy,
My third
But since I am a colossal pinhead, I can't get my version to work
lets say i have a folder on a network share called "Colossal Pinhead"
which
would also be my display name, then I create a little batch file called
net use j:\servername\PST\%displayname%
and I set it to run at logon, would this work for me
--
Scott A Cummins
Scripting Novice
Equity Analytics
( A division of Merrill Lynch)
14614 N. Keirland Blvd
Scottsdale, AZ 85254
480-998-3515
- References:
- Re: Good Day, Scripting Guru's
- From: Jeremy
- Re: Good Day, Scripting Guru's
- Prev by Date: Hi! Nooblet Database searching question here!
- Next by Date: Re: Would like help witha script
- Previous by thread: Re: Good Day, Scripting Guru's
- Next by thread: Try this
- Index(es):
Relevant Pages
|