Thank you. That was a good help
I've finally managed to get my full answer....
In our business... the username will be use as Initials for Office.
What this code do is search the Active Directory for the current username. Then get the Full name (Will be use as Full name within Office) then convert the string to HEX.
So here the code, executed at the logon
CODE
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
' get UserName
strName = oShell.ExpandEnvironmentStrings("%USERNAME%")
strContainer = "ou=MyOUInAD"
On Error Resume Next
' Constants for the NameTranslate object.
Const ADS_NAME_INITTYPE_DOMAIN = 1
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1179 = 1
Set objNetwork = CreateObject("Wscript.Network")
' Determine DNS domain name from RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
' Use the NameTranslate object to find the NetBIOS domain name from the
' DNS domain name.
Set objTrans = CreateObject("NameTranslate")
objTrans.Init ADS_NAME_TYPE_NT4, strDNSDomain
objTrans.Set ADS_NAME_TYPE_1179, strDNSDomain
strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
' Remove trailing backslash.
strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
' Use the NameTranslate object to convert the NT user name to the
' Distinguished Name required for the LDAP provider.
objTrans.Init ADS_NAME_INITTYPE_DOMAIN, strNetBIOSDomain
objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strName
strUserDN = objTrans.Get(ADS_NAME_TYPE_1179)
' Bind to the user object in Active Directory with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
'Get Common name
strUsername= objUser.cn
'Convert Initials to HEX
For i = 1 to Len(strName)
strInitialsHex = strInitialsHex & "," & Hex(Asc(Mid(strName, i, 1))) & ",00"
Next
strInitialsHex = Right(strInitialsHex , Len(strInitialsHex ) -1)
strInitialsHex = strInitialsHex & ",00,00"
'Convert Username to HEX
For i = 1 to Len(strUsername)
strUsernameHex = strUsernameHex & "," & Hex(Asc(Mid(strUsername, i, 1))) & ",00"
Next
strUsernameHex = Right(strUsernameHex, Len(strUsernameHex) -1)
strUsernameHex = strUsernameHex & ",00,00"
' Create temporary registry file
Const OverwriteIfExist = -1
Const FailIfExist = 0
Const OpenAsASCII = 0
Const OpenAsUnicode = -1
Const OpenAsDefault = -2
sTmpFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\UserInfo.reg"
Set fFile = oFSO.CreateTextFile(sTmpFile, OverwriteIfExist, OpenAsASCII)
' Write to the temporary registry file
fFile.WriteLine "Windows Registry Editor Version 5.00"
fFile.WriteLine
fFile.WriteLine "[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\UserInfo]"
fFile.WriteLine """UserName""=hex:" & strUsernameHex
fFile.WriteLine """UserInitials""=hex:" & strInitialsHex
fFile.Close
' Import the registry file
oShell.Run "regedit /s " & sTmpFile, 0, True
' Delete the temporary registry file
oFSO.DeleteFile sTmpFile
'Connect to network drive
Set oNetwork = WScript.CreateObject("WScript.Network")
oNetwork.MapNetworkDrive "z:", "%logonserver%\%username%\home"
Hope this help for someone else too
Thank you all for helping me out on this one