<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Admin Who]]></title><description><![CDATA[A repository of my searches and researches on how to be a Sys Admin]]></description><link>https://leonc.info/</link><image><url>https://leonc.info/favicon.png</url><title>Admin Who</title><link>https://leonc.info/</link></image><generator>Ghost 5.50</generator><lastBuildDate>Sun, 19 Apr 2026 01:08:54 GMT</lastBuildDate><atom:link href="https://leonc.info/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Windows 365 Clipboard Copy Pasta]]></title><description><![CDATA[<p>Back in June 2025, <a href="https://techcommunity.microsoft.com/blog/windows-itpro-blog/enhanced-security-defaults-for-windows-365-cloud-pcs/4424914?ref=leonc.info">Microsoft announced</a> that it would enhance Windows 365 security by disabling clipboard and other redirects by default. Depending on your environment, you might need to undo this change. I&apos;m gonna go over my trial and error of controlling these settings via Intune after spending</p>]]></description><link>https://leonc.info/windows-365-copy-pasta/</link><guid isPermaLink="false">69432bbb4dca3a04efe564a9</guid><category><![CDATA[Windows]]></category><category><![CDATA[Windows365]]></category><category><![CDATA[Copy and Paste]]></category><category><![CDATA[Clipboard]]></category><category><![CDATA[Copy Pasta]]></category><category><![CDATA[PowerShell]]></category><category><![CDATA[Deployment]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Wed, 17 Dec 2025 23:07:29 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1517430816045-df4b7de11d1d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fENvcHl8ZW58MHx8fHwxNzY2MDEyODE3fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1517430816045-df4b7de11d1d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fENvcHl8ZW58MHx8fHwxNzY2MDEyODE3fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=2000" alt="Windows 365 Clipboard Copy Pasta"><p>Back in June 2025, <a href="https://techcommunity.microsoft.com/blog/windows-itpro-blog/enhanced-security-defaults-for-windows-365-cloud-pcs/4424914?ref=leonc.info">Microsoft announced</a> that it would enhance Windows 365 security by disabling clipboard and other redirects by default. Depending on your environment, you might need to undo this change. I&apos;m gonna go over my trial and error of controlling these settings via Intune after spending months with a useless non-Premier Microsoft Support case with a bunch of AI slop troubleshooting by the support team. I turned to my own AI slop, which gave me a hint to actually search for something else to get my own fleet with a working copy and paste again.</p><p>If you only need text/image/file copy and paste back (the default also blocked printer redirect and plug-and-play devices, which we won&apos;t cover). These are all you need. Settings catalog, search for Device and Resource Redirection, add Do not allow Clipboard redirection and Do not allow drive redirection as Disabled. The drive redirection is for copy and pasting files, clipboard for text/images/rich text/HTML.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://leonc.info/content/images/2025/12/Screenshot-2025-12-17-at-17.33.09.png" class="kg-image" alt="Windows 365 Clipboard Copy Pasta" loading="lazy" width="832" height="629" srcset="https://leonc.info/content/images/size/w600/2025/12/Screenshot-2025-12-17-at-17.33.09.png 600w, https://leonc.info/content/images/2025/12/Screenshot-2025-12-17-at-17.33.09.png 832w" sizes="(min-width: 720px) 720px"><figcaption>Settings catalog for Do not allow Clipboard redirectioni and Do not allow drive redirection set to Disabled</figcaption></figure><p>However, if you&apos;re like me and messed around with the other 4 settings about limiting the content of what can be copied and pasted, you might be stuck with it disabled altogether. When you enable one of these 4 settings (Restrict clipboard transfer to and from server/client), you get a choice of gradual control on what type of content can be copied and pasted; it ranges from nothing can be copied and pasted to just plain text to images and rich text. In these settings, server refers to the Windows 365 device, and client is the device you&apos;re connecting from (or host machine).</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://leonc.info/content/images/2025/12/Screenshot-2025-12-17-at-17.34.58.png" class="kg-image" alt="Windows 365 Clipboard Copy Pasta" loading="lazy" width="763" height="480" srcset="https://leonc.info/content/images/size/w600/2025/12/Screenshot-2025-12-17-at-17.34.58.png 600w, https://leonc.info/content/images/2025/12/Screenshot-2025-12-17-at-17.34.58.png 763w" sizes="(min-width: 720px) 720px"><figcaption>Restrict clipboard transfer from server to client/client to server, for both device and user</figcaption></figure><p>In my initial testing, I had played around with these settings and had learned since that if any of these were previously set, the registry remains and won&apos;t be unset, which we know is how GPO has always worked. What I didn&apos;t know was that if any of these 4 settings were set to deny copy/paste, deny takes precedence regardless of Device vs User setting. That is to say, denying always wins, great for security, but doesn&apos;t follow other types of Device vs User settings - confusing!</p><p>The other issue with having had these enabled is that putting it back to disable does not bring back the ability to copy and paste, regardless of your setting in &quot;Do not allow clipboard redirection&quot;. It leaves the setting written in the registry, so you have to clear them out via other means (or leave them enabled with the highest allowed setting, disable just tells Intune not to set them anymore).</p><p>These are the 4 registry keys related to these 4 settings should you choose to just get rid of these settings completely from your Intune policies. Thanks to the hint from AI making me look under HKCU Terminal Services and it giving me the wrong answer about what SCClipLevel is. Thanks to <a href="https://dominiekverham.com/limiting-clipboard-transfers-for-windows-365-cloud-pcs/?ref=leonc.info">this blog</a> for showing me what the settings actually are and what they mean after searching for SCClipLevel.</p><p>Path: <code>HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services</code><br>Values: <code>SCClipLevel</code> (Server to Client) and <code>CSClipLevel</code> (Client to Server)</p><p>Path: <code>HKCU:\Software\Policies\Microsoft\Windows NT\Terminal Services</code><br>Values: <code>SCClipLevel</code> (Server to Client) and <code>CSClipLevel</code> (Client to Server)</p><p>These keys are not documented on any Microsoft website, so big thanks to the community for translating these settings.</p><p>Delete those keys with the deployment tool of your choice.</p><p>A quick reference of how to delete it with PowerShell: <code>Remove-ItemProperty -Path $registryPath -Name $valueName</code></p>]]></content:encoded></item><item><title><![CDATA[Remote Desktop fun (macOS to Windows)]]></title><description><![CDATA[<p>Had to dig a bit for this one as it was not immediately clear to me.</p><p>When you are trying to remote from a Mac to an AzureAD (or Entra ID) joined Windows device using Microsoft&apos;s Remote Desktop app, you have to use a special username.</p><p>You need</p>]]></description><link>https://leonc.info/remote-desktop-fun/</link><guid isPermaLink="false">65b967b82d57e604b48c7a4f</guid><category><![CDATA[rdp]]></category><category><![CDATA[Windows]]></category><category><![CDATA[remote]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Tue, 30 Jan 2024 21:24:51 GMT</pubDate><media:content url="https://leonc.info/content/images/2024/01/Screenshot-2024-01-30-161954.png" medium="image"/><content:encoded><![CDATA[<img src="https://leonc.info/content/images/2024/01/Screenshot-2024-01-30-161954.png" alt="Remote Desktop fun (macOS to Windows)"><p>Had to dig a bit for this one as it was not immediately clear to me.</p><p>When you are trying to remote from a Mac to an AzureAD (or Entra ID) joined Windows device using Microsoft&apos;s Remote Desktop app, you have to use a special username.</p><p>You need to use: AzureAD\UPN<br>Example: AzureAD\userid@example.com</p><p>You&apos;ll also need to turn off Network Level Auth for it to work, which I don&apos;t recommend. However, if you&apos;re desperate to remote in, these are the required settings.</p>]]></content:encoded></item><item><title><![CDATA[Intune Win32 App Installation using PowerShell Script]]></title><description><![CDATA[Change your Install and uninstall command line to specifically call for the 64-bit powershell.exe.]]></description><link>https://leonc.info/powershell-script-in-intune-win32-app/</link><guid isPermaLink="false">641e14326e7d0f05050427a8</guid><category><![CDATA[PowerShell]]></category><category><![CDATA[Intune]]></category><category><![CDATA[ Command Prompt]]></category><category><![CDATA[PoSh]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Fri, 24 Mar 2023 21:46:59 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1519706483827-869e382e1024?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDMzfHxwb3dlciUyMFNoZWxsfGVufDB8fHx8MTY3OTY5NDEwOQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1519706483827-869e382e1024?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDMzfHxwb3dlciUyMFNoZWxsfGVufDB8fHx8MTY3OTY5NDEwOQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Intune Win32 App Installation using PowerShell Script"><p>First off, credit to these people, if you want to read about the subject in details:<br><a href="https://call4cloud.nl/2021/05/the-sysnative-witch-project/?ref=leonc.info">https://call4cloud.nl/2021/05/the-sysnative-witch-project/</a><br><a href="https://blog.italik.co.uk/running-powershell-scripts-using-intune/?ref=leonc.info">https://blog.italik.co.uk/running-powershell-scripts-using-intune/</a></p><p>In moving some scripts I&apos;ve written for SCCM apps using variables like $env:ProgramFiles or writing to the registry, I tried to reuse the same install command line and detection scripts. But on 64-bit systems, leaving the install line as <code>powershell -ExecutionPolicy Bypass -File Install-Script.ps1</code> will run in the context of a 32-bit cmd console (because Intune&apos;s Win32 App runs in 32-bit, as the name suggests), and the dectection script will run in 64-bit from checking the box that you want to run it in 64-bit.</p><p>On your 64-bit Windows workstations, if you used $env:ProgramFiles in your install script and also in your detection script, you end up with installs in <code>C:\Program Files (x86)</code> and detection looking in <code>C:\Program Files</code>. </p><p>So how do we make sure our script runs in 64-bit? Change your install and uninstall command line to specifically call for the 64-bit powershell.exe.</p><p><code>%windir%\SysNative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file Install-Script.ps1</code></p><p>If you want to test this, the <code>SysNative</code> folder alias is only accessible in 32-bit <code>cmd.exe</code>. You can access that in <code>C:\Windows\SysWOW64\cmd.exe</code></p><p>To check what architecture your PoSh/cmd is in:<br>cmd: <code>echo &quot;%PROCESSOR_ARCHITECTURE%&quot;</code><br>PoSh: <code>$env:PROCESSOR_ARCHITECTURE</code></p><p>There are other options other than changing the Install command line, check out the blogs I linked in the beginning!</p>]]></content:encoded></item><item><title><![CDATA[Windows LPR Printer]]></title><description><![CDATA[<p>First off, you probably shouldn&apos;t be doing this, LPR/LPD has been deprecated in Windows since Server 2012. However, it is still useful in a mixed environment. </p><p>On-prem Windows Print Servers and macOS clients are going to want to use LPD (if you don&apos;t want to</p>]]></description><link>https://leonc.info/windows-lpr-print-queue/</link><guid isPermaLink="false">630e755f79ac8f04ee37d8ee</guid><category><![CDATA[Printers]]></category><category><![CDATA[Windows]]></category><category><![CDATA[PowerShell]]></category><category><![CDATA[PoSh]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Tue, 30 Aug 2022 21:14:40 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1630327722923-5ebd594ddda9?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDE1fHxQcmludGVyfGVufDB8fHx8MTY2MTg5MzgyMw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1630327722923-5ebd594ddda9?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDE1fHxQcmludGVyfGVufDB8fHx8MTY2MTg5MzgyMw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Windows LPR Printer"><p>First off, you probably shouldn&apos;t be doing this, LPR/LPD has been deprecated in Windows since Server 2012. However, it is still useful in a mixed environment. </p><p>On-prem Windows Print Servers and macOS clients are going to want to use LPD (if you don&apos;t want to use IPP and installing IIS on top just to serve the queues). Another scenario is Azure AD joined only devices without ADConnect Sync to on-prem AD with on-prem domain print servers. You might ask why this specific scenario and I won&apos;t tell ya.</p><p>Not ready for cloud printing solution yet? Here&apos;s something you can use with your deployment system. Assuming your print server is serving LPD already, here&apos;s the gist of what&apos;s needed.</p><hr><!--kg-card-begin: html--><b>Step 1.</b> Enable LPR Port Monitor on your Windows workstations.<br>
<pre><code class="language-dos">Dism /online /Enable-Feature /FeatureName:Printing-Foundation-LPRPortMonitor /All</code></pre><br>
<br><br>
<b>Step 2.</b> Install your Print Drivers on the local workstations. This script assumes your script is in the same folder as your .inf driver. You have to use pnputil.exe to install the actual driver first, then you have use Add-PrinterDriver and call it by its full name only. Replace the INF and Driver Name to your own.<br>
<pre><code class="language-powershell">Start-Process -FilePath &quot;C:\Windows\System32\pnputil.exe&quot; -ArgumentList &quot;/add-driver `&quot;$PSScriptRoot\disk1\RICSETUP64.INF`&quot; /install /subdirs&quot; -Wait -NoNewWindow
Add-PrinterDriver -Name &quot;PS Driver for Universal Print&quot;</code></pre><br>
<br><br>
<b>Step 2a.</b> If you are using SCCM, here&apos;s a detection method you may use for this Ricoh Universal Driver. Replace the driver name and version to your own; you might need to write your own $ver conversion.<br>
<pre><code class="language-powershell">$InstalledVersion = (Get-PrinterDriver -Name &quot;PS Driver for Universal Print&quot; -ErrorAction SilentlyContinue).DriverVersion
$ver = ((3..0 |ForEach-Object { ($InstalledVersion -shr ($_ * 16)) -band 0xffff }) -join &apos;.&apos;)
$MinVersion = [version]&quot;4.32.0.0&quot;

