Monday, July 2, 2018

SCCM Configuration Item to Set or Append MultiString Registry Value

Sometimes you have a reg_multi_sz (aka MultiString value) registry key that you need to set in SCCM. Unfortunately version 1706 of configuration manager can only monitor but not remediate multistring registry values.

The way I've found to fix this is to use a short powershell script. With this script we'd like to detect and remediate the reg value. Also, if there's any existing entries in the list we may or may not want to overwrite them. In this case I wanted to append our new SharePoint site address to the AuthForwardServerList registry entry and not completely wipe out any existing settings.

Detection

$NewValue = 'https://yourserveraddress.com'
$path = "HKLM:\SYSTEM\CurrentControlSet\Services\WebClient\Parameters"
$name = 'AuthForwardServerList'

if (Test-Path $path) {
    $key = Get-Item $path
    if ($key.getvalue($name, $null) -ne $null) {
        $CurrentValue = Get-ItemPropertyValue $path $name
        if ($CurrentValue -contains $NewValue) {
            write-host 1
            }
            else {
                Write-Host 0
                }
        }
        else {
            write-host 0
            }
    }

Remediation

$NewValue = 'https://yourserveraddress.com'
$path = "HKLM:\SYSTEM\CurrentControlSet\Services\WebClient\Parameters"
$name = 'AuthForwardServerList'

if (Test-Path $path) {
    $key = Get-Item $path
    if ($key.getvalue($name, $null) -ne $null) {
        $CurrentValue = Get-ItemPropertyValue $path $name
        if ($CurrentValue -contains $NewValue) {
            }
            else {
                Set-ItemProperty -Path $path -Name $name -Value ($CurrentValue + $NewValue)
                }
        }
        else {
            New-ItemProperty -Path $path -Name $name -Value $server -PropertyType "MultiString"
            }
    }

If you wanted to overwrite and not append you could just drop the "$CurrentValue +" bit in the Set-ItemProperty line, setting it to only the new value.

Thursday, August 24, 2017

Packaging Pulsonix 9.1 in SCCM (Part 2 of 2)

In Part 1 we added the base 9.1 installer into the Software Center. But Pulsonix updates regularly and these updates often fix bugs so let's get it added for our Engineers.

