/build/static/layout/Breadcrumb_cap_w.png

Communicator 2005 - need to define variables for user name

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

Answers (4)

Posted by: AB 17 years ago
Purple Belt
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
Posted by: lks dcvn 17 years ago
Senior Yellow Belt
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
Posted by: elgwhoppo 17 years ago
Senior Purple Belt
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.
Posted by: elgwhoppo 16 years ago
Senior Purple Belt
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