PSADT Series: Packaging .NET Framework 3.5 application for configmgr

By | April 1, 2023
Share

Considering this was at least my tenth time packaging this dotnet installer for ConfigMgr, I figured I should share it here for safe keeping. Further help on PowerShell App Deployment Toolkit (https://psappdeploytoolkit.com/). I will not be covering how to use PSADT, just the guts.

Detection Method:

$netfx3 = Get-WindowsOptionalFeature -Online -FeatureName NetFx3
if ($netfx3.state -eq 'Enabled') { write-output 'netfx3 is enabled' }

PSADT install/uninstall command lines:

## <Perform Installation tasks here>
Enable-WindowsOptionalFeature -Online -FeatureName NetFx3 -All -LimitAccess -Source $dirFiles

# <Perform Uninstallation tasks here>
Disable-WindowsOptionalFeature -Online -FeatureName NetFx3

Source files need to be pulled from latest ISO (sources\sxs\) from MS:

  • Microsoft-Windows-NetFx3-OnDemand-Package~31bf3856ad364e35~amd64~en-US~.cab
  • microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab
dotnet cab files from source iso
program command lines for install/uninstall

/Brian

“..Status Messages” in Right-Click Menu

By | February 11, 2021
Share

TBH I’m not sure when this feature arrived in the SCCM console, but its a huge time saver for me! I no longer have to type Deployment IDs in Status Message Query searches.

I only came across this on SCCM’s v2010 release, but I believe it may have arrived in an earlier release.

the “Show Status Messages” option for a specific deployment.

This also works for listing all of the status messages sent from a specific device. This could be useful when troubleshooting Application/Configuration Baseline deployments.

The “Show Status Messages” option for a specific device.

My tip when using Status Message reports, Shrink the “Description” column and hover over your desired step to show the tooltip. The tooltip is MUCH easier to read as it’s word wrapped.

Viewing the full Status Message descriptions using tool tips

Bonus, Another great feature that arrived in 2010 was syntax highlighting for Powershell scripts added to Task Sequences. Hopefully one day, auto-complete will come, but this is deff. a start.

Powershell code syntax highlighted from SCCM’s Task Sequence editor.

Here’s a link to all of the 2010 features: https://docs.microsoft.com/en-us/mem/configmgr/core/plan-design/changes/whats-new-in-version-2010

/Brian Gonzalez

Sharing Code Doesn’t Have To Be Ugly

By | December 4, 2020
Share

I’m constantly sharing Powershell/Python code snippets, I tend to just toss them on gist or github and send links, but I just recently found carbon https://carbon.now.sh/

This site makes even my code look shiny and well formatted. I’m a huge fan!

Script to output all uninstall strings

By | February 28, 2020
Share

https://gist.github.com/brianfgonzalez/6b2ed0760d3f3000a57be030ea1fde46

$ColRegUinst = @()
(Get-Item -Path 'HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall').GetSubKeyNames() |
%{
    if ( (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("DisplayName") -ne $null)
    {
        $ObjRegUinst = New-Object System.Object
        $ObjRegUinst | Add-Member -Type NoteProperty -Name Publisher -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("Publisher")
        $ObjRegUinst | Add-Member -Type NoteProperty -Name Name -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("DisplayName")
        $ObjRegUinst | Add-Member -Type NoteProperty -Name Uninstall -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("UninstallString")
        $ColRegUinst += $ObjRegUinst
    }
}
$ColRegUinst | Out-GridView

/BG

Disk Wipe Wedge for use with Microsoft Deployment Toolkit (Any release)

By | November 28, 2019
Share

1\Create a folder under the <DeployRoot> named “peFiles” or similar.

2\Populate the folder with the promptForDiskWipe.bat and unattend.xml files from this gist:

promptForDiskWipe.bat: https://gist.github.com/brianfgonzalez/dcedc971176ba87551b10ef9f40c332e

unattend.xml: https://gist.github.com/brianfgonzalez/d93e4160b03b46885ca187e6bc2fa549

* Click on RAW and then right-click and save-as to save the actual files.

3\Update your MDT boot media to call the promptForDiskWipe.bat script before starting a deployment (litetouch.vbs).

3a\From your Deployment Share’s properties, go to the “Windows PE” tab.

3b\Select x64 from “Platform” dropdown.

3c\Then browse and select the peFiles for the “Extra directory to add” field.

*Note: This particular option’s dialog box crashes quite a bit. Just kill it from the Task Manager (Ctrl+Shift+Esc or “taskmgr” from run) and retry.

4\Perform an Update on your Deployment Share to trigger the PE update to occur.

4a\Select to only optimize your current boot images. (fyi, selecting to “completely regenerate..” wouldn’t hurt, but it takes a bit longer)

Final: And here is a screenshot of the wedge being executed.  It leaves a lot to be desired, but it works great.

/BG