We help IT Professionals succeed at work.

Logon Script to Pull Windows Usersnames for Excel

Hey Everyone,

 Is their anyway i can have a logon script on my domain to pull the Windows Users log on name so when they open a shared Excel workbook file and you go to see who is logged on it will automatically put the users name in their. Right now it just says Windows User.

Comment
Watch Question

BRONZE EXPERT

Commented:
You could have every one open their Excel and go to : File-->Options-->General--> and then enter their individual user names in the box labeled user name. This way you can always know who has a file locked.
Ray ZuchowskiIT Director

Author

Commented:
Yeah but then the user is responsible for doing that on any machine they log on. I want it automatic.

Commented:
Run from command line >set username

I believe the value would be something Office has in the registry which you could modify
BRONZE EXPERT

Commented:
I have a solution in mind that is automatic, but it's ugly. I'll wait and see if ^^ works for you.
Ray ZuchowskiIT Director

Author

Commented:
http://social.technet.microsoft.com/Forums/en-US/office2007deployment/thread/621b3142-d096-4da5-a882-ce216ae8e98c


ok so i found that article... i did it on my pc from command prompt and it worked great. How do i deploy this on gpo ?
Commented:
If the method is ScriptAddict's first comment does work, here is a VBS login script that will set that automatically for the users.
Set oADSystemInfo = CreateObject("ADSystemInfo") 

Set oADsUser = GetObject("LDAP://" & oADSystemInfo.UserName) 

sDisplayName = oADsUser.DisplayName

Set oShell = CreateObject("WScript.Shell")

oShell.RegWrite "HKCU\Software\Microsoft\Office\Common\UserInfo\UserName",sDisplayName

Open in new window

Explore More ContentExplore courses, solutions, and other research materials related to this topic.