<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Microsoft | KC's Blog</title>
	<atom:link href="https://www.kjctech.net/category/information-technology/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.kjctech.net</link>
	<description></description>
	<lastBuildDate>Fri, 14 Mar 2025 21:38:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/www.kjctech.net/wp-content/uploads/2016/12/cropped-KC-Logo.png?fit=32%2C32&#038;ssl=1</url>
	<title>Microsoft | KC's Blog</title>
	<link>https://www.kjctech.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">24634607</site>	<item>
		<title>Group Policy to Bypass the UAC Prompt After PrinterNightmare Patch</title>
		<link>https://www.kjctech.net/group-policy-to-bypass-the-uac-prompt-after-printernightmare-patch/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=group-policy-to-bypass-the-uac-prompt-after-printernightmare-patch</link>
					<comments>https://www.kjctech.net/group-policy-to-bypass-the-uac-prompt-after-printernightmare-patch/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Fri, 14 Mar 2025 21:37:50 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5210</guid>

					<description><![CDATA[<p>The patch was released back in 2021 to meditate a remote code execution vulnerability, aka &#8220;PrintNightmare&#8221;. After the patch was installed, only accounts that have local admin rights could install or update any printer driver from a printer server. A UAC prompt will pop up every time you try to install a printer from a printer server. To bypass that, [&#8230;]</p>
The post <a href="https://www.kjctech.net/group-policy-to-bypass-the-uac-prompt-after-printernightmare-patch/">Group Policy to Bypass the UAC Prompt After PrinterNightmare Patch</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><a href="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527">The patch</a> was released back in 2021 to meditate a remote code execution vulnerability, aka &#8220;PrintNightmare&#8221;. After the patch was installed, only accounts that have local admin rights could install or update any printer driver from a printer server. </p>



<p>A UAC prompt will pop up every time you try to install a printer from a printer server. To bypass that, you can deploy two group policy settings, both for computer devices and in the same location.</p>



<p>Open Group Policy Management and head over to the following location.</p>



<pre class="wp-block-preformatted">Computer Configuration > Administrative Templates > Printers</pre>



<p>Then disable both following settings.</p>



<ul class="wp-block-list">
<li>Limits print driver installation to Administrators</li>



<li>Point and Print Restrictions</li>
</ul>



<p>The first setting is to allow non-admin users to install printers and the second one is to bypass the UAC prompt when doing so. Ideally, you should enable (instead of disabling it) the second setting to limit the installation only from certain printer servers.</p>



<p>Obviously, disabling both settings will also undo the meditation the patch put in place. Use it as the final resort or as a temporary solution.</p>



<h4 class="wp-block-heading">References:</h4>



<ul class="wp-block-list">
<li><a href="KB5005010: Restricting installation of new printer drivers after applying the July 6, 2021 updates - Microsoft Support">KB5005010</a></li>



<li><a href="https://support.microsoft.com/en-us/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872">KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481) &#8211; Microsoft Support</a></li>
</ul>



<p></p>The post <a href="https://www.kjctech.net/group-policy-to-bypass-the-uac-prompt-after-printernightmare-patch/">Group Policy to Bypass the UAC Prompt After PrinterNightmare Patch</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/group-policy-to-bypass-the-uac-prompt-after-printernightmare-patch/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5210</post-id>	</item>
		<item>
		<title>Managing Microsoft Licenses in PowerShell and Microsoft Graph</title>
		<link>https://www.kjctech.net/manage-microsoft-licenses-in-powershell-and-microsoft-graph/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=manage-microsoft-licenses-in-powershell-and-microsoft-graph</link>
					<comments>https://www.kjctech.net/manage-microsoft-licenses-in-powershell-and-microsoft-graph/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Fri, 14 Mar 2025 20:05:11 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft 365]]></category>
		<category><![CDATA[Microsoft Graph]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5204</guid>

					<description><![CDATA[<p>Most of the time, I manage the licensing part of Microsoft 365 manually, but from time to time, using PowerShell can be easy and clean. To view account license and service details First, connect to Microsoft Graph. Connect-Graph To list all license plans you purchased with part number and ID, Get-MgSubscribedSku &#124; Select-Object SkuPartNumber, SkuID To list the services that [&#8230;]</p>
The post <a href="https://www.kjctech.net/manage-microsoft-licenses-in-powershell-and-microsoft-graph/">Managing Microsoft Licenses in PowerShell and Microsoft Graph</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>Most of the time, I manage the licensing part of Microsoft 365 manually, but from time to time, using PowerShell can be easy and clean.</p>



<h3 class="wp-block-heading">To view account license and service details</h3>



<p>First, connect to Microsoft Graph.</p>



<pre class="wp-block-preformatted">Connect-Graph</pre>



<p>To list all license plans you purchased with part number and ID,</p>



<pre class="wp-block-preformatted">Get-MgSubscribedSku | Select-Object SkuPartNumber, SkuID</pre>



<p>To list the services that are available in each license plan,</p>



<pre class="wp-block-code"><code lang="powershell" class="language-powershell">$allSKUs = Get-MgSubscribedSku
$allSKUs | ForEach-Object {
  "Service Plan: " + $_.SkuPartNumber
  $_.ServicePlans | Select-Object ServicePlanName, ServicePlanID
}</code></pre>



<p>To list all license plans assigned to a specific user,</p>



<pre class="wp-block-preformatted">Get-MgUserLicenseDetail -UserID $userID</pre>



<p>To list all services from all assigned license plans for a specific user,</p>



<pre class="wp-block-preformatted">(Get-MgUserLicenseDetail -UserID $userID -Property ServicePlans).ServicePlans</pre>



<p>Service plans can be quite messy if you manage them manually so using PowerShell could save a lot of time and could make things a lot easier.</p>



<h3 class="wp-block-heading">To assign or remove a license plan from a user account</h3>



<p>Now you need to sign in to Microsoft Graph with some extra permission scope.</p>



<pre class="wp-block-preformatted">Connect-MgGraph -Scopes User.ReadWrite.All</pre>



<p>You will also need to make sure the <strong><em>UsageLocation</em></strong> is set for the user before assigning any license plans, e.g. US for the United States and CA for Canada, etc. To find out all the accounts in your tenant that don&#8217;t have a <strong><em>UsageLocation</em></strong> value, run the command below.</p>



<pre class="wp-block-preformatted">Get-MgUser -Select Id,DisplayName,Mail,UserPrincipalName,UsageLocation,UserType | where { $_.UsageLocation -eq $null -and $_.UserType -eq 'Member' }</pre>



<p>To assign a license plan to a specific user,</p>



<pre class="wp-block-preformatted">Set-MgUserLicense  -UserID $userID -AddLicenses @{SkuID = $skuID} -RemoveLicenses @()</pre>



<p>You can retrieve the license SKUID like this, where $partNumber is the name of the license plan, such as SPB for Business Premium, etc.</p>



<pre class="wp-block-preformatted">$skuID = (Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq $partNumber).SkuID</pre>



<p>To remove a license plan from a specific user,</p>



<pre class="wp-block-preformatted">Set-MgUser-License -UserID $userID -RemoveLicenses @($skuID) -AddLicenses @()</pre>



<p>To remove all license plans from a specific user,</p>



<pre class="wp-block-preformatted">Get-MgUserLicenseDetail -UserId $userID | ForEach-Object {Set-MgUserLicense -Userid $userID -RemoveLicenses @($_.skuid) -AddLicenses @()}</pre>



<h4 class="wp-block-heading">References:</h4>



<ul class="wp-block-list">
<li><a href="https://learn.microsoft.com/en-us/microsoft-365/enterprise/view-licenses-and-services-with-microsoft-365-powershell?view=o365-worldwide">View Microsoft 365 Licenses and Services with PowerShell</a></li>
</ul>



<p></p>The post <a href="https://www.kjctech.net/manage-microsoft-licenses-in-powershell-and-microsoft-graph/">Managing Microsoft Licenses in PowerShell and Microsoft Graph</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/manage-microsoft-licenses-in-powershell-and-microsoft-graph/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5204</post-id>	</item>
		<item>
		<title>Audit Email Deletion in Microsoft 365</title>
		<link>https://www.kjctech.net/audit-email-deletion-in-microsoft-365/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=audit-email-deletion-in-microsoft-365</link>
					<comments>https://www.kjctech.net/audit-email-deletion-in-microsoft-365/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Wed, 26 Jun 2024 06:04:05 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[M365]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5188</guid>

					<description><![CDATA[<p>If you use a shared mailbox and sometimes wonder who deleted some of the emails from the inbox, you can search the audit log to find out. Before you go any further, check if you have turned on the Audit Log Search in your tenant first. Get-AdminAuditLogConfig &#124; Format-List UnifiedAuditLogIngestionEnabled If you haven&#8217;t, do this to turn it on. Set-AdminAuditLogConfig [&#8230;]</p>
The post <a href="https://www.kjctech.net/audit-email-deletion-in-microsoft-365/">Audit Email Deletion in Microsoft 365</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>If you use a shared mailbox and sometimes wonder who deleted some of the emails from the inbox, you can search the audit log to find out.</p>



<p>Before you go any further, check if you have turned on the Audit Log Search in your tenant first.</p>



<pre class="wp-block-preformatted">Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled</pre>



<p>If you haven&#8217;t, do this to turn it on.</p>



<pre class="wp-block-preformatted">Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true</pre>



<p>To do the search, you can either go through the Compliance Portal or use the PowerShell cmdlet.</p>



<ol class="wp-block-list">
<li>Sign into the Compliance Portal</li>



<li>Go to the <strong>Audit tab</strong> on the left panel</li>



<li>Select the <strong>New Search</strong> tab at the top of the <strong>Audit</strong> page.</li>
</ol>



<p>Then configure the search criteria as applicable. It took me some time to figure it out and then a few tries to get my result.</p>



<p>Check details on how to perform the search <a href="https://learn.microsoft.com/en-us/purview/audit-search" target="_blank" rel="noopener" title="">here</a>.</p>



<p>Obviously, as always, using PowerShell cmdlets or scripts makes things much easier. Check out <a href="https://learn.microsoft.com/en-us/purview/audit-log-search-script" target="_blank" rel="noopener" title="">this script from Microsoft</a> to get started on how it works. But if you like a more powerful script that works out of the box. Give <a href="https://o365reports.com/2021/09/02/audit-email-deletion-in-office-365-mailbox-powershell/" target="_blank" rel="noopener" title="">this </a>a serious look.</p>



<p>For example, I used it to check if any email deletions were happening after May 30, 2024 from a mailbox called overtime.</p>



<pre class="wp-block-preformatted">./auditdeleteemails.ps1 -mailbox "overtime" -StartDate 05/30/2024</pre>



<p>It saves the result in a CSV file for you to review.</p>The post <a href="https://www.kjctech.net/audit-email-deletion-in-microsoft-365/">Audit Email Deletion in Microsoft 365</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/audit-email-deletion-in-microsoft-365/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5188</post-id>	</item>
		<item>
		<title>Adding Multiple Server Names to A Windows Server</title>
		<link>https://www.kjctech.net/adding-multiple-server-names-to-a-windows-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-multiple-server-names-to-a-windows-server</link>
					<comments>https://www.kjctech.net/adding-multiple-server-names-to-a-windows-server/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Wed, 05 Jun 2024 05:00:41 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[windows server]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5183</guid>

					<description><![CDATA[<p>When it comes to moving data between different servers, being able to assign a second server name to the same server could be very useful. It&#8217;s not only possible but fairly easy to do as well. Adding alternate DNS name to a Server If DNS name resolution is the only thing you need, you can either manually add an A [&#8230;]</p>
The post <a href="https://www.kjctech.net/adding-multiple-server-names-to-a-windows-server/">Adding Multiple Server Names to A Windows Server</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>When it comes to moving data between different servers, being able to assign a second server name to the same server could be very useful. It&#8217;s not only possible but fairly easy to do as well.</p>



<h3 class="wp-block-heading">Adding alternate DNS name to a Server</h3>



<p>If DNS name resolution is the only thing you need, you can either manually add an A record in the DNS server to point the old server name to the same IP address of the new server or add a REG_Multi_SZ registry key to the following location:</p>



<pre class="wp-block-preformatted">HKLM\System\CurrentControlSet\Services\DNSCache\Parameters\AlternateComputerNames</pre>



<p>One FQDN per line and run <em><strong>ipconfig /registerdns</strong></em> for the change to take place.</p>



<h3 class="wp-block-heading">Adding alternate NetBIOS name to a Server</h3>



<p>Add a REG_Multi_SZ registry key to the following location:</p>



<pre class="wp-block-preformatted">HKLM\System\CurrentControlSet\Services\LanManServer\Parameters\OptionalNames</pre>



<p>One NetBIOS name per line and restart the server once done.</p>



<p>If you are adding an additional NetBIOS name to the same server, you most likely will need to access a shared network resource through that name. If that&#8217;s the case, you might need one more step to run the following command in an elevated Command Prompt to allow NTLM authentication for the new alias.</p>



<pre class="wp-block-preformatted">setspn -A host/host_servername alias_name</pre>



<p>Just in case, if you encounter an error saying that the Target account name is incorrect when trying to access a shared file server after adding the name, you may need to use the <strong><em>setspn</em></strong> command line to check and remove the old NetBIOS name from another server.</p>



<h3 class="wp-block-heading">A few resources</h3>



<ul class="wp-block-list">
<li><a href="http://dimitri.janczak.net/2016/09/26/multiple-server-names-on-windows/" target="_blank" rel="noopener" title="">Multiple server names on Windows</a></li>



<li><a href="https://4sysops.com/archives/disable-strict-name-checking-with-powershell/" target="_blank" rel="noopener" title="">Disable Strict Name Checking</a></li>



<li><a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc731241(v=ws.11)#adding-spns" target="_blank" rel="noopener" title="">Setspn command</a></li>
</ul>The post <a href="https://www.kjctech.net/adding-multiple-server-names-to-a-windows-server/">Adding Multiple Server Names to A Windows Server</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/adding-multiple-server-names-to-a-windows-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5183</post-id>	</item>
		<item>
		<title>Enforcing HTTP to HTTPS on IIS</title>
		<link>https://www.kjctech.net/forcing-https-on-iis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=forcing-https-on-iis</link>
					<comments>https://www.kjctech.net/forcing-https-on-iis/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Thu, 25 Apr 2024 05:49:23 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[IIS]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5170</guid>

					<description><![CDATA[<p>The IIS server on Windows doesn&#8217;t have a feature that can automatically redirect traffic out of the box. There are multiple ways to accomplish it but the easiest way is probably to use a module called URL Rewrite. Go to the URL Rewrite Module site to download the installation file and run it on a server you want to enforce [&#8230;]</p>
The post <a href="https://www.kjctech.net/forcing-https-on-iis/">Enforcing HTTP to HTTPS on IIS</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>The IIS server on Windows doesn&#8217;t have a feature that can automatically redirect traffic out of the box. There are multiple ways to accomplish it but the easiest way is probably to use a module called <a href="https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module" target="_blank" rel="noopener" title="">URL Rewrite</a>.</p>



<p>Go to the <a href="https://www.iis.net/downloads/microsoft/url-rewrite" target="_blank" rel="noopener" title="">URL Rewrite Module site</a> to download the installation file and run it on a server you want to enforce the HTTPS traffic.</p>



<p>Once installed, go to the SSL-enabled site on IIS Manager, select <em>URL Rewrite</em>, <em>Add Rules</em>, and a <em>Blank rule</em>. </p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="600" height="271" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=600%2C271&#038;ssl=1" alt="" class="wp-image-5171" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=600%2C271&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=450%2C203&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=250%2C113&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=520%2C235&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=360%2C163&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?resize=100%2C45&amp;ssl=1 100w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-8.png?w=651&amp;ssl=1 651w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<p>Name your rule and set up the details as below:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Match URL</strong><br><em>Requested URL:</em>&nbsp;<code>Matches the Pattern</code><br><em>Using:</em>&nbsp;<code>Wildcards</code><br><em>Pattern:</em>&nbsp;<code>*</code><br><em>Ignore case:</em>&nbsp;Checked</p>



<p><strong>Conditions</strong><br><em>Logical grouping:</em>&nbsp;<code>Match Any</code><br><em>Condition input</em>:&nbsp;<code>{HTTPS}</code><br><em>Check if input string:</em>&nbsp;<code>Matches the Pattern</code><br><em>Pattern:</em>&nbsp;<code>OFF</code><br><em>Ignore case:</em>&nbsp;Checked<br><em>Track capture groups across conditions:</em>&nbsp;Not checked</p>



<p><strong>Server Variables</strong><br>Leave blank.</p>



<p><strong>Action</strong><br><em>Action type:</em>&nbsp;<code>Redirect</code><br><em>Redirect URL:</em>&nbsp;<code>https://{HTTP_HOST}{REQUEST_URI}</code><br><em>Append query string:</em>&nbsp;Not checked<br><em>Redirect type:</em>&nbsp;<code>Permanent (301)</code></p>
</blockquote>



<p>Restart the IIS server and you are all set.</p>The post <a href="https://www.kjctech.net/forcing-https-on-iis/">Enforcing HTTP to HTTPS on IIS</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/forcing-https-on-iis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5170</post-id>	</item>
		<item>
		<title>Self-Signing Certificate to Enable HTTPS on IIS</title>
		<link>https://www.kjctech.net/self-signing-certificate-to-enable-https-on-iis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=self-signing-certificate-to-enable-https-on-iis</link>
					<comments>https://www.kjctech.net/self-signing-certificate-to-enable-https-on-iis/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Tue, 23 Apr 2024 23:04:49 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Certificate Authority]]></category>
		<category><![CDATA[IIS]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5163</guid>

					<description><![CDATA[<p>For internal-use IIS-based sites, you can enable HTTPS by self-signing a certificate and distributing it through the Group Policy so you can avoid seeing warning messages like this. Self-Signing a Certificate Simply open an elevated PowerShell window and run the following command to self-sign a 5-year certificate to the certificate store on the local machine. New-SelfSignedCertificate -DnsName "servername" -CertStoreLocation cert:\LocalMachine\My [&#8230;]</p>
The post <a href="https://www.kjctech.net/self-signing-certificate-to-enable-https-on-iis/">Self-Signing Certificate to Enable HTTPS on IIS</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>For internal-use IIS-based sites, you can enable HTTPS by self-signing a certificate and distributing it through the Group Policy so you can avoid seeing warning messages like this.</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?ssl=1" data-rel="lightbox-image-0" data-rl_title="" data-rl_caption="" title=""><img data-recalc-dims="1" decoding="async" width="600" height="401" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=600%2C401&#038;ssl=1" alt="" class="wp-image-5164" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=600%2C401&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=450%2C300&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=250%2C167&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=520%2C347&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=360%2C240&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?resize=100%2C67&amp;ssl=1 100w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-3.png?w=647&amp;ssl=1 647w" sizes="(max-width: 600px) 100vw, 600px" /></a></figure>



<h3 class="wp-block-heading">Self-Signing a Certificate</h3>



<p>Simply open an elevated PowerShell window and run the following command to self-sign a 5-year certificate to the certificate store on the local machine.</p>



<pre class="wp-block-preformatted">New-SelfSignedCertificate -DnsName "servername" -CertStoreLocation cert:\LocalMachine\My -FriendlyName "servername" -NotAfter (Get-Date).AddYears(5)</pre>



<p>Technically, you can do so on any given computer but it&#8217;s easier to run it right on the IIS server so you don&#8217;t have to move the certificate around.</p>



<h3 class="wp-block-heading">Binding the certificate to IIS</h3>



<p>Right-click the site on IIS and choose Edit Binding. Add the HTTPS (443) binding and pick the certificate you just self-signed from the list.</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?ssl=1" data-rel="lightbox-image-1" data-rl_title="" data-rl_caption="" title=""><img data-recalc-dims="1" decoding="async" width="600" height="398" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=600%2C398&#038;ssl=1" alt="" class="wp-image-5165" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=600%2C398&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=450%2C298&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=250%2C166&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=768%2C509&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=700%2C464&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=520%2C345&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=360%2C239&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?resize=100%2C66&amp;ssl=1 100w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-4.png?w=793&amp;ssl=1 793w" sizes="(max-width: 600px) 100vw, 600px" /></a></figure>



<h3 class="wp-block-heading">Exporting the certificate</h3>



<p>Open the Certificate detail from Server Certificates on the IIS Manager, go to the Details tab, and choose Copy to File&#8230; button.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?ssl=1" data-rel="lightbox-image-2" data-rl_title="" data-rl_caption="" title=""><img data-recalc-dims="1" loading="lazy" decoding="async" width="575" height="559" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?resize=575%2C559&#038;ssl=1" alt="" class="wp-image-5166" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?w=575&amp;ssl=1 575w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?resize=450%2C437&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?resize=250%2C243&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?resize=520%2C506&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?resize=360%2C350&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-5.png?resize=100%2C97&amp;ssl=1 100w" sizes="auto, (max-width: 575px) 100vw, 575px" /></a></figure>



<p>Follow the wizard, choose <strong><em>Yes, export the private key</em></strong>, and <strong><em>Include all certificates in the certification path</em></strong> option to save it with a password.</p>



<h3 class="wp-block-heading">Distributing the certificate via the Group Policy</h3>



<p>Open the Group Policy Management console, and head over to the following location.</p>



<pre class="wp-block-preformatted">Computer Configuration\Policies\Windows Settings\Security Settings\Public Key Policies</pre>



<p>Right-click the <strong><em>Trusted Root Certification Authorities </em></strong>and choose <strong><em>Import</em></strong>.</p>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="461" height="214" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-7.png?resize=461%2C214&#038;ssl=1" alt="" class="wp-image-5168" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-7.png?w=461&amp;ssl=1 461w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-7.png?resize=450%2C209&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-7.png?resize=250%2C116&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-7.png?resize=360%2C167&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-7.png?resize=100%2C46&amp;ssl=1 100w" sizes="auto, (max-width: 461px) 100vw, 461px" /></figure>



<p>Then on the <strong><em>File to Import </em></strong>window, pick the PFX file you exported from the last step. Make sure you pick the *.pfx type from the dropdown list.</p>



<h3 class="wp-block-heading">Forcing HTTPS</h3>



<p>Once the certificate gets distributed to the workstations, <a href="https://www.kjctech.net/forcing-https-on-iis/" target="_blank" rel="noopener" title="Forcing HTTPS on IIS">redirect all HTTP traffic to HTTPS</a> to enforce secure access.</p>The post <a href="https://www.kjctech.net/self-signing-certificate-to-enable-https-on-iis/">Self-Signing Certificate to Enable HTTPS on IIS</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/self-signing-certificate-to-enable-https-on-iis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5163</post-id>	</item>
		<item>
		<title>MDT &#8211; Inject Out-of-Box Drivers for New Computer Models</title>
		<link>https://www.kjctech.net/mdt-inject-out-of-box-drivers-for-new-computer-models/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mdt-inject-out-of-box-drivers-for-new-computer-models</link>
					<comments>https://www.kjctech.net/mdt-inject-out-of-box-drivers-for-new-computer-models/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Fri, 12 Apr 2024 05:00:13 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MDT]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5157</guid>

					<description><![CDATA[<p>When a new computer model comes along, your deployment may fail and end up like this. If that&#8217;s the case, it&#8217;s time to add the drivers of the new computer model to the MDT system. Ideally, you will need two sets of drivers for that new device, one for the WinPE bootable drive and one for regular deployment. Download these [&#8230;]</p>
The post <a href="https://www.kjctech.net/mdt-inject-out-of-box-drivers-for-new-computer-models/">MDT – Inject Out-of-Box Drivers for New Computer Models</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>When a new computer model comes along, your deployment may fail and end up like this.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?ssl=1" data-rel="lightbox-image-0" data-rl_title="" data-rl_caption="" title=""><img data-recalc-dims="1" loading="lazy" decoding="async" width="577" height="369" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?resize=577%2C369&#038;ssl=1" alt="" class="wp-image-5158" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?w=577&amp;ssl=1 577w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?resize=450%2C288&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?resize=250%2C160&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?resize=520%2C333&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?resize=360%2C230&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image.png?resize=100%2C64&amp;ssl=1 100w" sizes="auto, (max-width: 577px) 100vw, 577px" /></a></figure>



<p>If that&#8217;s the case, it&#8217;s time to add the drivers of the new computer model to the MDT system. Ideally, you will need two sets of drivers for that new device, one for the WinPE bootable drive and one for regular deployment.</p>



<p>Download these drivers from the official website first and then import them to the MDT system under the Out-of-Box Drivers section. You can create separate folders to better manage different types of drivers.</p>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="422" height="286" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-1.png?resize=422%2C286&#038;ssl=1" alt="" class="wp-image-5159" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-1.png?w=422&amp;ssl=1 422w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-1.png?resize=250%2C169&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-1.png?resize=360%2C244&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-1.png?resize=100%2C68&amp;ssl=1 100w" sizes="auto, (max-width: 422px) 100vw, 422px" /></figure>



<p>To update the bootable LiteTouch ISO image, right-click the Deployment Share and choose Update Deployment Share.</p>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="471" height="164" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-2.png?resize=471%2C164&#038;ssl=1" alt="" class="wp-image-5160" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-2.png?w=471&amp;ssl=1 471w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-2.png?resize=450%2C157&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-2.png?resize=250%2C87&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-2.png?resize=360%2C125&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2024/04/image-2.png?resize=100%2C35&amp;ssl=1 100w" sizes="auto, (max-width: 471px) 100vw, 471px" /></figure>



<p>And choose the <strong>Completely regenerate the boot image</strong> option. It may take a while to get all drivers updated in the boot image.</p>



<p>Lastly, make sure you have the <strong>Inject Drivers</strong> step in the Task Sequence when deploying a new computer.</p>The post <a href="https://www.kjctech.net/mdt-inject-out-of-box-drivers-for-new-computer-models/">MDT – Inject Out-of-Box Drivers for New Computer Models</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/mdt-inject-out-of-box-drivers-for-new-computer-models/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5157</post-id>	</item>
		<item>
		<title>Options to Send Emails using Microsoft 365</title>
		<link>https://www.kjctech.net/options-to-send-emails-using-microsoft-365/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=options-to-send-emails-using-microsoft-365</link>
					<comments>https://www.kjctech.net/options-to-send-emails-using-microsoft-365/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Mon, 25 Mar 2024 06:04:45 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[M365]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5151</guid>

					<description><![CDATA[<p>This is how to send emails from an app or device not named Outlook through the Microsoft 365 network. According to Mail Flow Best Practices, there are 3 options available. SMTP Auth If you can deal with Modern Authentication in the form of OAuth, this option provides you with the most reliable email delivery. And you do need a licensed [&#8230;]</p>
The post <a href="https://www.kjctech.net/options-to-send-emails-using-microsoft-365/">Options to Send Emails using Microsoft 365</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>This is how to send emails from an app or device not named Outlook through the Microsoft 365 network. According to <a href="https://learn.microsoft.com/en-us/Exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365">Mail Flow Best Practices</a>, there are 3 options available.</p>



<ul class="wp-block-list">
<li>SMTP Auth</li>



<li>Direct Send</li>



<li>SMTP relay</li>
</ul>



<h3 class="wp-block-heading">SMTP Auth</h3>



<p>If you can deal with Modern Authentication in the form of OAuth, this option provides you with the most reliable email delivery. And you do need a licensed mailbox to send emails from.</p>



<figure class="wp-block-table"><table><tbody><tr><td>Server/smart host</td><td>smtp.office365.com</td></tr><tr><td>Port</td><td>Port 587 (recommended) or port 25</td></tr><tr><td>TLS/StartTLS</td><td>Enabled</td></tr><tr><td>Username/email address and password</td><td>Enter the sign-in credentials of the hosted mailbox being used</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">Direct Send</h3>



<p>Direct Send doesn&#8217;t require SMTP Auth, nor a licensed mailbox. All you need is to specify your own MX endpoint as the mail server or smart host with an unblocked Port 25, you are all set to send emails to recipients in your own organization. Adding an SPF record to avoid having the message flagged as spam is recommended but not required.</p>



<pre class="wp-block-preformatted">v=spf1 ip4: include:spf.protection.outlook.com ~all</pre>



<figure class="wp-block-table"><table><tbody><tr><td>Server/smart host</td><td>Your MX endpoint, for example, contoso-com.mail.protection.outlook.com</td></tr><tr><td>Port</td><td>Port 25</td></tr><tr><td>TLS/StartTLS</td><td>Optional</td></tr><tr><td>Email address</td><td>Any email address for one of your Microsoft 365 or Office 365 accepted domains. This email address doesn&#8217;t need to have a mailbox.</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">SMTP Relay</h3>



<p>If you need to send emails to external recipients, or not every device on your network has Port 25 open or allowed, SMTP Replay could be your answer. The basic setup is the same as the Direct Send but you do need to set up a Mail Flow connector first, whether it&#8217;s certificate-based or IP-based.</p>



<p>Obviously, an IP-based connector is much easier.</p>



<figure class="wp-block-table"><table><thead><tr><th>Connector setting</th><th>Value</th></tr></thead><tbody><tr><td>From</td><td>Your organization&#8217;s email server</td></tr><tr><td>To</td><td>Microsoft 365 or Office 365</td></tr><tr><td>Domain restrictions: IP address/range</td><td>Your on-premises IP address or address range that the device or application will use to connect to Microsoft 365 or Office 365</td></tr></tbody></table></figure>



<figure class="wp-block-table"><table><thead><tr><th>Device or application setting</th><th>Value</th></tr></thead><tbody><tr><td>Server/smart host</td><td>Your MX endpoint, for example,&nbsp;<em>yourdomain</em>&#8211; com.mail.protection.outlook.com</td></tr><tr><td>Port</td><td>Port 25</td></tr><tr><td>TLS/StartTLS</td><td>Enabled</td></tr><tr><td>Email address</td><td>Any email address in one of your Microsoft 365- or Office 365-verified domains. This email address doesn&#8217;t need a mailbox.</td></tr></tbody></table></figure>



<p>And again, SPF is highly recommended to avoid your messages being trapped in the spam folder.</p>The post <a href="https://www.kjctech.net/options-to-send-emails-using-microsoft-365/">Options to Send Emails using Microsoft 365</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/options-to-send-emails-using-microsoft-365/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5151</post-id>	</item>
		<item>
		<title>In-Place Upgrading A Windows Server 2012 Domain Controller to Windows Server 2019 or 2022</title>
		<link>https://www.kjctech.net/in-place-upgrading-a-windows-server-2012-domain-controller-to-windows-server-2019-or-2022/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=in-place-upgrading-a-windows-server-2012-domain-controller-to-windows-server-2019-or-2022</link>
					<comments>https://www.kjctech.net/in-place-upgrading-a-windows-server-2012-domain-controller-to-windows-server-2019-or-2022/#comments</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Sat, 16 Mar 2024 06:47:11 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Azure Active Directory]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5146</guid>

					<description><![CDATA[<p>Generally speaking, in-place upgrading from one server version to another usually goes almost perfectly, given that the upgrade path is supported. You can just mount an ISO image and go with it. But when the server you are upgrading is a domain controller. There are other things to consider before going ahead. Pre-upgrade First, if you have Azure (Entra) AD [&#8230;]</p>
The post <a href="https://www.kjctech.net/in-place-upgrading-a-windows-server-2012-domain-controller-to-windows-server-2019-or-2022/">In-Place Upgrading A Windows Server 2012 Domain Controller to Windows Server 2019 or 2022</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>Generally speaking, in-place upgrading from one server version to another usually goes almost perfectly, given that the upgrade path is supported. You can just mount an ISO image and go with it. But when the server you are upgrading is a domain controller. There are other things to consider before going ahead.</p>



<h3 class="wp-block-heading">Pre-upgrade</h3>



<p>First, if you have Azure (Entra) AD Connect installed on the server, an in-place upgrade will mess things up quite badly. <a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-upgrade-previous-version" target="_blank" rel="noopener" title="">What Microsoft suggests</a> is to use the Swing migration to set the original server in stage mode and temporarily move the Azure (Entra) AD Connect to a different server.</p>



<p>You will also need to prepare the AD schema before the in-place upgrade. Mount the Windows Server 2019 or 2022 Installation ISO media, go to the <strong><em>support\adprep</em></strong> folder and run the following commands.</p>



<pre class="wp-block-preformatted">adprep /forestprep
adprep /domainprep</pre>



<p>Once done, run the following PowerShell cmdlet to confirm the result about the schema version you are about to upgrade to.</p>



<pre class="wp-block-preformatted">Get-ADObject (Get-ADRootDSE).schemaNamingContext -Property objectVersion</pre>



<p>Here is the schema version value table for your reference.</p>



<pre class="wp-block-preformatted">Windows Server 2012 R2 - 69
Windows Server 2016 - 87
Windows Server 2019 - 88
Windows Server 2022 - 88</pre>



<h3 class="wp-block-heading">The actual upgrade</h3>



<p>Now, it is good to go with the in-place upgrade. The actual process will be quite straightforward and should be done fairly quickly.</p>



<h3 class="wp-block-heading">Post-upgrade</h3>



<p>Everything should be up and running right away, including DNS, AD services as well as group policy setups. Two things might require your attention.</p>



<p>The DHCP server might need to be re-authorized to be used again.</p>



<p>Also, if you are using the SMTP services from the legacy IIS 6, you might need to re-configure everything. The settings were wiped out during one of my upgrades. It&#8217;s a good idea to document the setup before doing the upgrade.</p>



<h4 class="wp-block-heading">References:</h4>



<ul class="wp-block-list">
<li><a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-upgrade-previous-version" target="_blank" rel="noopener" title="">Microsoft Entra Connect: Upgrade from a previous version to the latest</a></li>



<li><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/upgrade-domain-controllers" target="_blank" rel="noopener" title="">Upgrade domain controllers to a newer version of Windows Server</a></li>
</ul>The post <a href="https://www.kjctech.net/in-place-upgrading-a-windows-server-2012-domain-controller-to-windows-server-2019-or-2022/">In-Place Upgrading A Windows Server 2012 Domain Controller to Windows Server 2019 or 2022</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/in-place-upgrading-a-windows-server-2012-domain-controller-to-windows-server-2019-or-2022/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5146</post-id>	</item>
		<item>
		<title>Remotely Uninstalling A Program Using PowerShell</title>
		<link>https://www.kjctech.net/remotely-uninstalling-a-program-using-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remotely-uninstalling-a-program-using-powershell</link>
					<comments>https://www.kjctech.net/remotely-uninstalling-a-program-using-powershell/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Fri, 15 Mar 2024 06:00:32 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5144</guid>

					<description><![CDATA[<p>If you don&#8217;t have a software deployment tool, such as PDQ Deployment, uninstalling a program remotely on a computer could be painful. With PowerShell, it could make the process a lot easier. Uninstalling a program via WMI First, let&#8217;s see how to view the installed program. Get-CimInstance -Class Win32_Product -ComputerName $computername To specify which program, you can pipe the result [&#8230;]</p>
The post <a href="https://www.kjctech.net/remotely-uninstalling-a-program-using-powershell/">Remotely Uninstalling A Program Using PowerShell</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>If you don&#8217;t have a software deployment tool, such as PDQ Deployment, uninstalling a program remotely on a computer could be painful. With PowerShell, it could make the process a lot easier.</p>



<h3 class="wp-block-heading">Uninstalling a program via WMI</h3>



<p>First, let&#8217;s see how to view the installed program.</p>



<pre class="wp-block-preformatted">Get-CimInstance -Class Win32_Product -ComputerName $computername</pre>



<p>To specify which program, you can pipe the result to Where-Object with a query like this.</p>



<pre class="wp-block-preformatted">Get-CimInstance -Class Win32_Product -ComputerName $computername | Where-Object {$_.Name -Like 'Adobe Acrobat 2017'}</pre>



<p>You can even use the wildcard in this case to find all Adobe-related programs.</p>



<pre class="wp-block-preformatted">Get-CimInstance -Class Win32_Product -ComputerName $computername | Where-Object {$_.Name -Like 'Adobe*'}</pre>



<p>If the output has only one result, you can simply call up the Uninstall() procedure to uninstall the program.</p>



<pre class="wp-block-preformatted">(Get-CimInstance -Class Win32_Product -ComputerName $computername | Where-Object {$_.Name -Like 'Adobe Acrobat 2017'}).uninstall()</pre>



<p>If the output has multiple results, you can use the <strong>ForEach()</strong> method to loop through each app and uninstall it.</p>



<pre class="wp-block-code"><code lang="powershell" class="language-powershell">$apps = Get-CimInstance -Class Win32_Product -ComputerName $computername | Where-Object {$_.Name -Like 'Adobe*'}
ForEach ($app in $apps) {
  $app.uninstall()
}</code></pre>



<h3 class="wp-block-heading">Uninstalling a program via Uninstall-Package</h3>



<p>Not all installed programs can be uninstalled via WMI. If the above method fails, Uninstall-Package would be a good option next in the line. Also, if it&#8217;s a MSI installed program, you have a better chance of uninstalling it this way.</p>



<p>Use the <strong><em>Get-Package</em></strong> cmdlet to find the program and pipe the result to <strong><em>Uninstall-Package</em></strong> to get it uninstalled. The nice thing about this method is that you can uninstall a bunch of related programs in one line.</p>



<pre class="wp-block-preformatted">Get-Package -Name "Kofax*" | Uninstall-Package</pre>



<p>The drawback is that you would need to use the <strong><em>Invoke-Command</em></strong> cmdlet to execute it on a remote computer.</p>



<pre class="wp-block-preformatted">Invoke-Command -ComputerName $computername -Scriptblock {Get-Package -Name 'Kofax*' | Uninstall-Package</pre>



<p></p>The post <a href="https://www.kjctech.net/remotely-uninstalling-a-program-using-powershell/">Remotely Uninstalling A Program Using PowerShell</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/remotely-uninstalling-a-program-using-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5144</post-id>	</item>
	</channel>
</rss>
