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
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)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
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 :-)
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
15 years ago
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
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
15 years ago
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
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
15 years ago
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
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
15 years ago
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
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
15 years ago
Huh?
Problem is with VBS afaik there's no way to enumerate all te CU hives that are present on the PC
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
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.