Silent Deployment of QuickBooks 2022


In most applications that we package for silent install and uninstalls, the process is simple: review the vendor’s site/documentation for command line parameters, use typical command line help requests like “/help” or “/?”, or do what you’re doing right now and search the internet to find out what others have found. Why try to do the same work that someone else has willingly shared?

Well, QuickBooks is one of those pieces of software that has drives many a Systems Administrator nuts. It was clear after scouring the internet that Intuit was not interesting in simplifying the deployment of their software. Below, I hope to show you all what I’ve gathered to silently install and uninstall QuickBooks via PowerShell script and then through MECM.

Silent Install

When you first obtain your downloaded installation files from QuickBooks, you will likely have a “QuickBooksFlavorXX.exe” file, where the Flavor is either Pro, Premier, or Enterprise (I’ll be using “QuickBooksEnterprise22.exe”). From here, you can extract the contents to a folder to get the pre-requisites, the main setup.exe, and the quickbooks.msi. There are several sites that have steps and documentation for using Orca or other tools to modify the quickbooks.msi file or to create an .MST file. I used this method for QuickBooks 2016 as well, but when our site upgraded to QuickBooks 2019 (and now QuickBooks 2022), I use a simpler method I found from a post on one of Intuit’s forums to pass the MSI commands to the the “QuickBooksFlavorXX.exe”:

QuickBooksEnterprise22.exe -s -a QBMIGRATOR=1 MSICOMMAND=/s QB_PRODUCTNUM=XXX-XXX QB_LICENSENUM=YYYY-YYYY-YYYY-YYY MULTIUSERINSTALL=1 CKBOX_GDS=2 QBUPGRADEORNEW=new RebootYesNo=No AgreeToLicense=Yes FEATUREENABLED=ZZZ
  • XXX-XXX is the Product Code
  • YYYY-YYYY-YYYY-YYY is your License Number
  • ZZZ is your QuickBooks flavor:
    • pro = QuickBooks Pro
    • superpro = QuickBooks Premier (not Accountant Edition)
    • accountant = QuickBooks Premier Accountant Edition
    • bel = QuickBooks Enterprise Solutions (not Accountant Edition)
    • belacct = QuickBooks Enterprise Solutions Accountant Edition

Switching that all to PowerShell:

Start-Process ".\QuickBooksEnterprise22.exe" -ArgumentList '-s -a QBMIGRATOR=1 MSICOMMAND=/s QB_PRODUCTNUM=XXX-XXX QB_LICENSENUM=YYYY-YYYY-YYYY-YYY MULTIUSERINSTALL=1 CKBOX_GDS=2 QBUPGRADEORNEW=new RebootYesNo=No AgreeToLicense=Yes FEATUREENABLED=ZZZ' -Wait

This will silently install QuickBooks on your machine. However, if we stop here, each user will be shown the selection window for the “flavor of QuickBooks”, and I don’t want this to cause issues for the users if they make the wrong selection or to confuse them and cause additional service calls. Using the “Create or Re-create the QBregistration.dat file” as a guide, we can create a new qbregistration.dat file (or install QuickBooks on a test machine and copy it from that machine) to copy it to other machines.

If (!(Test-Path -Path "C:\ProgramData\Common Files\Intuit\QuickBooks")) {
    New-Item -Path "C:\ProgramData\Common Files\Intuit\QuickBooks" -ItemType Directory -Force
}
Copy-Item -Path "qbregistration.dat" -Destination "C:\ProgramData\Common Files\Intuit\QuickBooks" -Force

Lastly, if you’re like me and you’ve experienced the pain of managing the updates and company files and prompts to users to update, you’ll also want to ensure that all your clients stay on the same version and release and disable the automatic update. The simplest way is to copy a pre-configured “QBchan.dat” file to the machine, and the only line that needs to be modified is:

[ChannelInfo]
BackgroundEnabled=0

