I normally use the code below:
Pete
Option Explicit
Const HKCU = &H80000001
Dim strComputer, strUsername, sBinUsername, oReg, strKeyPath, strValueName, strWriteNewValue
Dim objWshNetwork, WshShell
Set objWshNetwork = CreateObject("WScript.Network")
Set WshShell = Wscript.CreateObject("Wscript.Shell")
strComputer = "."
strUsername = objWshNetwork.UserName
OfficeUserName
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'Write Office username to the registry
'
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sub OfficeUserName
sBinUsername = ToByteArray(strUsername)
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Office\11.0\COMMON\USERINFO"
strValueName = "UserName"
oReg.CreateKey HKCU, strKeyPath
strWriteNewValue = oReg.SetBinaryValue(HKCU, strKeyPath, strValueName, sBinUsername)
Wscript.echo "@@@@@ Writing Username for Office"
If strWriteNewValue <> 0 Then
'An error occurred
WScript.Echo "Error, return code: " & strWriteNewValue
Exit Sub
End If
End Sub
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'Function to create an array of binary values
'
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Function ToByteArray(ByVal sString)
Dim iIndex, iPos
ReDim aBytes(Len(sString) * 2 + 1)
iIndex = -1
For iPos = 1 To Len(sString)
iIndex = iIndex + 1
aBytes(iIndex) = Asc(Mid(sString, iPos, 1))
'add a 0 after each letter
iIndex = iIndex + 1
aBytes(iIndex) = 0
Next
'add two closing 0's
iIndex = iIndex + 1
aBytes(iIndex) = 0
iIndex = iIndex + 1
aBytes(iIndex) = 0
ToByteArray = aBytes
End Function
From: thin-bounce@freelists.org [mailto:thin-bounce@freelists.org] On Behalf Of Carl Stalhood
Sent: Friday, 3 April 2009 9:18 AM
To: thin@freelists.org
Subject: [THIN] Re: Office 2003 Suppress User name popup
There seems to be a script at the bottom of http://www.msfn.org/board/lofiversion/index.php/t37663.html. I've never used it.
On Thu, Apr 2, 2009 at 6:12 PM, Angela Smith <angela_smith9@hotmail.com> wrote:
Hi Jim
I need to set this for 600 users so I cannot manually do it.. I need to be able to script it..
Ang
Date: Thu, 2 Apr 2009 08:20:44 -0400
Subject: [THIN] Re: Office 2003 Suppress User name popup
From: jkenzig@gmail.com
To: thin@freelists.org
Did you try just opening up the default users ntuser.dat in regedit on the server and prepopulating the key? (also look under HKLM/current/ms/ windows nt/terminal server/ installed/ office/common etc key for the same settings and populate it) The change user /install trick works for this also.
Jim Kenzig
Blog: http://www.techblink.com
Twitter: http://twitter.com/kenzig
Twitter: http://twitter.com/InternetPilot
On Thu, Apr 2, 2009 at 4:02 AM, Angela Smith <angela_smith9@hotmail.com> wrote:
Hi
Im having lots of issues finding a VB script that will update this office key. Does anyone have a VB script that will update this. Id like to have the script interrogate AD so the real user name is used but anything is better than nothing. Even if it populated the user key with a generic name I would be happy.
Subject: [THIN] Re: Office 2003 Suppress User name popup
Date: Tue, 31 Mar 2009 16:41:40 +1100
Hi Angela,
You would need to pre-populate the HKCU\Software\Microsoft\Office\Common\UserInfo Key with the UserName, UserInitials, Company values.
You could either, create a login script that does this, create and ADM file for the keys, include the values in your default user profile, or you could enter this information at the Office installation time, when Terminal Services redirects HKCU changes to the shadow area (though I won’t recommend this last option)
I am sure, someone with a little more time here, will be able to provide you with some script snippets to include in a login script.
Cheers,
Christoph
From: thin-bounce@freelists.org [mailto:thin-bounce@freelists.org] On Behalf Of Angela Smith
Sent: Tuesday, March 31, 2009 4:28 PM
To: thin@freelists.org
Subject: [THIN] Office 2003 Suppress User name popup
Hi
I need to find a way to remove the MS Office User Name popup box that pops up on first use when using office 2003. We do not use roaming profiles so our users get this popup on first use each day. Has anyone suppressed this popup via Group Policy?. Has anyone created an ADM file to suppress this?
Thanks
Ang
Get what you want at ebay. View photos of singles in your area
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Let ninemsn property search for you. Need a new place to rent, share or buy?
Download it here. The new Windows Live Messenger has landed.
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.278 / Virus Database: 270.11.31/2028 - Release Date: 04/01/09 21:02:00
No comments:
Post a Comment