If ($InstalledVersion) {
  If ([version]$ver -ge $MinVersion) { Write-Host &quot;Installed&quot; }
  Else { }
}
Else { }</code></pre><br>
<br><br>
<b>Step 3.</b> Install the Printer. Use your deployment system to depend on Step 2 to keep things updated. Note the colon in the PortName between server and printer name.<br>
<pre><code class="language-powershell">Add-PrinterPort -HostName $PrintServer -PrinterName $PrinterName
Add-Printer -Name $PrinterName -PortName &quot;$PrintServer:$PrinterName&quot; -DriverName &quot;PS Driver for Universal Print&quot;</code></pre><br><br><br><!--kg-card-end: html--><hr><p>That&apos;s it, no restart required. Don&apos;t look so shocked.</p>]]></content:encoded></item><item><title><![CDATA[Import Updates from Catalog to WSUS]]></title><description><![CDATA[<p>There are some Windows Updates that are only available in the <a href="https://catalog.update.microsoft.com/?ref=leonc.info">Microsoft Update Catalog</a>. You can import them into WSUS (and thus be able to import them to SCCM) via an ActiveX applet using Internet Explorer as noted in this <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-server-update-services/manage/wsus-and-the-catalog-site?ref=leonc.info">Microsoft Docs</a>.</p><p>However, when I tried to load this applet</p>]]></description><link>https://leonc.info/import-updates-from-catalog-to-wsus/</link><guid isPermaLink="false">5d8e7ddd00e4d079d268bfef</guid><category><![CDATA[WSUS]]></category><category><![CDATA[SCCM]]></category><category><![CDATA[PowerShell]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Fri, 27 Sep 2019 22:06:10 GMT</pubDate><media:content url="https://leonc.info/content/images/2019/09/Annotation-2019-09-27-174312.png" medium="image"/><content:encoded><![CDATA[<img src="https://leonc.info/content/images/2019/09/Annotation-2019-09-27-174312.png" alt="Import Updates from Catalog to WSUS"><p>There are some Windows Updates that are only available in the <a href="https://catalog.update.microsoft.com/?ref=leonc.info">Microsoft Update Catalog</a>. You can import them into WSUS (and thus be able to import them to SCCM) via an ActiveX applet using Internet Explorer as noted in this <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-server-update-services/manage/wsus-and-the-catalog-site?ref=leonc.info">Microsoft Docs</a>.</p><p>However, when I tried to load this applet on my Windows 10 box (with WSUS console installed, as required), the applet had a hard time loading. I tried using the 32-bit version of IE and that made it work only a tiny bit better but not enough to get the to the import part.</p><p>I ended up finding a way to import them via PowerShell from <a href="https://p0w3rsh3ll.wordpress.com/2016/07/12/import-the-convenience-update-into-wsus/?ref=leonc.info">this blog</a>. Doing it manually this way does take a bit longer, but having to import hotfixes in the first place is already taking a long time so what&apos;s another hour of your life eh?</p><p>Find the update you need in the catalog, click on the update and find the GUID in the URL of the newly popped up window with details of the update. You&apos;ll also need to download this update.</p><p>On your computer with WSUS Console installed, you will need to run PowerShell as the person that has admin and WSUS permissions.</p><p><code>(Get-WSUSServer).ImportUpdateFromCatalogSite(&apos;GUID&apos;, &apos;Path_to_msu&apos;)</code></p><p>If you are doing it remotely, you&apos;ll need a bit more:</p><p><code>(Get-WSUSServer -Name mywsus.fqdn.com -port 8531 -UseSSL:$true).ImportUpdateFromCatalogSite(&apos;GUID&apos;, &apos;Path_to_msu&apos;)</code></p><p>When it&apos;s done, you can double check that it imported by searching the KB number (it doesn&apos;t only search KB number, but easiest here):</p><p><code>(Get-WSUSServer -Name mywsus.fqdn.com -port 8531 -UseSSL:$true).SearchUpdates($kbnumber)</code></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://leonc.info/content/images/2019/09/Annotation-2019-09-27-175754.png" class="kg-image" alt="Import Updates from Catalog to WSUS" loading="lazy"><figcaption>You can also check the WSUS console - note that the &quot;hotfix&quot; of the same name is classified as &quot;Updates&quot;</figcaption></figure><p>Once you&apos;ve verified that everything is imported, go to your SCCM console and run a Software Updates Sync (Software Library &gt; All Software Update &gt; Synchronize Software Updates in the ribbon). The log for this process is wsyncmgr.log on your SCCM Site Server.</p>]]></content:encoded></item><item><title><![CDATA[QuickTime 7 for Windows]]></title><description><![CDATA[<p>I know what you&apos;re thinking, QuickTime 7 for Windows is outdated and should be uninstalled. I agree with you.</p><p>However, there are still some apps out there that depends on AVFoundation and aren&apos;t using native Windows 10 codecs (Looking at you Avid).</p><p>So you just gotta</p>]]></description><link>https://leonc.info/quicktime-7-for-windows/</link><guid isPermaLink="false">5d051c2a37a0800512a6f115</guid><category><![CDATA[QuickTime]]></category><category><![CDATA[Apple]]></category><category><![CDATA[MSI]]></category><category><![CDATA[Windows]]></category><category><![CDATA[Deployment]]></category><category><![CDATA[SCCM]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Sat, 15 Jun 2019 17:32:20 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1497015289639-54688650d173?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1497015289639-54688650d173?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="QuickTime 7 for Windows"><p>I know what you&apos;re thinking, QuickTime 7 for Windows is outdated and should be uninstalled. I agree with you.</p><p>However, there are still some apps out there that depends on AVFoundation and aren&apos;t using native Windows 10 codecs (Looking at you Avid).</p><p>So you just gotta deploy that really old app that hasn&apos;t been updated for 3 years and get it to play nice with your deployment tools + Windows. There are a lot of information on how to do this on the web with SCCM or your deployment software of choice; they&apos;re all either in a batch file and/or having you extract the MSI files from the downloaded installer. Lately, that method haven&apos;t been working right for me because it keeps complaining about a newer version was already install (even though nothing was installed) or it just errors out completely. This is the same type of error I&apos;ve seen with Cisco AnyConnect (see my previous blog post about this). While this is a Microsoft error, Microsoft has also recommended vendor to work around this so really, it&apos;s both of their faults. For some reason, the main installer you download from Apple will not have this error as you would with the lone MSI and it also installs the dependencies it want so I gave it a go.</p><p>After a couple attempts, I was going to give up and just use the Apple installer and then uninstall the Apple Software Update, wrapped under a batch file. So I attempted to run the installer in command line with /? to see what kind of options I get. When I did that, I got the msiexec help box instead; which was super weird. So I plugged in my options that I would have used for the QuickTime.msi and see what would have happened. I plugged this whole thing in an elevated command prompt.</p><pre><code>QuickTimeInstaller.exe DESKTOP_SHORTCUTS=NO SCHEDULE_ASUW=0 ASUWINSTALLED=0 /q /log &quot;%temp%\QuickTime7_Install.log&quot;</code></pre><p>It basically installed without errors and installed all dependencies without software update. Sometimes, re-writing the install procedure is not helpful and you should use the vendor&apos;s installer... <em>sometimes</em>.</p>]]></content:encoded></item><item><title><![CDATA[File Versions in Windows (with PowerShell)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>In an everlasting remediation with Cisco AnyConnect on Windows where 4.5.xxxxx doesn&apos;t upgrade properly by just installing a newer version of the product. Cisco has a workaround with 4.6.x but your 4.5 installation is still fucked because a) it&apos;s uninstalled in</p>]]></description><link>https://leonc.info/file-versions-in-windows-with-powershell/</link><guid isPermaLink="false">5cd1d8083824960794cf40a0</guid><category><![CDATA[PowerShell]]></category><category><![CDATA[SCCM]]></category><category><![CDATA[PoSh]]></category><category><![CDATA[Windows]]></category><category><![CDATA[Cisco]]></category><category><![CDATA[AnyConnect]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Mon, 15 Apr 2019 22:18:05 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1541920219660-09735915019a?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1541920219660-09735915019a?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="File Versions in Windows (with PowerShell)"><p>In an everlasting remediation with Cisco AnyConnect on Windows where 4.5.xxxxx doesn&apos;t upgrade properly by just installing a newer version of the product. Cisco has a workaround with 4.6.x but your 4.5 installation is still fucked because a) it&apos;s uninstalled in Apps &amp; Feature (Add/Remove if you&apos;re old school) but it complains you have a newer version installed if you attempt to install a newer version, or b) it is complaining about &quot;The File &apos;ManifestTool.exe&apos; is not marked for installation.&quot; when attempting to uninstall/reinstall AnyConnect.</p>
<p>So enough of that rant, why did I want to document the versioning? Because Cisco AnyConnect relies a lot of its modules to be the same version of the Core install. I had a need to do some version checking with SCCM and in PowerShell scripting to make sure I can remediate the installation. The problem is, not every developer writes their versions the same way. Most versions are generally written in this format <code>1.0.123.3456</code> (see <a href="https://semver.org/?ref=leonc.info">semver.org</a> for some usage examples); however Cisco AnyConnect uses <code>4, 6, 03049</code> when queried. Cisco is not the only offender here though; the open source R project  version query returns this: <code>3.5.3.26217 (2019-03-11)</code>. If you gave PowerShell a comparison test between 1.4.323.456 and 2.5.323.128, PowerShell can automatically translate them into a version object and compare the 2 versions properly. PowerShell will detect those versions as Major Version, Minor Version, Build Number, Revision Number respectively. For example, you can see your PowerShell&apos;s Version table using this command: <code>$PSVersionTable.PSVersion</code></p>
<p>If you are writing a script, creating a detection method, or a global condition in SCCM, you will have to convert those version numbers into a readable format for PowerShell. If you are a seasoned programmer, you probably know how to do this already. I&apos;m not a seasoned programmer, research + asking questions on <a href="https://powershell.slack.com/?ref=leonc.info">PowerShell Slack</a> had given me a lot of insight.</p>
<p>Here&apos;s some things to consider when working with version objects:</p>
<p>Convert your number-dot-number string to a version object, remember to quote your string!<br>
<code>$OurVersion=[version]&quot;2.11.1&quot;</code></p>
<p>Grab the version number using ProductVersion (This command for AnyConnect returns commas); note that I&apos;m using a wild card in the path in case it gets ran on a 32-bit system.</p>
<pre><code>$AnyConnectPath=&quot;C:\Program Files*\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe&quot;
$FileVersion=(Get-ChildItem $AnyConnectPath).VersionInfo.ProductVersion
</code></pre>
<p>Let&apos;s get rid of the commas and convert the string into a version object</p>
<pre><code>$GetFileVersion=(Get-ChildItem $AnyConnectPath).VersionInfo.ProductVersion -replace &apos;, &apos;,&apos;.&apos;
$ConvertedACVersion=[version]$GetFileVersion
 
</code></pre>
<p>There is another place that product returns a version without commas though (for AnyConnect). You can get it with Get-Command; it is used in older PowerShell versions for other things but works here for AnyConnect.</p>
<pre><code>(Get-Command $AnyConnectPath).Version
</code></pre>
<p>So what do we do with the R project and the extra date? Just trim it off.</p>
<pre><code>$AppPath=&quot;C:\Program Files\R\R-*\bin\R.exe&quot;
$InstalledVersions=(Get-ChildItem $AppPath).VersionInfo.FileVersion[0]
</code></pre>
<p>If there are multiple versions of R installed we split the lines before trimming.</p>
<pre><code>$InstalledVersions=(Get-ChildItem $AppPath).VersionInfo.FileVersion
foreach($line in $InstalledVersions) {
  $s = $line.split()
  $ver = $s[0]
}
</code></pre>
<p>In conclusion, we have a few ways to get versions. Here are 2 examples I&apos;ve used to compare versions.</p>
<p>First one here is a global condition in SCCM. You can turn this into a <a href="https://docs.microsoft.com/en-us/sccm/apps/deploy-use/create-applications?ref=leonc.info#bkmk_detect-script">detection method</a> by adding <code>Write-Host &quot;Installed&quot;</code> along with your <code>$true</code>; the string for Write-Host does not matter.</p>
<pre><code>$AnyConnectPath=&quot;C:\Program Files*\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe&quot;
$MinVersion=[version]&quot;4.6.03049&quot;
If (Test-Path $AnyConnectPath) {
    $ACVersion=[version](Get-ChildItem &quot;C:\Program Files*\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe&quot;).VersionInfo.ProductVersion
    $MaxVersionInstalled=($ACVersion | Measure-Object -Maximum).maximum
    If ($MaxVersionInstalled -ge $MinVersion) { $true }
    Else { $false }
}
Else { $false }
</code></pre>
<p>Here&apos;s a snippet of a script also trying to detect the version of AnyConnect. If it&apos;s a certain version or newer, run another installer.</p>
<pre><code>$AnyConnectPath=&quot;C:\Program Files*\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe&quot;
$MinVersion=[version]&quot;4.6.03049&quot;
If (Test-Path $AnyConnectPath) {
    $GetACVersion=(Get-ChildItem &quot;C:\Program Files*\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe&quot;).VersionInfo.ProductVersion -replace &apos;, &apos;,&apos;.&apos;
    $ConvertedACVersion=[version]$GetACVersion
    $MaxVersionInstalled=($ConvertedACVersion | Measure-Object -Maximum).maximum
    If ($MaxVersionInstalled -ge $MinVersion) {
    	Start-Process &quot;msiexec.exe&quot; -ArgumentList &apos;/i &quot;installer.msi&quot; /q /lvx* &quot;C:\Windows\Temp\MyProgram-install.log&quot;&apos; -Wait
    }
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Setaid.ini for SEP installs]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I had such a hard time finding what some of the variables do in Setaid.ini because I don&apos;t have access to the deployment package part of SEMP (I know, most reasons are red tape in my case).</p>
<p>I&apos;ll keep this updated when I gather more.</p>]]></description><link>https://leonc.info/setaid-ini-for-sep-installs/</link><guid isPermaLink="false">5cd1d8083824960794cf409f</guid><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Tue, 27 Mar 2018 16:22:55 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1518687093422-22350097a5f9?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1518687093422-22350097a5f9?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Setaid.ini for SEP installs"><p>I had such a hard time finding what some of the variables do in Setaid.ini because I don&apos;t have access to the deployment package part of SEMP (I know, most reasons are red tape in my case).</p>
<p>I&apos;ll keep this updated when I gather more. Their support page also gets updated too.</p>
<p><a href="https://support.symantec.com/en_US/article.TECH102668.html?ref=leonc.info">https://support.symantec.com/en_US/article.TECH102668.html</a><br>
<a href="https://www.symantec.com/connect/forums/reboot-options?ref=leonc.info#comment-1548481">https://www.symantec.com/connect/forums/reboot-options#comment-1548481</a></p>
<p>Under <code>[CUSTOM_SMC_CONFIG]</code>:</p>
<p><code>KeepPreviousSetting=val</code><br>
0 = Do not keep previous settings<br>
1 = Keep previous settings<br>
Note: This setting pertains to maintain existing settings in the package creation tab.</p>
<p><code>DestinationDirectory=installation_path</code></p>
<p><code>AddProgramIntoStartMenu=val</code><br>
0 = Do not an entry to the Start menu<br>
1 = Add an entry to the Start menu</p>
<p><code>InstallUserInterfaceLevel=val</code><br>
u = unattended<br>
s = silent<br>
f = interactive</p>
<p><code>UIRebootMode=val</code><br>
0 - Display a Yes / No option if reboot is needed<br>
1 - Display pop-up and do reboot when UI level is f, u or s<br>
3 - No pop-up and no reboot when UI level is f, u, or s</p>
<p>Under <code>[LU_CONFIG]</code>:<br>
<code>CONNECT_LU_SERVER=val</code></p>
<p>0 = Do not run LiveUpdate at the end of the install, which overrides the RUNLIVEUPDATE property<br>
1 = Use the default behavior for running LiveUpdate</p>
<p>Under <code>[FEATURE_SELECTION]</code> , the following entries are valid for SEP 12.1.x (where val is 0 = Don&apos;t install the feature and 1 = Install the feature):</p>
<p><code>Core=val</code> (required)<br>
<code>SAVMain=val</code><br>
<code>Download= val</code><br>
<code>OutlookSnapin=val</code><br>
<code>NotesSnapin= val</code><br>
<code>Pop3Smtp= val</code><br>
<code>PTPMain= val</code><br>
<code>TruScan= val</code><br>
<code>DCMain= val</code><br>
<code>NTPMain= val</code><br>
<code>ITPMain= val</code><br>
<code>Firewall= val</code><br>
<code>LANG1033= val</code></p>
<p>SEP 14.x<br>
<code>SAVMain=val</code><br>
<code>Download=val</code><br>
<code>OutlookSnapin=val</code><br>
<code>NotesSnapin=val</code><br>
<code>Pop3Smtp=val</code><br>
<code>PTPMain=val</code><br>
<code>TruScan=val</code><br>
<code>DCMain=val</code><br>
<code>NTPMain=val</code><br>
<code>ITPMain=val</code><br>
<code>Firewall=val</code><br>
<code>Core=val</code> (Required)<br>
<code>Saep=val</code></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[State Migration Point]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Hello! It&apos;s been awhile. Doing many things at work now-a-days. Here&apos;s something I&apos;ve been working on in SCCM. We are migrating folks from Windows 7 to Windows 10 (it works with 8 and 8.1 as well), but we have to switch folks to</p>]]></description><link>https://leonc.info/sccm-state-migration-point/</link><guid isPermaLink="false">5cd1d8083824960794cf409e</guid><category><![CDATA[USMT]]></category><category><![CDATA[SCCM]]></category><category><![CDATA[State Migration Point]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Mon, 01 May 2017 17:07:30 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1491330779004-002d63718532?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1491330779004-002d63718532?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="State Migration Point"><p>Hello! It&apos;s been awhile. Doing many things at work now-a-days. Here&apos;s something I&apos;ve been working on in SCCM. We are migrating folks from Windows 7 to Windows 10 (it works with 8 and 8.1 as well), but we have to switch folks to UEFI &amp; Secure Boot &amp; enable TPM for BitLocker encryption. The newer SCCM CB has a tool that allows you to do this without reformatting the drive to UEFI/GPT but we are just going to refresh their install instead since we&apos;ve been doing this for awhile now.</p>
<p>We are using a State Migration Point (SMP) per site to store user profiles. The User State Migration Tool makes this easy. The hardest part is figuring out how to configure USMT which we won&apos;t be covering today. We are going to configure the server you&apos;re going to use for storing the user profiles.</p>
<p>These are the guides I used:<br>
<a href="https://technet.microsoft.com/en-us/library/bb693655.aspx?ref=leonc.info">https://technet.microsoft.com/en-us/library/bb693655.aspx</a><br>
<a href="https://www.systemcenterdudes.com/how-to-install-sccm-2012-state-migration-point/?ref=leonc.info">https://www.systemcenterdudes.com/how-to-install-sccm-2012-state-migration-point/</a></p>
<ul>
<li>
<p>After a new server is brought online, make sure SCCM Client is installed (and restart when it&apos;s done if you manually install it); have your SCCM client grab all available software updates if this is your Windows Update of choice (this will take a while)</p>
</li>
<li>
<p>In Server Management, add Roles &amp; Features:</p>
<ul>
<li>IIS Role in addition to the defaults:
<ul>
<li>Web Server &gt; Security &gt; <strong>Windows Authentication</strong></li>
<li>Web Server &gt; Application Development &gt; <strong>ISAPI Extensions</strong></li>
<li>Management Tools &gt; <strong>IIS Management Scripts and Tools</strong></li>
<li>Management Tools &gt; IIS 6 Management Compatibility &gt; <strong>IIS 6 Metabase Compatibility</strong> &amp; <strong>IIS 6 WMI Compatibility</strong></li>
</ul>
</li>
<li>Remote Differential Compression</li>
</ul>
</li>
<li>
<p>Restart the server</p>
</li>
<li>
<p>Create an empty file called <code>NO_SMS_ON_DRIVE.SMS</code> on the root of the C: drive to prevent SCCM from filling up the OS drive</p>
</li>
<li>
<p>Create a folder on the data drive (Assuming you have 2 drives!) called UserState, I do this so the root of my data drive is a bit more organize. Some of my sites are small enough that my SMP is the same as my Distribution Point.</p>
</li>
<li>
<p>Add new SMP server to Console:</p>
<ul>
<li>Administration &gt; Site Config &gt; Servers and Site System Roles &gt; Create Site System Server</li>
<li>Enter the FQDN of your SMP &amp; Site Code, use either your Site Server&apos;s computer account or your SCCM service account, either will work.</li>
<li>Proxy depends on your infrastructure. Most likely No Proxy needed.</li>
<li>Check State Migration Point &gt; Next</li>
<li>Click on the &quot;Starburst&quot; icon to configure where the User Profiles should be stored on the server. (i.e.: D:\UserState)<br>
100MB Reserve and Max client of 50 (or however many connections your server can handle) &gt; OK</li>
<li>Depending on the project; Delete After should be configured with a couple days for testing and at least 1 day if the migration fail for any reason. &gt; Next</li>
<li>Add Boundary Group (pre-existing ones)</li>
</ul>
</li>
<li>
<p>Check logs to verify your work: <code>SMSSMPSetup.log</code> and <code>SMPmsi.log</code> on SMP (InstallationDrive\SMS\Logs)</p>
</li>
<li>
<p>Check for a new folder inside UserState that ends in a $</p>
</li>
<li>
<p>Start testing!</p>
</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SCCM testdbupgrade]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>When you are trying to run <code>setup /testdbupgrade</code> and you get an error asking for a native client (because you&apos;re running the command outside of your DB site or just doesn&apos;t have this particular cli that SCCM db test is looking for), you should grab the</p>]]></description><link>https://leonc.info/sccm-testdbupgrade/</link><guid isPermaLink="false">5cd1d8083824960794cf409d</guid><category><![CDATA[SCCM]]></category><category><![CDATA[sql]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Mon, 03 Oct 2016 19:52:15 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1518349619113-03114f06ac3a?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1518349619113-03114f06ac3a?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="SCCM testdbupgrade"><p>When you are trying to run <code>setup /testdbupgrade</code> and you get an error asking for a native client (because you&apos;re running the command outside of your DB site or just doesn&apos;t have this particular cli that SCCM db test is looking for), you should grab the <a href="http://go.microsoft.com/fwlink/?LinkID=239648&amp;clcid=0x409&amp;ref=leonc.info">sqlncli.msi (x64)</a> from Microsoft <a href="https://www.microsoft.com/en-us/download/confirmation.aspx?id=29065&amp;ref=leonc.info">SQL Server 2012 Feature Pack</a>. Or you can grab it from running setup to get that as a prereq download ($SCCMInstallISORoot\SMSSETUP\BIN\X64\SetupDL.exe).</p>
<p>Also, if you&apos;re having trouble pointing to your SQL server using SERVER\dbinstance in your testdbupgrade switch, you can try <code>setup /testdbupgrade $dbinstance /testsqlserver $SERVER</code></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SCCM Task Sequence Missing Package]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>If you work in with SCCM imaging, you&apos;ve probably seen where your task sequence bombs out saying you&apos;re missing a package. Most of the time, it will tell you which package is missing.</p>
<p>That didn&apos;t happen today.</p>
<p>It just said that I was missing</p>]]></description><link>https://leonc.info/sccm-task-sequence/</link><guid isPermaLink="false">5cd1d8083824960794cf409c</guid><category><![CDATA[SCCM]]></category><category><![CDATA[ Task Sequence]]></category><category><![CDATA[ Command Prompt]]></category><category><![CDATA[F8]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Fri, 26 Aug 2016 19:09:16 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1513672494107-cd9d848a383e?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1513672494107-cd9d848a383e?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="SCCM Task Sequence Missing Package"><p>If you work in with SCCM imaging, you&apos;ve probably seen where your task sequence bombs out saying you&apos;re missing a package. Most of the time, it will tell you which package is missing.</p>
<p>That didn&apos;t happen today.</p>
<p>It just said that I was missing a package but didn&apos;t say which. So I went to grab the SMSTS.log from <code>X:\Windows\Temp\SMSTSLog\smsts.log</code>, threw it on a flash stick to look at it with CMTrace on my computer. (I didn&apos;t copy CMTrace to my WinPE, sorry about it)</p>
<p>Wellp, I was thinking how annoying that was and wondered if there&apos;s some kind of string I could grep (coming from Macs, this was my first thought).</p>
<p>End results:<br>
<code>type X:\Windows\Temp\SMSTSLog\smsts.log | find &quot;Failed to find&quot;</code></p>
<p><code>find</code> is a very simple string search, <code>findstr</code> is a little more powerful but isn&apos;t available in a standard WinPE build.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SSD Fan Control]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>If you ever replaced a HDD in an iMac (pre-flat, and post white kinds), you&apos;ve probably had a very loud fan and found <a href="https://bjango.com/mac/istatmenus/?ref=leonc.info">iStat Menus</a> or <a href="https://exirion.net/ssdfanctrl/?ref=leonc.info">SSD Fan Control</a> to fix the noise because you didn&apos;t want/need/know about getting a thermal detector. They are</p>]]></description><link>https://leonc.info/ssd-fan-control/</link><guid isPermaLink="false">5cd1d8083824960794cf409a</guid><category><![CDATA[terminal]]></category><category><![CDATA[ssd]]></category><category><![CDATA[launchd]]></category><category><![CDATA[LaunchDaemons]]></category><category><![CDATA[fan]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Fri, 23 Oct 2015 15:22:13 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1513366884929-f0b3bedfb653?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1513366884929-f0b3bedfb653?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="SSD Fan Control"><p>If you ever replaced a HDD in an iMac (pre-flat, and post white kinds), you&apos;ve probably had a very loud fan and found <a href="https://bjango.com/mac/istatmenus/?ref=leonc.info">iStat Menus</a> or <a href="https://exirion.net/ssdfanctrl/?ref=leonc.info">SSD Fan Control</a> to fix the noise because you didn&apos;t want/need/know about getting a thermal detector. They are both awesome apps so check them out if you&apos;ve just been living with the fan being on all the time or thinking about installing a SSD in your old iMac.</p>
<p>I recently got iStat Menus because I also needed to see the temps in my dying iMac and it comes with a fan control as well. I still had SSD Fan Control installed because I didn&apos;t know about the fan control till later. They now fight to control the HDD Fan but SSD Fan Control always win, leaving the fan running at different speed than what you set in iStat.</p>
<p>I finally bugged the developer over at Exirion for SSD Fan Control for uninstallation help.</p>
<p>I added the unloading of the service first, then remove the daemon and app.</p>
<pre><code class="bash">sudo launchctl unload -F &quot;/Library/LaunchDaemons/net.exirion.ssdfanctrl.plist&quot;