After changing that setting manually or through a test install of QuickBooks, the file can be copied to the machines:

Copy-Item -Path ".\Qbchan.dat" -Destination "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 22.0\Components\QBUpdate\Qbchan.dat" -Force

Lastly, we want to clear out any startup items that are created from the install, and QuickBooks’ legacy way of handling that is through Startup shortcuts. Let’s delete them.

Get-Item -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\Intuit Data Protect.lnk" -ErrorAction SilentlyContinue | Remove-Item -ErrorAction SilentlyContinue -Force
Get-Item -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\QuickBooks Web Connector.lnk" -ErrorAction SilentlyContinue | Remove-Item -ErrorAction SilentlyContinue -Force
Get-Item -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\QuickBooks Update Agent.lnk" -ErrorAction SilentlyContinue | Remove-Item -ErrorAction SilentlyContinue -Force
Get-Item -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\QuickBooks_Standard_21.lnk" -ErrorAction SilentlyContinue | Remove-Item -ErrorAction SilentlyContinue -Force

Silent Uninstall

Uninstalling QuickBooks silently introduces a bit more fun. I used the MSI codes from all the pre requisites as well as the main install, but for the main install, that wasn’t enough. When searching the registry for the UninstallString, I found several more parameters: “UNIQUE_NAME”, “QBFULLNAME”, and “ADDREMOVE”. Then, when I tried to uninstall it with those extra parameters, the uninstall quit right away. I’ll reiterate again: QuickBooks does NOT care about your feelings when it comes to keeping this installer (and uninstaller) completely quiet. To that end, it didn’t seem like QuickBooks would recognize the “/qn” MSI parameter, so I used either the “/qr” or “/qb”:

Start-Process msiexec.exe -ArgumentList '/X {B9BE758E-50B5-4BA7-987B-63184123AA1A} UNIQUE_NAME="bel" QBFULLNAME="QuickBooks Enterprise Solutions 22.0" ADDREMOVE=1 /qb' -Wait

YAY! A silent uninstall…kind of. Because it didn’t pass the “/qn”, we aren’t stopping the processes that the installer wants us to, so we will get prompted to stop the QuickBooks application (if it’s running), the Database Manager, the Intuit Data Protect, and any other QuickBooks process. Let’s add a service check just before uninstall to quit all those services:

Get-Process | Where-Object {($_.Name -like "Intuit*") -or ($_.Name -like "QBIDPService*") -or ($_.Name -like "QBDBMgrN*")} | Stop-Process -Force

There! Now, you can just copy those scripts and files to a USB drive or network share and run the installs on the necessary machines. But if you’re like me, we want full automation, not Doing IT By Hand.

Configuring in MECM

For our site, we were upgrading from QuickBooks Enterprise 2019 to QuickBooks Enterprise 2022, so we wanted to make sure to remove the previous version before installing the new version (which is why the silent uninstall was so critical, and also applies in practice to 2019!). While not going through the specific details of the application setup in MECM, the basic setup is below:

  • Application: QuickBooks 2022
    • Supersedes QuickBooks 2019 (with uninstall)
  • DeploymentType: Silent Install QuickBooks 2022
    • MSI Detection
    • Different content sources for install/uninstall (to save time for calling the scripts to uninstall)

If the scripts work in Windows running as an administrator, they should work in MECM running as SYSTEM, right? WRONG! This is QuickBooks! After a successful installation (in terms of a correct MSI detection), we get the dreaded PS107 error:

QuickBooks PS107 Error

After much research, this can be resolved is a two ways: 1) update QuickBooks, or 2) repair/reinstall QuickBooks. Both options don’t lend themselves to easy, automated options. Even though QuickBooks provides QBWebPatch downloads for all versions and claims to provide documentation for it’s silent installation, it still prompts on installation to click OK. Not helpful.

