1

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_MACHINE\SOFTWARE\Microsoft\Office\16.0\Outlook

WHAT WE'VE TRIED
We tried running a .bat file containing the command REG QUERY HKLM\SOFTWARE\Microsoft\Office\16.0\Outlook /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
  • 2
    For the first question, it depends on what you will use this value to do. What do you want to accomplish after you know the answer? Commented Sep 5 at 14:33
  • I have to read values from Outlook. We have a library that has a lot of good features for reading Outlook values; the bitness of Outlook will determine whether or not i use the 32-bit version of the executable or the 64-bit version.
    – ezG
    Commented Sep 5 at 14:39
  • 2
    The first thing I'd advise is that you determine the bitness of the OS. Obviously if it's x86, there's no need to check that registry key at all. If it is necessary, perhaps this page may prove useful.
    – Compo
    Commented Sep 5 at 14:44
  • Our company has standardized on 64-Bit Windows. We're slowly migrating over to 64-bit Outlook, but it will be a while before that's completed.
    – ezG
    Commented Sep 5 at 14:46
  • 3
    If a .bat can read the key but SCCM can't, that smells like a permissions problem
    – Magoo
    Commented Sep 5 at 16:20

2 Answers 2

1

First, you can query the registry for the Bitness value:

$OutlookBitness = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Office\16.0\Outlook" -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
  • This is exactly what I'm already doing, but that doesn't work when run from within an SCCM package. SCCM can't locate the "Bitness" Value. We may have to run it with Admin privileges. We were hoping to avoid that.
    – ezG
    Commented Sep 6 at 15:05
0

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 HKLM\SOFTWARE\Microsoft\Office\16.0\Outlook /v "Bitness"

This works. I added "/reg:64 flag"
REG QUERY HKLM\SOFTWARE\Microsoft\Office\16.0\Outlook /v "Bitness" /reg:64

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.