I am scripting MS Office Communicator 2005 and would like to autopopulate the user's email address before they start the program.

I would like to know how to obtain the user's full name (in the john.smith format) as a Variable so that I can enter the value as a %VAR% into the registry automatically. I have already created a script to do this I just need to know how to get the user name (or net user /fullname)(from the login credentials) in the correct form.

I have created the MST to autopopulate the LCS server name and am stuck on how to get the user's name into the correct fomat.

Even the first name as %FIRST% and the last name as %LAST% would achieve the goal - since I have also created a batch file to populate the registry based on a variable.

If my company used the employees UserName (%username%) then this would already be done.

Anybody care to assist? Thanks in advance for any and all help that you can provide.

Lks Dcvn
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
The following vb script gets the SIP address from the AD (Live Communicator server has been set up) and writes it to the user profile - it may help...
Here the SIP address is not the same as a user's email address and isn't predictable so we need to query the AD at logon.

On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
Set objSysInfo = CreateObject("ADSystemInfo")
strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)
address = objUser.Get("msRTCSIP-PrimaryUserAddress")
address = Replace(address,"sip:","")
'msgbox address
objShell.RegWrite "HKCU\Software\Microsoft\Communicator\UserMicrosoft RTC Instant Messaging" , address

Regards,
Al
Answered 01/17/2007 by: AB
Purple Belt

Please log in to comment
0
I added a custom action to the MST and had it run internally to the MST - worked out awesome! Had to tweak the mst to get it to work the way that I wanted - looks like more scripting practice is needed here...

Thanks for the assist (and the speedy response)!

Have a great day!

Lks Dcvn
Answered 01/17/2007 by: lks dcvn
Senior Yellow Belt

Please log in to comment
0
Very nice script, I modified it even further to pull the current logged on user and add it to the end of the address so all the user needs is to enter their password.
Answered 03/06/2007 by: elgwhoppo
Senior Purple Belt

Please log in to comment
0
Here is my modified script to add the current logged on user information with commented out debugs & options. It assumes you are on a domain, so if you're in a workgroup, just use the simple one above, or modify it as needed. You can either set this script to run at every logon for every user (Place file path in registry string, at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", or do an ActiveSetup so it only runs once for each user that logs on the PC.

On Error Resume Next
Dim existingsipentry, keylocation, USER, DOMAIN, FULLUSERNAME, net, fso, logonstring
Set objShell = CreateObject("WScript.Shell")
Set objSysInfo = CreateObject("ADSystemInfo")
Set WSHShell = CreateObject("WScript.Shell")
Set Net = CreateObject("WScript.Network")
Set fso=CreateObject("Scripting.FileSystemObject")
Set EnvVar = WshShell.Environment("SYSTEM")

'Input Existing String
keylocation = "HKCU\Software\Microsoft\Communicator\"
existingsipentry = WSHShell.RegRead(keylocation & "UserMicrosoft RTC Instant Messaging")
'WScript.echo "existingsipentry " & existingsipentry
'Get email address from DRA
strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)
address = objUser.Get("msRTCSIP-PrimaryUserAddress")
address = Replace(address,"sip:","")
'WScript.echo "Address pulled from DRA: " & address
USER = WshShell.ExpandEnvironmentStrings("%USERNAME%")
DOMAIN = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
FULLUSERNAME = DOMAIN+"\"+USER
logonstring=address+" "+FULLUSERNAME
'WScript.echo "Current Address to compare: " & left(logonstring,9)
If left(logonstring,9)=" "+DOMAIN+"\" Then
'WshShell.Popup"Microsoft Communicator was unable to automatically obtain your login information. ",20,"Microsoft Office Communicator: Auto Login Information"
WshShell.RegDelete "HKCU\Software\Microsoft\Active Setup\Installed Components\{0EEB34F6-991D-4a1b-8EEB-772DA0EADB22}\"
ELSE
'Troubleshooting: what is being written to Address
'WScript.echo "Writing this to address " & address
objShell.RegWrite "HKCU\Software\Microsoft\Communicator\UserMicrosoft RTC Instant Messaging" , logonstring
END IF
Answered 09/27/2007 by: elgwhoppo
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity