LiquidHonesty Posted June 5, 2006 Author Share Posted June 5, 2006 Ok, last question I promise.......is there also a variable I could use in the vbs script to write the user's actual name, not their username? Like the name that shows up on the Start Menu if you use the XP style start menu?Like how it uses %USERNAME% to pull the username, what about the actual name? Link to comment Share on other sites More sharing options...
Mr Snrub Posted June 5, 2006 Share Posted June 5, 2006 ...is there also a variable I could use in the vbs script to write the user's actual name, not their username?Short answer: no.Not a simple variable as used above - you would need to do a bit of work (or call a 3rd party tool) to achieve that.To get the display name without a separate tool you would need to construct and perform an LDAP query (or series of queries, recursively) against a DC (or number of DCs, to guarantee a result) to locate the user object based on its distinguished name and then a perform a query against it to get the DisplayName property out.There are way too many things that can go wrong here to make it worthwhile breaking my scripts above which are simple yet functional.You could try to parse someting like the output from GPRESULT or WHOAMI but I wouldn't consider it worth the bother.I don't know of any WMI class that can be used to obtain the display name of the currently logged-on user, only user accounts (local and domain). Link to comment Share on other sites More sharing options...
LiquidHonesty Posted June 5, 2006 Author Share Posted June 5, 2006 Short answer: no.Not a simple variable as used above - you would need to do a bit of work (or call a 3rd party tool) to achieve that.To get the display name without a separate tool you would need to construct and perform an LDAP query (or series of queries, recursively) against a DC (or number of DCs, to guarantee a result) to locate the user object based on its distinguished name and then a perform a query against it to get the DisplayName property out.There are way too many things that can go wrong here to make it worthwhile breaking my scripts above which are simple yet functional.You could try to parse someting like the output from GPRESULT or WHOAMI but I wouldn't consider it worth the bother.I don't know of any WMI class that can be used to obtain the display name of the currently logged-on user, only user accounts (local and domain).That's ok, I just had to ask. I can make do with just the UN as a simple query on the domain gives me the actual name if I need to figure it out. Thanks again for ALL your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now