However, knowing that that update does resolve the issue could help in pinpointing which files are needed to be updated to clear the error. Indeed, even though we are not a Payroll site, the “ESGServices.dat” file was the critical update file for the PS107 error. Now, to add that to our installation sources and script:

Copy-Item -Path ".\Payroll\Esgservices.dat" -Destination "C:\Program Files\Intuit\QuickBooks Enterprise Solutions 22.0\Components\Payroll\ESGServices.dat" -Force

Now that the installation is working as we would like it to, when we attempt to uninstall QuickBooks through MECM (Software Center), it does its attempt very quickly before failing and saying “Retry”. What could be wrong now??

Well, if you recall, we couldn’t use the “/qn” for the uninstall script and were forced to use the “/qr” or “/qb” parameters. Each of the latter parameters requires an interaction with a user profile as it presents an installation box. When SYSTEM is performing the work, that environment isn’t present. To workaround that issue and to make the uninstall as silent as possible (I sometimes like to use “unattended” for this since it’s not silent, but it’s hands-off), we can set the Deployment Type for the QuickBooks application to “Allow users to view and interact with the program installation”. Additionally, it might be helpful to also change the “Logon Requirement” to “Only when a user is logged on” to prevent errors in the Monitoring on uninstallations when no user is logged on and the superseded application fails to uninstall.

QuickBooks Deployment Type

Now, we can successfully install and uninstall QuickBooks “silently”. I hope this explanation saves you a bit of time for this application, and possibly helps you with another one.