Unfortunately, it is not currently possible to perform a silent install with the update exe. Perhaps you could watch it with ProcMon to catch all the changes to the registry and then xcopy over all of the updated files with a script but this is more work than I'm currently willing to put into it right now. Since we don't have a very large user base we can just run this installer in Interactive mode and our users can just click the "Install" button.


  • First things first, get your source files to a working directory and a fresh testing computer (VM's are best for this as it is easy to revert to a previous snapshot if you encounter any strangeness)
  • Install it and observe the behavior
    • It requires local admin rights
    • Change allows you to unzip the new files to a different location
    • List shows you what files are being updated
    • Install Now does exactly that.

  • Based on this info we'll do an interactive, system based installation. 
  • Go ahead an copy your update file to your SCCM Sources$ directory

  • In SCCM Console go to Software Library > Applications > Create Application
  • Specify general the info

  • Fill out the app catalog info (making it pretty is a good idea)

  • Add a Deployment Type = Script
  • Name = Pulsonix 91 6869 update installer
  • Enter the content info
    • Source = your Sources$ directory
    • Installation Program = Pulsonix91_update-6868-to-6869.exe
    • Uninstallation Program = "C:\Program Files (x86)\InstallShield Installation Information\{9121D81B-4FF0-4DA9-A171-3117CD6D182B}\setup.exe" -runfromtemp -l0x0409  -removeonly

  • Detection Method*
    • File system
    • Path: %ProgramFiles(x86)%\Pulsonix9.1
    • File: Pulsonix.exe
    • File is associated with 32bit app on 64bit systems
    • File must satisfy the following rule
      • Date Modified equals 8/9/2017 12:10:38 PM

  • User Experience - make it an interactive install
    • Install for System
    • Only when a user is logged on
    • Normal
    • Check Allow users to view and interact with the program

  • Requirements = none
  • Dependencies
    • Add Pulsonix 9.1


*We only have the date modified detection method for this update since it does not modify the "DispalyVersion" key in the registry.

Done!

Go ahead and deploy and test your new app.

Packaging Pulsonix 9.1 in SCCM (Part 1 of 2)

Today we will add Pulsonix 9.1 and update 6869 to the Software Center for use by our Engineering Dept. This will be part 1 of a 2 part post. Ideally we would want an unattended/silent install that can be completed quickly for all users with minimum effort on their part. This is possible with the 9.1 installer but so far not possible with the updates.

I received the source files from the engineers who got them directly from Pulsonix. The primary 9.1 installer is an archive containing an installshield executable. So go ahead and use 7Zip to unzip the files to a working directory. Once done you should see the installer files as below:



Now there's a critical file not pictured here; the setup.iss file used to configure defaults. Read up on this great post on how to get this from installshield as well as other good info on working with installers.

Essentially what we will do is run the installer from command line with a "-r" switch to record the steps and generate this .iss file.


  • Uninstall any previous version of Pulsonix you have (or preferably use a clean system that has never had it installed in the first place)
  • Open an elevated command prompt
  • cd to your working directory
  • run "setup.exe -r"
  • Complete the setup process by clicking next and selecting options. For me we want the following:
    • Accept EULA
    • Install Pulsonix as a Network License Client
      • Computer = [name of our license server]
      • Port = leave as default
    • Customer Info:
      • UserName = %username%
      • Company Name = [company name]
      • Install for = Anyone who uses PC
    • Destination = leave as default (usually program files (x86))
    • Data Files = Place data with Documents
      • Destination = leave as default (public user folder)
    • Complete Install
    • Uncheck "create desktop icon"*
    • Next Next, done
  • Once the install is complete go grab the setup.iss file from C:\windows\
  • Copy it into our source file directory


*We don't want icons on the desktop because later we will be installing this as system, preventing our end users (standard rights) from deleting the icon if they don't like it.

Now let's get to packaging in SCCM

  • Copy the files to a new folder in your Sources$ directory


  • In SCCM Console go to Software Library > Applications > Create Application
  • Specify general the info


  • Fill out the app catalog info - I like to add an icon and description for my end users to make it pretty.

  • Add a Deployment Type

  • Since we don't have an MSI select Type = Script

  • Fill out the general info

  • Fill out the Content Info
    • Location = the location in the Sources$ folder where you copied the files 
    • Installation Program = "setup.exe" /s /sms 
    • **Uninstallation Program = "C:\Program Files (x86)\InstallShield Installation Information\{9121D81B-4FF0-4DA9-A171-3117CD6D182B}\setup.exe" -runfromtemp -l0x0409  -removeonly

  • For Detection Method we'll add several to be thorough
    • Method 1 - pulsonix.exe date modified
      • File system
      • Path: %ProgramFiles(x86)%\Pulsonix9.1
      • File: Pulsonix.exe
      • File is associated with 32bit app on 64bit systems
      • File must satisfy the following rule
        • Date Modified equals 7/17/2017 2:44:46 AM

    • Method 2 - registry DisplayVersion
      • Hive: HKLM
      • Key: SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{9121D81B-4FF0-4DA9-A171-3117CD6D182B}
      • Value: DisplayVersion
      • Data: Version
      • Must satisfy the following: Greater than or equal to 9.1

    • ***Method 2 - registry DisplayVersion
      • Hive: HKLM
      • Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9121D81B-4FF0-4DA9-A171-3117CD6D182B}
      • Value: DisplayVersion
      • Key is associated with 32bit app on 64 bit systems
      • Data: Version
      • Must satisfy the following: Greater than or equal to 9.1

    • Make sure you use the OR connector for all 3 detection methods.

  • User Experience
    • Install for System
    • Whether or not a user is logged in
    • Hidden

  • Requirements = none
  • Dependencies = none
  • Done!
