/build/static/layout/Breadcrumb_cap_w.png

Listing ALL Office versions and languages

Heya all!

I was wondering if any of you previously had to develop a script to list all installed Office Versions and Languages on your AD? We got such a request recently. While the first part is actually quite easy to find, the language isn't a snap as I thought it would be.

For the vast majority of Office's installed, I can find the language under HKLM\Software\Microsoft\Office%VERSION%\Common\LanguageResources\SKULanguage.

However, this key IS NOT present with my Office 2000 installations. So I'm kind of hitting a stump with my VBS now... How do i find a way to sniff out Office 2000 languages? I would need something pretty rock solid since we are spearheading this project, and we're getting the script out to non standard PC's which mean GOD KNOW'S how Office would of been installed on those computers.

Any ideas?

Thanks!

Stephane

0 Comments   [ + ] Show comments

Answers (7)

Posted by: anonymous_9363 14 years ago
Red Belt
0
According to http://office.microsoft.com/en-us/ork2000/HA011383651033.aspx, you have the right key but may need to check HKCU as well.

BTW, Stephane, it should be "would HAVE", not "would OF". Because the contraction "would've" sounds like it should be written that way, it's a mistake English speakers make, too.

Oh, and while we're about it, ditch the apostrophe in "PC's" and "GOD KNOW'S". Apostrophes are used to contract the verb "to be", i.e. "it is" becomes "it's" or to indicate possession e.g. "the boy's ball". Note, however, that possession by "it" (e.g. "its colour was fading") does NOT attract usage of the apostrophe, another all too common error. Plural possessive forms will confuse you even more: if the ball belongs to more than one boy, we get the "the boys' ball".

More reading for you http://en.wikipedia.org/wiki/Apostrophe and http://www.meredith.edu/grammar/plural.htm :-)
Posted by: Fau 14 years ago
Senior Purple Belt
0
LoL

Yeah Ian, you are totally right. It would be better if I'd taken a minute to read my wall of text first :-) Although to my defense, I'm French Canadian, English being a second language to me! :-)

As for the answer you gave me... You are right about that, and the information is indeed in HKCU. However, when I run the script from my PC, with my credentials, it seems that the script can't recuperate the information in HKCU. Is this possible? Is my script missing something?

Thanks!

Stephane
Posted by: pjgeutjens 14 years ago
Red Belt
0
I'm pretty sure that if you run your script with your credentials, the CU hive in the registry that it will have access to won't be that of the currently logged-on user. It's the same as doing a runas of regedit with different credentials. The HKCU you'll see won't be that of the user that's actually logged in at that moment.

Problem is with VBS afaik there's no way to enumerate all te CU hives that are present on the PC. So you'll need to have the script run with the credentials of the user that's actually logged on.

PJ
Posted by: Fau 14 years ago
Senior Purple Belt
0
Indeed what I was thinking.

I was thinking of maybe just recursively searching HKU... It will be longer, but speed isn't an issue. Just getting the information is. So i was thinking of adding a script that searches in HKU until the information is found.

Unless you guys have a better idea that is!

Stephane
Posted by: pjgeutjens 14 years ago
Red Belt
0
I did some searching and found out that you can actually reach the HKU using VBS and WMI

this link gives a nice example of this.

A way to identify the user that's currently logged in that I always use is that it's the only one to have a "Volatile Environment" Key under HKU\<SID>\, might speed up your search, but I guess this assumes there actually IS a user logged in to the machine.

Also note that on Win2000SP4 you'll need a hotfix to make this work as intended. see here

PJ
Posted by: anonymous_9363 14 years ago
Red Belt
0

Problem is with VBS afaik there's no way to enumerate all te CU hives that are present on the PC
Huh?

The Shell object's registry interface is poor, that's all. If you use the WMI registry namespace, you're fine. Even better, download JSWare's registry class (which abstracts the WMI stuff) and you're even finer. I think it's part of the JSW class pack.

Once you have that, you can enumerate HKEY_USERS. You may also find a routine to convert SIDs to usernames useful: Function GetSIDFromUser(ByVal strDomainName, ByVal strUserName, ByRef strSID)
Dim objSWBemlocator
Dim objWMIService
Dim strQuery
Dim objAccount
Dim strRemoteUserName
Dim strRemotePassword

GetSIDFromUser = False

strRemoteUserName = ""
strRemotePassword = ""

On Error Resume Next

Set objSWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWBemlocator.ConnectServer(strComputer,"root\CIMV2",strRemoteUserName,strRemotePassword)
'Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
If Err <> 0 Then
Exit Function
End If

strQuery = "Win32_UserAccount.Name='" & strUserName & "',Domain='" & strDomainName & "'"

Set objAccount = objWMIService.Get(strQuery)
strSID = objAccount.SID

On Error GoTo 0

GetSIDFromUser = True

Set objAccount = Nothing
Set objWMIService = Nothing
Set objSWBemlocator = Nothing
End Function

Function GetUserFromSID(ByVal strDomainName, ByVal strSID, ByRef strUserName)
Dim objSWBemlocator
Dim objWMIService
Dim strQuery
Dim objSID
Dim strAccount
Dim objAccount
Dim strRemoteUserName
Dim strRemotePassword

GetUserFromSID = False

strRemoteUserName = ""
strRemotePassword = ""

On Error Resume Next

Set objSWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWBemlocator.ConnectServer(strComputer,"root\CIMV2",strRemoteUserName,strRemotePassword)
If Err <> 0 Then
Exit Function
End If

'// Get account name first
strQuery = "Win32_SID.SID='" & strSID & "'"
Set objSID = objWMIService.Get(strQuery)
If Err <> 0 Then
Exit Function
End If

strAccount = objSID.AccountName
If Err <> 0 Then
Exit Function
End If

'// Now query for full name
strQuery = "Win32_UserAccount.Domain='" & strDomain & "',Name='" & strAccount & "'"

Set objAccount = objWMIService.Get(strQuery)
If Err <> 0 Then
Exit Function
End If

strUserName = objAccount.FullName
If Err <> 0 Then
Exit Function
End If

On Error GoTo 0

GetUserFromSID = True

Set colItems = Nothing
Set objWMIService = Nothing
Set objSWBemlocator = Nothing
End Function
Posted by: pjgeutjens 14 years ago
Red Belt
0
I did some searching and found out that you can actually reach the HKU using VBS and WMI

I humbly stand corrected. I believe someone told me there was a problem with VBS and HKU awhile ago. That'll teach me not to believe everything I'm told [:D]
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