7 responses to “Silent Deployment of QuickBooks 2022”

  1. I’m having issues getting new installs to accept the qbregistration.dat file I pre-configured on a test machine. The “Select QuickBooks Desktop Industry-Specific Edition” window still appears despite the pre-configured file existing.

    What’s even weirder is if I remove the pre-configured qbregistration.dat file and attempt to create a new one, the whole program breaks and only a re-install fixes.

    Ever ran into this issue?

    • Erick,

      YES! It’s a very frustrating issue, but it always pointed back to the formatting of the qbregistration.dat file. Is your pre-configured one from after you made a selection for the industry? If not, you’ll want to do that as it writes information to the file during that process.

      Removing the qbregistration.dat file and attempting to create a new one will break the registration with the files located in the “C:\ProgramData\Intuit\Entitlement Client\v8” folder after first launch (it’s empty otherwise). If you delete those files, you should be able to “re-register” Quickbooks with a new qbregistration.dat file, or with the same one.

      Ricky

      • Ricky

        Yes, the qbregistration.dat file that is pre-configured was pulled after I manually installed everything (including going through all of the screens that open on first launch).

        I even confirmed QB 2022 was working on my test machine prior to pulling it.

        To test, I completely uninstalled QB from the test machine (including deleting all Intuit folders found within Program Files and ProgramData) then re-installed by utilizing the script (which works incredibly well!).

        Afterwards, I confirmed that all files matched in size and date modified to ensure that files were copied correctly.

        Then, boom, Select Edition screen. Makes no sense to me.

        Now that I know that the Entitlement Client folder is definitely tied to the qbregistration.dat file, I have some ideas to try.

        One question I do have – what version of QB 2022 did you use when you got this working? I’m currently using the R4 release. Just curious if that may be the key.

        Finally, not sure if your users are like mine but…
        I put some logic at the end of the Install powershell script to scan every user profile for the QBWUSER.INI file that exists for QB 2019. This file contains all previously accessed QB company files and where they’re located. My users literally lose their mind and have no idea how to repoint to their QB company files if I don’t do this.

        Luckily, simply copying it from the 19 to 22 folder within AppData is all that’s needed.

        If interested, I can provide that code.

        • Erick,

          I just re-tested this: can you see if you have the section “ActivatedProduct”ZZZ”/ActivatedProduct” (where ZZZ is the Quickbooks flavor, replaceing the quotes with brackets) in the qbregistration.dat file, right after the “/QBMode”? When I removed that portion, I was prompted with the industry selection, but when I put in back in, everything went right through.

          And yes, all of our users struggled with the “missing” company files or opening them in single-user mode. Feel free to share what you have for retaining that information as I’m sure other could benefit from it as well. We have a knowledge base article for our users, but sometimes that isn’t enough!

          Ricky

  2. Ricky

    So I’m showing 2 sections with ActivatedProduct…

    The one that shows after /QBMode at the beginning has nothing contained and doesn’t appear to affect the Industry selection screen at all as I completely removed it and it proceeded without getting the Industry prompt.

    The interesting piece is the one that shows after /VersionNumber towards the bottom. If I remove it from the file and launch QB, I’ll get the Industry selection screen but the option we typically select (Professional Services) is greyed out with wording that states its “Separately installed”.

    If I add that section back after /VersionNumber, it skips as expected.

    Still, that section after /VersionNumber is contained within the file I deploy so still no breakthrough. Below is the qbregistration.dat data that I pulled with our license data removed. I adjusted the spacing for easy viewing.

    YES
    XXXXXX
    XXXXXXXXXXXXXXX

    00005fd77383

    YES
    XXX-XXX
    XXXX-XXXX-XXXX-XXX

    0000270f365f

    belprofessional

    As for the code to pull the QBWUSER.ini from QB 19 to QB 22, see below.

    $users = Get-ChildItem c:\users

    foreach ($user in $users){

    $folder = “$env:SystemDrive\users\” + $user + “\AppData\Local\Intuit\QuickBooks Enterprise Solutions 19.0\QBWUSER.INI”
    $newfolder = “$env:SystemDrive\users\” + $user + “\AppData\Local\Intuit\QuickBooks Enterprise Solutions 22.0”
    $intuitfolder = “$env:SystemDrive\users\” + $user + “\AppData\Local\Intuit”
    $folderpath = test-path -Path $folder

    if($folderpath)
    {
    New-Item -Path $intuitfolder -Name “QuickBooks Enterprise Solutions 22.0” -ItemType “Directory”
    Copy-Item -Path $folder -Destination $newfolder
    }
    }

    • Erick,

      Are you saying you have two whole registration sections, each with the Product Key and Serial Number? If so, if you haven’t reduced it to once section (not sure if that was what you were saying exactly), I would try that. In the qbregistration file, I am only using one section of all that information. I’m also unsure if the location of the ActivatedProduct section has an effect on the registration. That might be something to test as well.

      Ricky

      • Ricky

        That’s exactly what I’m saying.

        So here’s where I am with this…

        So by clearing out the section under FLAVOR name=”bel” and only leaving the bottom section starting with FLAVOR name=”belprofessional”, I began getting expected results on the test VM.

        However, when pushing via MECM to a different PC, upon initial launch, I’d still get the “Select QuickBooks Desktop Industry-Specific Edition” window. Frustrated and annoyed when I worked on this on 4/22, I restarted the test PC I pushed the software to and left for the weekend.

        Upon arrival today (4/25), I decided to pick up where I left off and much to my surprise, I didn’t get the prompt when launching QB 2022. Questioned myself as to what would have happened to cause it to start working then realized, I restarted this PC prior to leaving. So I added a mandatory restart to the end of my MECM deployment.

        To test my theory, completely removed QB 2022 and all shades of it then put QB 2019 back on it (to test a true upgrade scenario) and much to my surprise, after the mandatory restart, I wasn’t presented the “Select QuickBooks Desktop Industry-Specific Edition” window; rather I was presented the “Begin Activation” window.

        Success! Finally!

        And it was nice to see previously accessed QB company files listed after Activation!

        You may want to put a note in your how-to to force a restart when all is said and done because that was one of two gotchas I ran across.

        Thanks again for the helpful how-to and your comments to help me get over this issue. Hopefully my notes helps make this an even better process!

Leave a Reply

Your email address will not be published. Required fields are marked *