sudo rm &quot;/Library/LaunchDaemons/net.exirion.ssdfanctrl.plist&quot;
sudo rm -Rf &quot;/Library/StartupItems/SSDFanControl&quot;
sudo rm -Rf &quot;/Applications/SSD Fan Control.app&quot;
</code></pre><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[find Command]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>In an attempt to remove .DS_Store files that Finder creates on network shares, I learned about the -exec option in the <code>find</code> command. Sometimes <code>find</code> can feel overwhelming, especially when you&apos;ve been spoiled by Spotlight or Google, but basically it&apos;s formatted this way:</p>
<pre><code>find [options]</code></pre>]]></description><link>https://leonc.info/find-command/</link><guid isPermaLink="false">5cd1d8083824960794cf4098</guid><category><![CDATA[terminal]]></category><category><![CDATA[find]]></category><category><![CDATA[AppleDouble]]></category><category><![CDATA[dot_clean]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Sat, 09 May 2015 22:03:03 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1528911104572-560677f3996b?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1528911104572-560677f3996b?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="find Command"><p>In an attempt to remove .DS_Store files that Finder creates on network shares, I learned about the -exec option in the <code>find</code> command. Sometimes <code>find</code> can feel overwhelming, especially when you&apos;ve been spoiled by Spotlight or Google, but basically it&apos;s formatted this way:</p>
<pre><code>find [options] [path] [expression]
</code></pre>
<p>Back to our story about the dot underbar files on network shares. Once upon a time, you had to run <code>defaults write com.apple.desktopservices DSDontWriteNetworkStores true</code> (from <a href="https://support.apple.com/en-us/HT1629?ref=leonc.info">https://support.apple.com/en-us/HT1629</a>) for each user to prevent AppleDouble/dot underbar files from clobbering your network shares (in some companies, uniformed looking shares are important). Sometimes you had users that didn&apos;t get that <code>defaults</code> written to their user profile and you had to clear out either .DS_Store and AppleDouble files.</p>
<p><strong>Now, in good practice, you should never have to delete the dot underbar and .DS_Store files!</strong></p>
<p>Here are some commands I&apos;ve used and please be very careful when you use them. You&apos;ve been warned, and I&apos;m not responsible for your accident disclaimer goes here.</p>
<p>First let&apos;s start with a simple search:</p>
<p>Find icons:</p>
<pre><code>find /Library/Printers -name *.icns
</code></pre>
<p>In the above example, we&apos;re looking for icons to use with our Munki 2 installation, specifically icons that are related to printers (self-service printer installation, perhaps). It says to:<br>
Find in the directory <code>/Library/Printers</code> recursively for files with the name <code>*.icns</code>, standard wildcards apply.</p>
<p><strong>You should never have to delete the dot underbar and .DS_Store files!</strong></p>
<p>.DS_Store cleaning:</p>
<pre><code>find . -name &quot;.DS_Store&quot; -exec rm &quot;{}&quot; \;
</code></pre>
<p>In the above example, it says:<br>
Find from the Current Directory, recurisvely (it is recursive by default) that has a file named exactly &quot;.DS_Store&quot; and perform the command <code>rm</code> from the results of the find, and perform it for each result.</p>
<p>AppleDouble cleaning:</p>
<pre><code>find . -type d -exec dot_clean -f &quot;{}&quot; \;
</code></pre>
<p>In the above example, it says:<br>
Find from the Current Directory, recursively, that are Directories and perform the command <code>dot_clean -f</code> from the results of the <code>find</code>. The &quot;{}&quot; carries the results and ; breaks the line so it performs the command in every line of the result as we see in the last example. (Added -f to <code>dot_clean</code> so it doesn&apos;t recursively search as well, this is just to show our new <code>find</code> prowlness, I&apos;m so punny!) There are more options for <code>dot_clean</code>, so make use of <code>man dot_clean</code>!</p>
<p>There are way more powerful things you can do with <code>find</code> that I haven&apos;t even scratched yet. You can always <code>man find</code> for more file types to search for and do different searches with -iname or -xattr.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Using Munki to manage Profiles from Profile Manager]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Sometimes, you want to use a profile to enforce some OS X settings. Whether you&apos;re moving away from MCX or Profile Manager is isn&apos;t delivering your profiles, you can use Munki to push it out.</p>
<p>You will still need Profile Manager to make profiles, or you</p>]]></description><link>https://leonc.info/using-munki-to-manage-profiles-from-profile-manager/</link><guid isPermaLink="false">5cd1d8083824960794cf4094</guid><category><![CDATA[munki]]></category><category><![CDATA[mdm]]></category><category><![CDATA[Profile Manager]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Thu, 05 Feb 2015 15:27:12 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1464865885825-be7cd16fad8d?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1464865885825-be7cd16fad8d?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Using Munki to manage Profiles from Profile Manager"><p>Sometimes, you want to use a profile to enforce some OS X settings. Whether you&apos;re moving away from MCX or Profile Manager is isn&apos;t delivering your profiles, you can use Munki to push it out.</p>
<p>You will still need Profile Manager to make profiles, or you can use MCX to Profile to convert your MCX to .mobileconfig (profile!). Then wrap your profile into a .pkg with this tool: <a href="https://github.com/timsutton/make-profile-pkg?ref=leonc.info">make-profile-pkg</a></p>
<p>It will even generate a recipt and an uninstall shell script to remove the the profile should you ever need to uninstall it! (Or put it in Munki as the uninstall script)</p>
<p>You can use this InstallCheck_Script for Munki to ensure that your profile is installed.</p>
<p>InstallCheck_Script:</p>
<pre><code class="bash">#!/bin/sh
# Check if the profile is installed with Munki