**For uninstallation program we could generate another setup.iss file by running the installer with the "-r" switch but I was having inconsistent results so instead I just grabbed the "UninstallString" key from the registry.

***Just to be thorough I use both standard and Wow6432Node paths in the registry detection methods; probably not necessary.

If you already have a previous version of Pulsonix (we have 9.0 already) then you can specify a supercendence relationship. Be careful of course, depending on your version of SCCM, if you create a supercedence relationship and have a required deployment you may force an upgrade for those users. Since we've a small user base for this app I've only deployed them as available so no update will be forced.
  • Open the Pulsonix app you created
  • Go to Supersedence tab

  • Select Add
  • Select Browse
  • Find your previous Pulsonix app
  • Select the replacement Deployment Type
  • Select Uninstall

  • Repeat for any additional Pulsonix apps/updates


Deploy the app to your test group and you should be all set with the base installer!
Part 2 coming soon on packaging the updates.

Friday, October 28, 2016

Configuring Minitab 1610 for SCCM 2012


  1. First get the installer (mtben1610mu.exe). Mine was sent to us by the Engineering dept.
  2. Using 7zip extract the installation files
  3. Read through the deployment guide text. I’ve copied it below for reference as well as the list of commands supported by the minitab setup.exe.
  4. Create your config.xml file by running “setup.exe /admin” from the command line.


  5. Specify your licensing server with port number


  6. Under install options be sure to tick the “I accept license agreement”


  7. All other settings you can choose for yourself. I turned the notifications since our users don’t have local admin rights, the notification would just be annoying.
  8. Save your xml file into your unpacked minitab files directory to reside alongside setup.exe.
  9. Copy over the unpacked files to your SCCM sources dir
  10. Create the deployment. I prefer applications to packages but either would work. The instructions below are for creating the application.
  11. The Minitab deployment guide states you should use setup.exe /config [\\PathTo\config.xml]. However, in testing the minitab installer did not like %~dp0 switch in place of the full path for the config file. Even if I spelled out the entire UNC path it did not like it and I’m not sure why.

    So instead I created an install.cmd script with the following lines:

    pushd \\your-sccm-server\sources$\Software\Minitab16setup.exe /config %~dp0config.xml /qnpopd \\ your-sccm-server \sources$\Software\Minitab16
  12. Then you create the application as normal
    1. Create Application
    2. Manually specify the application information
    3. Fill out general info
    4. Fill out app catalog info
    5. Deployment Types > Add
    6. Manually specify the deployment type information
    7. Fill in General and Content tabs as you normally would.
    8. On the Programs Tab specify the install.cmd for Installation. For the Uninstall program use:

      "%CommonProgramFiles(x86)%\Minitab Shared\Minitab 16\Setup\Setup.exe" /x /p Minitab16 /qn

      This is just the uninstall string indicated in the deployment guide with the /qn switch on the end.


    9. For detection method I used Orca to open up the core.msi and obtain the Product Code

      {63FD90F3-58B5-4A25-9C47-428576D994D0}


    10. For User Experience I set Install behavior to System, logon to whether or not the user is logged on and visibility to Hidden.


    11. I changed nothing on Return Codes and Dependencies.
  13. Distribute the content out to your distribution points
  14. Deploy it to a few test machines
  15. Try out the install/uninstall
  16. Done!

Text from the Deployment Guide included in the Minitab extract
The Minitab Customization Tool is a Graphical User interface that helps you to create a configuration file to modify your Minitab 16 installation when you deploy. Use the instructions below to create a custom installation.

