We would like to be able to detect if a user is running either 32-Bit or 64-bit Outlook.
Based on the returned value, we’ll be running the appropriate script.
Using SCCM, how can we read the value “Bitness” from the HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice16.0Outlook
WHAT WE’VE TRIED
We tried running a .bat file containing the command
REG QUERY HKLMSOFTWAREMicrosoftOffice16.0Outlook /v “Bitness”, but when run from an SCCM package, it cannot read values from any key.
We tried a Powershell Script, all I saw was the working directory briefly pop-up on the screen and the script stopped running.
QUESTION
- Is there a way that SCCM can directly read a value without relying on a script?
- Is there a way to write a script so that SCCM will use it to find the registry value?
Any workable solution not investing in some new piece of software is acceptable.
8
First, you can query the registry for the Bitness value:
$OutlookBitness = Get-ItemProperty -Path "HKLM:SOFTWAREMicrosoftOffice16.0Outlook" -Name "Bitness"
$OutlookBitness.Bitness
will then give you the detail you need, either x64
or x86
, and you can use this to branch in your script to execute your next steps. For example:
if ($OutlookBitness.Bitness -eq 'x64')
....
1
It turns out that I could do this with my old batch file, but I needed to add a flag.
TWO SAMPLE COMMAND LINES THAT ARE IN A BATCH FILE THAT IS LAUNCHED FROM SCCM
This one does NOT find the “Bitness” registry value.
REG QUERY HKLMSOFTWAREMicrosoftOffice16.0Outlook /v “Bitness”
This works. I added “/reg:64 flag”
REG QUERY HKLMSOFTWAREMicrosoftOffice16.0Outlook /v “Bitness” /reg:64