HasProfile=$(/usr/bin/profiles -C | /usr/bin/grep &quot;com.apple.mdm.mymdmserver.mydomain.com.12345678-9984-0130-2b83-406c8f235887.alacarte&quot;)

# The version of the package
PKG_VERSION=&quot;2014.07.08&quot;

# The identifier of the package
PKG_ID=&quot;com.github.makeprofilepkg.Settings_for_bss-base&quot;

# The version installed from pkgutil
VERSION_INSTALLED=$(/usr/sbin/pkgutil --pkg-info ${PKG_ID} | /usr/bin/grep version | /usr/bin/sed &apos;s/^[^:]*: //&apos;)

if [ -z &quot;${HasProfile}&quot; ]
  then
  # Empty String - Not installed
  exit 0
else
  if [ &quot;$VERSION_INSTALLED&quot; = &quot;$PKG_VERSION&quot; ]
    then
      # Has a matching pkg version and profile identifier - Is installed
      exit 1
    else
      # Has a matching profile identifier but the pkg version is not the same - Not installed
      exit 0
  fi
fi
</code></pre>
<p>Make sure you edit the InstallCheck_Script to match your profile identifier. The reason you would want Munki to check the identifier instead of the receipt is because that will stay even if you manually remove the profile. This script will check profiles instead to make sure it&apos;s actually active.</p>
<p>So now you have your InstallCheck_Script, you have your .mobileconfig wrapped in a .pkg as the payload, you have your uninstall script. They are all ready to go into the appropriate place in Munki.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Creating User Records with dscl]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I was decomissioning an Xserve from serving MCX (I was turning off Open Directory) to keep it from serving some transitional MCX. Long story short, I deleted the OD. However, the Xserve was still running a print server for Linux boxes and now,<br>
root was gone! Could not <code>sudo</code> or</p>]]></description><link>https://leonc.info/creating-user-records-with-dscl/</link><guid isPermaLink="false">5cd1d8083824960794cf4095</guid><category><![CDATA[dscl]]></category><category><![CDATA[root]]></category><category><![CDATA[xserve]]></category><category><![CDATA[Snow Leopard]]></category><category><![CDATA[Snow Leopard Server]]></category><category><![CDATA[single user mode]]></category><dc:creator><![CDATA[Leon Chung]]></dc:creator><pubDate>Wed, 20 Aug 2014 16:30:57 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1470173274384-c4e8e2f9ea4c?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1470173274384-c4e8e2f9ea4c?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Creating User Records with dscl"><p>I was decomissioning an Xserve from serving MCX (I was turning off Open Directory) to keep it from serving some transitional MCX. Long story short, I deleted the OD. However, the Xserve was still running a print server for Linux boxes and now,<br>
root was gone! Could not <code>sudo</code> or <code>su</code> to <em>root</em>. It kept giving me Unknown user.</p>
<p>It turns out, root was really gone.<br>
The Xserve was running 10.6 server. I was still able to log in as a regular user, but the Linux admin using this server for the printers could not function without <code>sudo</code> (I didn&apos;t ask what he needed it for, maybe just needed full lpadmin?)</p>
<p>Anyway, I needed it up and there wasn&apos;t a backup (because why would there be in a production environment? <em>/sigh</em>)</p>
<p>I would like to thank <a href="https://twitter.com/mikeymikey?ref=leonc.info">frogor</a> again for his guidance.</p>
<p>We attempted some troubleshooting in <a href="https://support.apple.com/en-us/HT201573?ref=leonc.info">Single User Mode</a> by booting with <code>Command + s</code> held down.</p>
<p><em>root</em> was working in Single User Mode, so that was a relief. However, if you try to call it; it just can&apos;t be found. We decided to check with <code>dscl</code> to see what it would return if we query for <em>root</em>.</p>
<p>If you try to run <code>dscl . -list /Users</code>, it will not work because your Mac won&apos;t understand the current node and it doesn&apos;t have the alias for /Users. Also, you can&apos;t read it without mounting your system. Do this:<br>
<code>fsck -fy</code> - File System Check<br><br>
<code>mount -uw /</code> - Mount /</p>
<p>Load your directory, and it will tell you that you can only mess with the <em>localonly</em> node.<br>
<code>launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist</code></p>
<p>In order to list /Users, you need to append the full path /Local/Default. At one point, I thought all users were gone, but I was just using the wrong path.<br>
<code>dscl localonly -list /Local/Default/Users</code></p>
<p><em>root</em> was really gone, but <em>root</em> was still in the admin and staff groups <code>dscl localonly -read /Local/Default/Groups/staff</code> and a line still existed for <em>root</em> in <code>/etc/passwd</code>. I attempted to re-create root hoping that only the user record was gone, there are several ways to do this. You can use dscl to create the record, MagerValp&apos;s CreateUserPkg.app, or restore a .plist from a known good equal version OS. The last 2 requires Target Disk Mode as you won&apos;t be able to authenticate to make changes in regular user mode. gneagle found this link to help out with Target Disk Mode for your Xserve: <a href="http://manuals.info.apple.com/MANUALS/0/MA936/en_US/Xserve_User_Guide.pdf?ref=leonc.info">Xserve User Guide</a> On Page 14, it even tells you how to start TDM without a keyboard.</p>
<p>At this point, frogor had a copy of the <code>/private/var/db/dslocal/nodes/Default/users/root.plist</code> from a 10.6 machine, I had a 10.8 laptop with all the records that root has in <code>dscl</code>. The 10.6 record seem to have less things (the plist is attached on the bottom of this page).</p>
<p>Anyway, on to the commands:</p>
<pre><code class="language-bash">dscl localonly -create /Local/Default/Users/root
dscl localonly -create /Local/Default/Users/root UniqueID 0
dscl localonly -create /Local/Default/Users/root PrimaryGroupID 0
dscl localonly -create /Local/Default/Users/root RealName &quot;System Administrator&quot;
dscl localonly -create /Local/Default/Users/root RecordName root &quot;BUILTIN\Local System&quot;
dscl localonly -create /Local/Default/Users/root AppleMetaNodeLocation /Local/Default
dscl localonly -create /Local/Default/Users/root GeneratedUID FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
dscl localonly -create /Local/Default/Users/root NFSHomeDirectory /var/root
dscl localonly -create /Local/Default/Users/root UserShell /bin/sh
dscl localonly -create /Local/Default/Users/root SMBSID S-1-5-18
</code></pre>
<p>The <em>root</em> user record is now recreated.<br>
We attmpted <code>reboot</code> into our normal environment and tested that <code>sudo</code> is working and <code>sudo -s</code> was also working. I was very lucky that the rest of the records were intact, but this gave me a whole new insight on using <code>dscl</code> and reading users/groups records on the system.</p>
<p>Here is the root.plist</p>
<pre><code class="language-markup">
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>dsAttrTypeStandard:AppleMetaNodeLocation</key>
	<array>
		<string>/Local/Default</string>
	</array>
	<key>dsAttrTypeStandard:AuthenticationAuthority</key>
	<array>
		<string>;DisabledUser;;ShadowHash;</string>
	</array>
	<key>dsAttrTypeStandard:GeneratedUID</key>
	<array>
		<string>FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000</string>
	</array>
	<key>dsAttrTypeStandard:NFSHomeDirectory</key>
	<array>
		<string>/var/root</string>
	</array>
	<key>dsAttrTypeStandard:Password</key>
	<array>
		<string>********</string>
	</array>
	<key>dsAttrTypeStandard:PrimaryGroupID</key>
	<array>
		<string>0</string>
	</array>
	<key>dsAttrTypeStandard:RealName</key>
	<array>
		<string>System Administrator</string>
	</array>
	<key>dsAttrTypeStandard:RecordName</key>
	<array>
		<string>root</string>
	</array>
	<key>dsAttrTypeStandard:RecordType</key>
	<array>
		<string>dsRecTypeStandard:Users</string>
	</array>
	<key>dsAttrTypeStandard:SMBSID</key>
	<array>
		<string>S-1-5-18</string>
	</array>
	<key>dsAttrTypeStandard:UniqueID</key>
	<array>
		<string>0</string>
	</array>
	<key>dsAttrTypeStandard:UserShell</key>
	<array>
		<string>/bin/sh</string>
	</array>
</dict>
</plist>
```
</code></pre><!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>