Note: Type setup.exe /help at the Command Prompt to access Setup Help at any time.


  1. Copy the installation files to a network location.
  2. Open the Command Prompt and navigate to the Minitab 16 setup files.
  3. Type Setup.exe /admin to access the Minitab 16 Customization Tool.
  4. Set the options for deployment.
  5. Click Save Configuration to save the configuration file to a network location. You must save the config.xml file next to the Setup.exe and other installation files or specify a config.xml file on the command line using the syntax /config "path" (for example, setup.exe /config "\\ServerName\PathTo\config.xml").

    Note: If you did not copy the installation files to a network location in step 1, you can check Copy Installation Files to save both the installation files and the configuration file to the same network location.
  6. Click Save.
  7. Use the deployment method of your choice to deploy Minitab 16:
    1. If you use SMS, Altiris, Tivoli or any other Enterprise Management Tool for deployment, use Setup.exe.
    2. If you use Active Directory/Group Policy, read the following important information. There are two methods for deploying via Active Directory/Group Policy:
      1. Use a Startup Script (Recommended)
        1. Create a configuration file using the Minitab 16 Customization Tool.
        2. Ensure that the config.xml file is next to the Setup.exe.
        3. Call Setup.exe within a Startup Script in Active Directory.
        4. Use Group Policy Software Deployment (assignment only; updates not supported)
      2. Create a configuration file using the Minitab 16 Customization Tool.
        1. Ensure that the config.xml file is next to the Setup.exe.
        2. Assign the Core.msi to the GPO (Group Policy Object). You can find this .msi in the administrative package that you created under the Core folder (Core/Core.msi).
        3. Note: If you silently deploy Minitab through Group Policy, setup.exe continues to run in the background even after the user logs on and until the installation is complete.
        4. If you use Organizational Defaults to set the default Minitab user profile, you must save the orgdefs.reg file next to the language pack MSI for each language you install. For more information on Organizational Defaults and its applications, please see the Minitab 16 Installation Guide.

List of Minitab Setup.exe Commands
Obtained by running setup.exe /help
Usage: setup.exe [options (see below))
Options switches (may be used in combination):
/ help
/?
/admin
Display this help dialog.
Launch the Minitab Customization Tool to create a config.xml to customize deployment. To automatically apply the options each time someone runs setup.exe, save the file as "config.xml" in the same folder as setup.exe.
/config
Install the software with the mass deployment options specified in the XML file.
Example: setup.exe /config “\\PathTo\config.xml”
/qn
Install the software in quiet mode, which requires no user interaction.
/qb
Install the software in quiet mode but also displays a progress bar.
/qb!
Install the software in quiet mode, displaying a progress bar with user interaction disabled.
/lcid
Specify the language to use in the installation dialog boxes.
/I
Create a log file.
/x /p
Uninstall the specified product.
Example: setup.exe /x / p Minitab16
/m (/ p )
Modify an installed Minitab product. If you do not specify a product, a list of products is displayed.
/r / p
Repair an existing installation of the specified product.
See the Minitab 16 Deployment Guide for more information.

Friday, June 3, 2016

Creating a Solidworks Application from MSI

So we’ve created our Solidworks admin image and copied over the installation files to our configmgr software repository. The next step is to create an application in CM to be able to deploy out to users. However, when I tried to import the MSI CM threw an error:

Import failed.
Invalid ALLUSERS property value: 0
Click Previous to attempt to correct the problem, or click Cancel.



If you didn't get this error and SW was able to be imported via MSI into CM for you then congrats, proceed inwards.

For those of us not so lucky this is error is disappointing as I want the benefits of creating applications via MSI (detection, uninstall path, etc).

The Fix

Thankfully the fix is fairly simple. Download and install ORCA, a tool from Microsoft which allows you to edit MSI files.
  1. Copy the solidworks.msi locally
  2. Open in Orca
  3. Under Tables find the Property Table
  4. Sort property A > Z
  5. Find the ALLUSERS property
  6. Set the value to 2 (as recommended by Microsoft)
  7.  Rename the original solidworks.msi to something like solidworks.msi.backup (always nice to keep the original in case your changes break it)
  8. Copy over the fixed solidworks.msi
  9. Re-run the Create Application wizard
VOILA!



Now just proceed through the app creation process as you normally do and you can happily deploy solidworks via MSI. 

Tuesday, April 22, 2014

Think Ride - The Return of Think-y Ride-y

Goodbye and Hello! Goodbye cruel Winter. Hello warming Spring. Goodbye driving everyday. Hello biking to work.

