P
Phil Teale
Hi,
I am in the process of writing a logon script that will set up shares
and home directories according to the groups the user belongs to.
I have written an ADSI to query their AD record and the resultant
string is searched to see if it contains "IT", "Marketing", "Sales"
etc. This works fine when the username is passed as a command line
argument, but I would like the script to accept their logon name
directly.
%username% doesn't appear to work inside VBS, and I have tried the
following
Set objNet = WScript.CreateObject("WScript.Network")
strUsrName = objNet.UserName
this returns "JBloggs", but the AD entry is "Joe Bloggs", so there is
no match.
My Question is this: Is there an object property that contains the
logon name "JBloggs" and the AD object name "Joe Bloggs"? This would
let me pass the full name to the logon script and all would be fine
and dandy.
TIA
Phil Teale
I am in the process of writing a logon script that will set up shares
and home directories according to the groups the user belongs to.
I have written an ADSI to query their AD record and the resultant
string is searched to see if it contains "IT", "Marketing", "Sales"
etc. This works fine when the username is passed as a command line
argument, but I would like the script to accept their logon name
directly.
%username% doesn't appear to work inside VBS, and I have tried the
following
Set objNet = WScript.CreateObject("WScript.Network")
strUsrName = objNet.UserName
this returns "JBloggs", but the AD entry is "Joe Bloggs", so there is
no match.
My Question is this: Is there an object property that contains the
logon name "JBloggs" and the AD object name "Joe Bloggs"? This would
let me pass the full name to the logon script and all would be fine
and dandy.
TIA
Phil Teale