Link to home
Start Free TrialLog in
Avatar of gholton
gholton

asked on

user logon name in vbscript

Trying to get only the user logon name within a vbscript...  help
Avatar of gholton
gholton

ASKER

More specifically... I am trying to get the map a directory that uses just the first name or logon name.   \\computer\share\logon name\data.   \\testserver\excel\mark  where "Mark" is the name the user uses to login.  His full name is "Mark Smith"

we are using a logon script to do this and using the code below only gives us the full name

Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)

If InStr(strGroups, LABELS_GROUP) Then
    wshNetwork.MapNetworkDrive "l:", "\\testsever\excel\" & Currentuser.name
End If

Please help
ASKER CERTIFIED SOLUTION
Avatar of mdiglio
mdiglio
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gholton

ASKER

Thanks.

We give that a shot and see if we get better results...

Glenn
Avatar of gholton

ASKER

Thanks for you help mdiglio,  We are have solved are problem and moved on.  We ended up simply creating directories with the users full name and mapping our drive to that directory using the USERNAME variable.... forgetting about having it just be the users first name.

It works and all users report no problems.

We are closing out this question.
Best regards..

Glenn Holton
Glad you got it working!