That's right I'm back and biking and blogging again. Though, truth be told I'm sure the biking will be more consistent than the blogging. My plan, now that I do have a car available, is to bike wherever possible unless a certain set of conditions is met:
  1. The temperature (including wind chill) is less than 40 degrees F
  2. The chance of precipitation during commute time is greater than 20-30% AND the expected amount of precipitation* is less than would soak me through
  3. I have an important meeting at work for which I don't want to be smelly/sweaty
So I will bike a whole lot but I get to avoid nasty thunderstorms and other weather events. The trick will be to not become complacent and fall back on driving when I'm simply tired or feeling lazy.

Also, yes, I've renamed the Blog to Think Ride. For some reason I've felt that having the y on the end was overly cute-sy or perhaps I'm trying to appear more professional. In any case Think Ride feels right. It is strange though, as I mull it over, that I have a strong impulse to add a third word on the end, as if having a two word name is not complete. However, I cannot decide on what that third word should be. Think Ride... Do, Hack, Write. Nothing quite gets to me the same way as leaving it with the simple two word title. The cadence of the previous title was nice 1, 2, 1, 2, which may explain why 1, 2, feels unfinished. So many things come in a trio - Life, Liberty and the Pursuit of Happiness; Just Do It; Stop, Drop, and Roll - that leaving it as a duet feels incomplete. I will leave it as a duet, allowing you, reader, to insert your own third.

*wow did I have trouble spelling this word. I kept typing percipitation only to be notified with a red squiggly underline that it was wrong. I'd right click and look for the difference (pre not per) but couldn't see it. Damn my Minnesotan accent and reliance upon sounding words out for their spellings!

Saturday, November 23, 2013

Selling Out

As of March 2013 I officially become a licensed driver. I am 24 and have had a permit since age 17.

July 2013 my mother gives me my first car (dad helps out too, financially). It is an old beater that she has had for years but it still gets good gas mileage. I later learned from my girlfriend that my mother bought it for me in expectation of me getting my driver's license... back when I was 17. Sorry for the delay mom, and the obliviousness.

October 2013 becomes the first month in my life during which I have driven more often than I have biked. The weather is disgusting (freezing mist, cold rain) so I'm glad not to have to bike in it any longer. This is why I have a car now, right? I feel kind of lazy and out of shape, also guilty whenever I see another biker pushing through the chill. It feels like I'm joining the dark side.

November 2013 is now the first month during which I will have used an automobile as my primary mode of transportation instead of biking or taking public transit. I have biked zero miles this month. I've sold out.

And you know what? It is not as bad as I thought it would be. I quickly became used to no longer being afraid of vehicles. Now I'm the one inside the metal beast, no longer exposed. Everyone sees me, automatically granting me access to the road. The weather barely touches you inside a car. So far (I haven't yet been through a Minnesota winter) I've, at most, had to scrape frost off my windows and engage the windshield wipers.

The routine for getting ready to go to a car is extremely simple. Grab the keys and go. Unlike on a bike there is no double checking of brakes, making small adjustments. Checking tire pressure, topping it off every week or so with a few quick pumps. There is no need to pack a separate change of clothes for when you get to work, you simply go to work in your work clothes. There is no need to make sure your entire lunch fits in that one jar which snugly sits inside of your underseat pouch. Extremely convenient, fast. I can see why everyone else drives (there's a lot more to why people drive but that is a whole other series of posts).

But still, I miss biking. To be sure I do not miss winter biking. I've grown soft and winter biking is only for true badasses/very crazy people. But I am reminded, every time I fill the gas tank, of the higher price which comes attached to this convenience, both for my wallet and the environment. Biking feels like freedom. You are able to go places cars cannot, you have zero fuel cost, zero emissions, you are extremely maneuverable and your field of view is barely constrained by your helmet. Driving feels like I may as well be stuck on a track when surrounded on all sides by other cars. I feel constricted and blind, I can't see everything around me, I am much less spatially aware. I can't wait for winter to be over. As soon as the snow is gone, I'm done driving.

I miss biking.