<?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>Server Administration Archives - the Sysadmin Channel</title>
	<atom:link href="https://thesysadminchannel.com/server-administration/feed/" rel="self" type="application/rss+xml" />
	<link>https://thesysadminchannel.com/server-administration/</link>
	<description>Documenting My Life as a System Administrator</description>
	<lastBuildDate>Thu, 18 Aug 2022 23:15:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">144174110</site>	<item>
		<title>How To Delete User Profiles In Windows 10</title>
		<link>https://thesysadminchannel.com/how-to-delete-user-profiles-in-windows-10/</link>
					<comments>https://thesysadminchannel.com/how-to-delete-user-profiles-in-windows-10/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Thu, 18 Aug 2022 23:15:30 +0000</pubDate>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Delete User Profiles In Windows 10]]></category>
		<category><![CDATA[remove user profile windows 10]]></category>
		<category><![CDATA[windows 10 remove user profile]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=4256</guid>

					<description><![CDATA[<p>If you&#8217;re looking to do some general house cleaning, a great first step is knowing how to delete user profiles in Windows 10. Removing user profiles in Windows is a great general practice and it helps keep the space to&#8230; <a href="https://thesysadminchannel.com/how-to-delete-user-profiles-in-windows-10/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/how-to-delete-user-profiles-in-windows-10/">How To Delete User Profiles In Windows 10</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;re looking to do some general house cleaning, a great first step is knowing how to <strong>delete user profiles in Windows 10</strong>. Removing user profiles in Windows is a great general practice and it helps keep the space to a minimum on the local disk.  It&#8217;s also great for security too! Today we&#8217;re going to cover SEVERAL steps on how to complete this action on a single machine or many machines in bulk.<br />
&nbsp;</p>
<div id="tableofcontents">
<h2>Table Of Contents</h2>
<ul>
<li><a href="#deleteprofiles">Delete User Profiles In Windows 10</a></li>
<ul>
<li><a href="#manualmethod">Method 1 &#8211; Delete User Profiles Manually</a></li>
<li><a href="#delprof2">Method 2 &#8211; Remove User Profiles using DelProf2</a></li>
<li><a href="#grouppolicy">Method 3 &#8211; Removal using Group Policy</a></li>
</ul>
<li><a href="#conclusion">Conclusion</a></li>
</ul>
</div>
<div id="deleteprofiles" style="scroll-margin-top: 15px;"></div>
<h2>Delete User Profiles In Windows 10</h2>
<p>First off, there are several methods to accomplish this task and we&#8217;ll cover the most common ways of doing this. To give you an overview, we&#8217;ll review the manual method, the scripted method using delprof2 and the bulk method using Group Policy.  Each method has its own pros and cons and you&#8217;ll be able to choose which one works best for you.<br />
&nbsp;</p>
<div id="manualmethod" style="scroll-margin-top: 15px;"></div>
<h2>Method 1 &#8211; Delete User Profiles Manually</h2>
<p>If you want to delete a user profile in Windows and don&#8217;t want to download any additional tools, this will perhaps be the best option for you. We already know that this won&#8217;t scale and should only be used for adhoc situations.<br />
&nbsp;</p>
<p>On your Windows machine:</p>
<ul>
<li>Navigate to <strong>start</strong> -> <strong>run</strong> -> type <strong>sysdm.cpl</strong> to access the <strong>advanced system properties</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2022/07/Advanced-system-settings.png" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2022/07/Advanced-system-settings.png" alt="Advanced system settings" width="825" height="468" class="aligncenter size-full wp-image-4344" srcset="https://thesysadminchannel.com/wp-content/uploads/2022/07/Advanced-system-settings.png?v=1659241473 825w, https://thesysadminchannel.com/wp-content/uploads/2022/07/Advanced-system-settings-768x436.png?v=1659241473 768w" sizes="(max-width: 825px) 100vw, 825px" /></a><br />
&nbsp;</p>
<ul>
<li>Select the user profile you want to delete</li>
<li>Click delete</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2022/07/Remove-User-Profile.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2022/07/Remove-User-Profile.png" alt="Remove User Profile" width="825" height="473" class="aligncenter size-full wp-image-4345" srcset="https://thesysadminchannel.com/wp-content/uploads/2022/07/Remove-User-Profile.png?v=1659241504 825w, https://thesysadminchannel.com/wp-content/uploads/2022/07/Remove-User-Profile-768x440.png?v=1659241504 768w" sizes="(max-width: 825px) 100vw, 825px" /></a><br />
&nbsp;</p>
<p>There are occasions when you might have to manually delete the folder under C:\Users as well so that&#8217;s something that you should be aware of.</p>
<div id="delprof2" style="scroll-margin-top: 15px;"></div>
<h2>Method 2 &#8211; Remove User Profiles using DelProf2</h2>
<p>If you&#8217;re looking for more of a scripted approach, delfprof2 definitely takes the cake on that one.  DelfProf2 is the evolution to Microsoft&#8217;s original DelfProf (Delete Profile) but that was sadly no longer being updated after Windows XP.  Since DelProf2 doesn&#8217;t come standard on Windows machines, it is something you will have to download from the <a href="https://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool/" rel="noopener nofollow" target="_blank">owners website</a>.  It&#8217;s completely free but just note that it&#8217;s not an official Microsoft product.<br />
&nbsp;<br />
Direct Download Link: <a href="https://helgeklein.com/downloads/DelProf2/current/Delprof2 1.6.0.zip" rel="noopener nofollow" target="_blank">https://helgeklein.com/downloads/DelProf2/current/Delprof2 1.6.0.zip</a><br />
&nbsp;</p>
<p>This allows you to use the command line interface to touch multiple machines without much effort.  This mighty program also supports the removal of user profiles after x amount of days so that&#8217;s great if you don&#8217;t want to leave those stale profiles on the machines. Let&#8217;s cover a common example to help you get started (assuming you&#8217;ve already downloaded the app from the link above).<br />
&nbsp;</p>
<h4>List accounts that haven&#8217;t logged in for 14 days</h4>
<pre class="brush: powershell; title: ; notranslate">
PS C:\delprof&gt; .\DelProf2.exe /l /d:14
</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-14-days-inactive.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-14-days-inactive.png" alt="Delprof2 14 days inactive" width="850" height="417" class="aligncenter size-full wp-image-4356" srcset="https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-14-days-inactive.png?v=1660676379 850w, https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-14-days-inactive-768x377.png?v=1660676379 768w" sizes="(max-width: 850px) 100vw, 850px" /></a><br />
&nbsp;</p>
<h4>List accounts that match the name &#8216;Luke&#8217;</h4>
<pre class="brush: powershell; title: ; notranslate">
PS C:\delprof&gt; .\DelProf2.exe /id:luke /l
</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-include-users.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-include-users.png" alt="Delprof2 include users" width="850" height="434" class="aligncenter size-full wp-image-4358" srcset="https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-include-users.png?v=1660677479 850w, https://thesysadminchannel.com/wp-content/uploads/2022/08/Delprof2-include-users-768x392.png?v=1660677479 768w" sizes="(max-width: 850px) 100vw, 850px" /></a><br />
&nbsp;</p>
<p>For a full list of options you can always run <code>/?</code> to see what switches are currently suppported.<br />
&nbsp;</p>
<div id="grouppolicy" style="scroll-margin-top: 15px;"></div>
<h2>Method 3 &#8211; Removal using Group Policy</h2>
<p>Our last option allows us to remove user profiles using Group Policy.  This options is by far the one that scales the best since Group Policy is used in many on-premises infrastructures.  Let&#8217;s look at the settings to enable this policy via GPO.<br />
&nbsp;</p>
<p>With Group Policy Editor open:</p>
<ul>
<li>Navigate to <strong>Computer Configuration</strong> → <strong>Administrative Templates</strong> → <strong>System</strong> → <strong>User Profiles</strong></li>
<li>Select <strong>Delete user profiles older than a specified number of days on system restart</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo.png" alt="Remove user profile group policy gpo" width="969" height="549" class="aligncenter size-full wp-image-4360" srcset="https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo.png?v=1660778142 969w, https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo-768x435.png?v=1660778142 768w" sizes="(max-width: 969px) 100vw, 969px" /></a><br />
&nbsp;</p>
<ul>
<li>Click Enabled and set the number of days to trigger the policy</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo-setting.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo-setting.png" alt="Remove user profile group policy gpo setting" width="883" height="636" class="aligncenter size-full wp-image-4361" srcset="https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo-setting.png?v=1660778209 883w, https://thesysadminchannel.com/wp-content/uploads/2022/08/Remove-user-profile-group-policy-gpo-setting-768x553.png?v=1660778209 768w" sizes="(max-width: 883px) 100vw, 883px" /></a><br />
&nbsp;</p>
<p>While this option is great and scalable,  some users have noticed that the username folder under C:\Users is still there.  If that&#8217;s the case, you <em><strong>may</strong></em> need clean that manually if it poses an issue.</p>
<div id="blockquote1">
<strong>Important Note</strong>: Before applying anything to a large number of users, you should ALWAYS test on a on sample size to ensure you get the expected outcome you&#8217;re looking for.
</div>
<div id="conclusion" style="scroll-margin-top: 15px;"></div>
<h2>Conclusion</h2>
<p>Hopefully, this article was able to show you how to delete user profiles in Windows 10.  I provided 3 options that are pretty scalable as well a quick adhoc method.<br />
&nbsp;</p>
<p>Again, just to reiterate, you should always test before applying any configs just to ensure that everything is working as expected.  If you like this article, be sure to check out our own <a href="https://thesysadminchannel.com/powershell/" rel="noopener" target="_blank">PowerShell Gallery</a> for awesome scripts.</p>
<p>The post <a href="https://thesysadminchannel.com/how-to-delete-user-profiles-in-windows-10/">How To Delete User Profiles In Windows 10</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/how-to-delete-user-profiles-in-windows-10/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4256</post-id>	</item>
		<item>
		<title>How to Extract Windows 10 Enterprise WIM From ISO</title>
		<link>https://thesysadminchannel.com/how-to-extract-windows-10-enterprise-wim-from-iso/</link>
					<comments>https://thesysadminchannel.com/how-to-extract-windows-10-enterprise-wim-from-iso/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Sat, 03 Jul 2021 08:04:52 +0000</pubDate>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Extract Windows 10 Enterprise WIM]]></category>
		<category><![CDATA[Windows 10 Install.wim]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=3207</guid>

					<description><![CDATA[<p>If you&#8217;ve ever tried to setup an unattended install for Windows 10, you might have noticed during the install that you&#8217;re given options of which version you would like to choose. Today we&#8217;re going to the solve that issue and&#8230; <a href="https://thesysadminchannel.com/how-to-extract-windows-10-enterprise-wim-from-iso/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/how-to-extract-windows-10-enterprise-wim-from-iso/">How to Extract Windows 10 Enterprise WIM From ISO</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to setup an unattended install for Windows 10, you might have noticed during the install that you&#8217;re given options of which version you would like to choose.  Today we&#8217;re going to the solve that issue and show you how to <strong>extract Windows 10 Enterprise WIM from ISO</strong>.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-Version-WIM-Install.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-Version-WIM-Install.png" alt="Windows 10 Version WIM Install" width="1026" height="766" class="aligncenter size-full wp-image-3208" srcset="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-Version-WIM-Install.png?v=1625288699 1026w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-Version-WIM-Install-1024x765.png?v=1625288699 1024w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-Version-WIM-Install-768x573.png?v=1625288699 768w" sizes="(max-width: 1026px) 100vw, 1026px" /></a></p>
<p>Some use cases for this would be to use an unattended install for Windows 10, you can also use this for SCCM or even MDT if you like.  It can lower the footprint of your setup by removing unnecessary files that you know you won&#8217;t use.  In my case I know I would use Windows 10 Enterprise 100% of the time because it&#8217;s the more appropriate version of my work environment.</p>
<h2>Extract Windows 10 Enterprise WIM From ISO</h2>
<p>Once you&#8217;ve downloaded your WIM file, let&#8217;s go ahead and mount it to your system so we can see exactly what we&#8217;re working with. In my case, I&#8217;m going to mount &#8216;Windows 10 20H2.iso&#8217; to my D drive and open Powershell as an administrator.</p>
<p>By default, any newer Windows 10 machine will have the DISM module loaded with the machine so make sure you&#8217;re using that to extract this.  Next we&#8217;ll run the command <strong>Get-WindowsImage -ImagePath D:\sources\install.wim</strong> to spit all the WIM files that are associated with it.  Once that happens, let&#8217;s take notice of the index that Windows 10 Enterprise is associated with.  In our example, it is sitting at Index #3.</p>
<p>&nbsp;</p>
<div id="attachment_3213" style="width: 1034px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-indexes.png" target="_blank" rel="noopener"><img decoding="async" aria-describedby="caption-attachment-3213" src="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-indexes-short.png" alt="Windows 10 wim indexes-short" width="1024" height="551" class="size-full wp-image-3213" srcset="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-indexes-short.png?v=1625290551 1024w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-indexes-short-768x413.png?v=1625290551 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><p id="caption-attachment-3213" class="wp-caption-text">Click to view full image</p></div>
<p>PS C:\> Get-WindowsImage -ImagePath D:\sources\install.wim</p>
<p>ImageIndex       : 1<br />
ImageName        : Windows 10 Education<br />
ImageDescription : Windows 10 Education<br />
ImageSize        : 15,734,867,941 bytes</p>
<p>ImageIndex       : 2<br />
ImageName        : Windows 10 Education N<br />
ImageDescription : Windows 10 Education N<br />
ImageSize        : 14,963,222,046 bytes</p>
<p>ImageIndex       : 3<br />
ImageName        : Windows 10 Enterprise<br />
ImageDescription : Windows 10 Enterprise<br />
ImageSize        : 15,735,021,936 bytes</p>
<p>&nbsp;</p>
<p>Next up we&#8217;ll run <strong>Export-WindowsImage -SourceImagePath D:\sources\install.wim -DestinationImagePath $HOME\Desktop\Windows10Enterprise20H2.wim -SourceIndex 3</strong><br />
This is telling Powershell to extract Index 3 from the info above as well as set the destination to my desktop.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2021/07/Export-WindowsImage-SourceImagePath-install.wim_.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2021/07/Export-WindowsImage-SourceImagePath-install.wim_.png" alt="Export-WindowsImage -SourceImagePath install.wim" width="1099" height="632" class="aligncenter size-full wp-image-3222" srcset="https://thesysadminchannel.com/wp-content/uploads/2021/07/Export-WindowsImage-SourceImagePath-install.wim_.png?v=1625293579 1099w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Export-WindowsImage-SourceImagePath-install.wim_-1024x589.png?v=1625293579 1024w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Export-WindowsImage-SourceImagePath-install.wim_-768x442.png?v=1625293579 768w" sizes="(max-width: 1099px) 100vw, 1099px" /></a></p>
<p>Finally, you&#8217;ll need to replace install.wim  that&#8217;s currently in the sources folder with the new wim you just created.  You must rename it to install.wim because that&#8217;s what unattended installs are looking for by default so it must be set to that filename in order for it to work correctly.</p>
<p>Next thing to do is to confirm that we&#8217;ve extracted the Windows 10 Enterprise WIM properly from the general ISO that was available to us.  To do that we&#8217;ll run the same command that we did earlier, however, this time the difference would be that we only see Windows 10 Enterprise as our only option.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-Enterprise-index.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-Enterprise-index.png" alt="Windows 10 wim Enterprise index" width="1099" height="632" class="aligncenter size-full wp-image-3226" srcset="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-Enterprise-index.png?v=1625295024 1099w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-Enterprise-index-1024x589.png?v=1625295024 1024w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-10-wim-Enterprise-index-768x442.png?v=1625295024 768w" sizes="(max-width: 1099px) 100vw, 1099px" /></a></p>
<p>Now when you run the unattended install, you won&#8217;t be prompted for a Windows 10 version 🙂</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-Setup.png" target="_blank" rel="noopener"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-Setup.png" alt="Windows Setup" width="897" height="642" class="aligncenter size-full wp-image-3228" srcset="https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-Setup.png?v=1625295142 897w, https://thesysadminchannel.com/wp-content/uploads/2021/07/Windows-Setup-768x550.png?v=1625295142 768w" sizes="(max-width: 897px) 100vw, 897px" /></a></p>
<h2>Conclusion</h2>
<p>Hopefully this article was able to help figure out how to extract Windows 10 Enterprise WIM from your ISO file.  If you liked this article be sure to check out the others in our <a href="https://thesysadminchannel.com/server-administration/" rel="noopener" target="_blank">Server Administration</a>. </p>
<p>The post <a href="https://thesysadminchannel.com/how-to-extract-windows-10-enterprise-wim-from-iso/">How to Extract Windows 10 Enterprise WIM From ISO</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/how-to-extract-windows-10-enterprise-wim-from-iso/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3207</post-id>	</item>
		<item>
		<title>Automate Powershell Scripts With Task Scheduler</title>
		<link>https://thesysadminchannel.com/automate-powershell-scripts-with-task-scheduler/</link>
					<comments>https://thesysadminchannel.com/automate-powershell-scripts-with-task-scheduler/#respond</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Mon, 14 Sep 2020 06:08:44 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Automate Powershell Scripts With Task Scheduler]]></category>
		<category><![CDATA[how to run powershell script using task scheduler]]></category>
		<category><![CDATA[how to use task scheduler]]></category>
		<category><![CDATA[run powershell script from task scheduler]]></category>
		<category><![CDATA[run powershell script using task scheduler]]></category>
		<category><![CDATA[run Powershell scripts as a scheduled task]]></category>
		<category><![CDATA[use task scheduler to run powershell script]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2458</guid>

					<description><![CDATA[<p>Through out my sysadmin journey I&#8217;ve always been an advocate of implementing as much automation as possible. Whether I automate Powershell Scripts with Task Scheduler or create a function to run interactively in the shell. I believe to the core&#8230; <a href="https://thesysadminchannel.com/automate-powershell-scripts-with-task-scheduler/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/automate-powershell-scripts-with-task-scheduler/">Automate Powershell Scripts With Task Scheduler</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Through out my sysadmin journey I&#8217;ve always been an advocate of implementing as much automation as possible.  Whether I <strong>automate Powershell Scripts with Task Scheduler</strong> or create a function to run interactively in the shell.  I believe to the core that I should always strive to automate myself out of a job.</p>
<p>Today we&#8217;re going to focus on <strong>what is Windows Task Scheduler</strong>, but more importantly <strong>how to run Powershell scripts from Task Scheduler</strong> to automate your tasks.  There are a couple of caveats I&#8217;ve learned over the years but we&#8217;ll get into that later in the article.</p>
<h2>What is Task Scheduler?</h2>
<p>I suppose before we get into the details of how to run Powershell scripts as a scheduled task, it would be a good idea to explain exactly what Task Scheduler is.<br />
&nbsp;</p>
<p>So what is Task Scheduler? <a href="https://en.wikipedia.org/wiki/Windows_Task_Scheduler" rel="noopener noreferrer" target="_blank">Wikipedia explains</a> Task Scheduler as a component of Microsoft Windows that provides the ability to schedule the launch of programs or scripts at pre-defined times or after specified time intervals. </p>
<p>In other words, it&#8217;s a way to schedule jobs or certain tasks at specific time intervals throughout the day, week, month or as a one time basis.</p>
<div id="attachment_2610" style="width: 791px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/What-is-Task-Scheduler.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2610" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/What-is-Task-Scheduler.png" alt="What is Task Scheduler" width="781" height="468" class="size-full wp-image-2610" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/What-is-Task-Scheduler.png?v=1608958454 781w, https://thesysadminchannel.com/wp-content/uploads/2020/12/What-is-Task-Scheduler-125x75.png?v=1608958454 125w, https://thesysadminchannel.com/wp-content/uploads/2020/12/What-is-Task-Scheduler-768x460.png?v=1608958454 768w" sizes="(max-width: 781px) 100vw, 781px" /></a><p id="caption-attachment-2610" class="wp-caption-text">Task Scheduler is available on Windows Server and Windows Client machines. i.e Windows Server 2016/2019 and Windows 10</p></div>
<h2>How To Automate Powershell Scripts with Task Scheduler</h2>
<p>Now that you know what is it, let&#8217;s move on to how you can use it to your advantage. The first step is knowing what we&#8217;ll want to automate (or schedule). In my example I&#8217;m going to automatically email my users once their password is within 10 days of expiration. Luckily, we already have a <a href="https://thesysadminchannel.com/get-password-expiration-date-using-powershell-active-directory/" rel="noopener noreferrer" target="_blank">Get Password Expiration Date</a> Powershell script so now it&#8217;s just a matter setting up a task.  </p>
<p>&nbsp;<br />
Let&#8217;s get to that now.</p>
<ul>
<li>First, we&#8217;ll need to <strong>open Task Scheduler</strong> from the start menu</li>
<li>Choose the path you want to setup the task. I normally choose the root</li>
<li>Right click <strong>Task Scheduler Library</strong> and select <strong>Create Task</strong> (not basic task)</li>
<li>Under the <strong>General tab</strong>, insert the <strong>Name</strong> and <strong>Description</strong></li>
<li>Set the user account (preferably a <strong>service account</strong> with a password that doesn&#8217;t expire)</li>
<li>Check the option to <strong>run whether the user is logged in or not</strong></li>
<li>Configure the dropdown to use the <strong>latest version</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-General-Tab.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-General-Tab.png" alt="Scheduled Task General Tab - Automate Powershell Scripts" width="629" height="478" class="aligncenter size-full wp-image-2615" /></a><br />
&nbsp;</p>
<ul>
<li>Under the <strong>trigger tab</strong>, select <strong>on a schedule</strong> for time based tasks</li>
<li>Select the time frequency. One time, daily, weekly or monthly</li>
<li>Since we want the task to <strong>run daily</strong>, I&#8217;ll set it <strong>recur every 1 days</strong></li>
<li>Under the <strong>advance settings</strong>, if you want to <strong>run the task every x hours</strong>, enter that in there (i.e. 12 hours for the duration of 1 day will run every 12 hours until you disable it)</li>
<li>Ensure the check for <strong>Enabled is checked</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Trigger-Tab.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Trigger-Tab.png" alt="Scheduled Task Trigger Tab - Automate Powershell Scripts" width="589" height="511" class="aligncenter size-full wp-image-2618" /></a><br />
&nbsp;</p>
<ul>
<li>Under the <strong>Actions tab</strong>, select <strong>start a program</strong> in the drop down menu</li>
<li>Under program/script select the <strong>powershell.exe</strong>. (i.e. c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)</li>
<li>Under <strong>Add arguments</strong>, select the location of the <strong>Powershell script</strong> (i.e. c:\_Scripts\Get-PasswordExpirationDate.ps1)</li>
</ul>
<p>&nbsp;</p>
<div id="blockquote1">
<strong>!Important</strong>: If you&#8217;re running a function, you&#8217;ll need to load it into memory if its not in an accessible module.  To do this, you&#8217;ll need to set the arguments to:<br />
<strong>&#8220;. C:\_Scripts\Get-PasswordExpirationDate.ps1; Get-PasswordExpirationDate -DaysWithinExpiration 10 -SendEmail&#8221;</strong>  &#8211;<em>Including quotes</em>
</div>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Action-Tab.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Action-Tab.png" alt="Scheduled Task Action Tab - Automate Powershell Scripts" width="1011" height="493" class="aligncenter size-full wp-image-2627" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Action-Tab.png?v=1608969149 1011w, https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Action-Tab-768x375.png?v=1608969149 768w" sizes="(max-width: 1011px) 100vw, 1011px" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Under <strong>Conditions tab</strong>, leave default unless you want to change anything specifically</li>
<li>Under <strong>Settings tab</strong>, check <strong>Allow task to be run on demand</strong></li>
<li>Click OK and enter password for the account running the task</li>
</ul>
<h3>Granting Logon as batch job rights</h3>
<p>If the account you&#8217;re using to run the scheduled task is not an administrator, you might be prompted with the following message. &#8220;This task requires that the user account specified has Log on as batch job rights&#8230;<br />
<a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Task-Scheduler-log-on-as-batch-rights.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Task-Scheduler-log-on-as-batch-rights.png" alt="Task Scheduler log on as batch rights" width="951" height="354" class="aligncenter size-full wp-image-2629" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/Task-Scheduler-log-on-as-batch-rights.png?v=1608969752 951w, https://thesysadminchannel.com/wp-content/uploads/2020/12/Task-Scheduler-log-on-as-batch-rights-768x286.png?v=1608969752 768w" sizes="(max-width: 951px) 100vw, 951px" /></a></p>
<p>&nbsp;<br />
To fix that we&#8217;ll do the following:</p>
<ul>
<li>Go to <strong>start</strong> -> Type <strong>gpedit.msc</strong></li>
<li>Navigate to <strong>Computer Configuration</strong> -> <strong>Windows Settings</strong> -> <strong>Security Settings</strong> -> <strong>Local Policies</strong> -> <strong>User Rights Assignment</strong></li>
<li>Open <strong>Log on as a batch job</strong> and add the user account</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Log-on-as-a-batch-job.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Log-on-as-a-batch-job.png" alt="Scheduled Task Log on as a batch job" width="1018" height="585" class="aligncenter size-full wp-image-2632" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Log-on-as-a-batch-job.png?v=1608970556 1018w, https://thesysadminchannel.com/wp-content/uploads/2020/12/Scheduled-Task-Log-on-as-a-batch-job-768x441.png?v=1608970556 768w" sizes="(max-width: 1018px) 100vw, 1018px" /></a></p>
<h2>When should you use Task Scheduler?</h2>
<p>Honestly there are a ton of use cases for using Task Scheduler and the possibilities are pretty much unlimited.  I would define it as anything that you can script and you want to run more than once in a specific time interval.  Off the top of my head, a perfect example would be <a href="https://thesysadminchannel.com/get-password-expiration-date-using-powershell-active-directory/" rel="noopener noreferrer" target="_blank">get password expiration dates using Powershell</a> and automatically notify the user.  Another good use case is automatically reboot a server after <a href="https://www.youtube.com/watch?v=a2AWwhUaQuw" rel="noopener noreferrer" target="_blank">deploying windows updates using SCCM</a>.</p>
<p>It really just depends on what you want to do.  There was a point in time where I had about 50+ jobs scheduled through out the week. Anything from Exchange Online to Active Directory tasks, if I was able to script it (and I usually can) I would setup a job to automate it.</p>
<h2>Automate Powershell Scripts &#8211; Conclusion</h2>
<p>At this point I really hope I was able to explain, in detail, how to automate your Powershell scripts with task scheduler so you can hopefully set it and forget it.  If you&#8217;re not using task scheduler, let me know in the comments what you are using to run your jobs.  Again, I strive to automate myself out of a job so it&#8217;s very helpful that I&#8217;m to run jobs essentially while I am sleeping.  This frees up time for me to try and automate more items or look for ways to enhance the environment on other technologies.</p>
<p>&nbsp;</p>
<p>If you liked this article, be sure to check out our other <a href="https://thesysadminchannel.com/server-administration/" rel="noopener noreferrer" target="_blank">Server Administration posts</a>.  I recently uploaded a <a href="https://thesysadminchannel.com/get-reboot-history-using-powershell/" rel="noopener noreferrer" target="_blank">Get Reboot History Powershell Script</a> that could be useful. While you&#8217;re at it, don&#8217;t forget to stop by our <a href="https://www.youtube.com/c/theSysadminChannel" rel="noopener noreferrer" target="_blank">YouTube Channel</a> for awesome video content.</p>
<p>The post <a href="https://thesysadminchannel.com/automate-powershell-scripts-with-task-scheduler/">Automate Powershell Scripts With Task Scheduler</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/automate-powershell-scripts-with-task-scheduler/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2458</post-id>	</item>
		<item>
		<title>Get Reboot History Using Powershell</title>
		<link>https://thesysadminchannel.com/get-reboot-history-using-powershell/</link>
					<comments>https://thesysadminchannel.com/get-reboot-history-using-powershell/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Wed, 02 Sep 2020 05:51:09 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[EventID 1074]]></category>
		<category><![CDATA[find who rebooted a server powershell]]></category>
		<category><![CDATA[Get Reboot History Using Powershell]]></category>
		<category><![CDATA[powershell get shutdown events]]></category>
		<category><![CDATA[powershell script to get reboot history for multiple servers]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2571</guid>

					<description><![CDATA[<p>A while back I posted a script on how to Get System Uptime and Last Reboot Status Using Powershell so I thought a great edition to that script would be to Get Reboot History using Powershell. The uptime script showed&#8230; <a href="https://thesysadminchannel.com/get-reboot-history-using-powershell/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/get-reboot-history-using-powershell/">Get Reboot History Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A while back I posted a script on how to <a href="https://thesysadminchannel.com/get-uptime-last-reboot-status-multiple-computers-powershell/" rel="noopener noreferrer" target="_blank">Get System Uptime and Last Reboot Status Using Powershell</a> so I thought a great edition to that script would be to <strong>Get Reboot History using Powershell</strong>.</p>
<p>The uptime script showed you when was the last time a machine was booted, aka how long the system has been running, but what if you wanted to pull a little more information?  What if you wanted to see the shutdown or reboot history, and probably more importantly, who was the actor that imposed that event.  </p>
<p>A minor incident happened the other day where person A was running a job while logged into a server, and it just so happens that person B needed to complete a series of patches on that same server.  Obviously the communication could have been handled much better but long story short, person B applied the patches and manually reboot the server, cutting off person A&#8217;s job mid tracks.</p>
<p>If you&#8217;re looking to use to a Powershell script to get reboot history for multiple servers, I&#8217;m sure your scenario may be different from the one above.  Whatever the reason is, I got you covered in this post.</p>
<h2>Event Viewer Logs and Event ID 1074</h2>
<p>Shortly after, I used my Google-fu and eventually came across some articles that would point me in the right direction.  I was sure there would be some logs in the event viewer and sure enough, I found <strong>Event ID 1074</strong> under the System Logs.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/EventLog-EventID-1074-Reboot.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/EventLog-EventID-1074-Reboot.png" alt="EventLog EventID 1074 Reboot" width="1889" height="934" class="aligncenter size-full wp-image-2573" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/EventLog-EventID-1074-Reboot.png?v=1607838714 1889w, https://thesysadminchannel.com/wp-content/uploads/2020/12/EventLog-EventID-1074-Reboot-1024x506.png?v=1607838714 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/12/EventLog-EventID-1074-Reboot-768x380.png?v=1607838714 768w" sizes="(max-width: 1889px) 100vw, 1889px" /></a></p>
<p>I have worked with scripting Event Viewer logs in the past, such as this <a href="https://thesysadminchannel.com/get-account-lock-out-source-powershell/" rel="noopener noreferrer" target="_blank">Get Account Lock Out Source Using Powershell</a>, so I was already familiar with how the process goes.  And if you&#8217;re ok with checking the event viewer manually from the time to time it may not be worth looking up how to do it in Powershell.  However for me, I love automating things and using Powershell everywhere I can, not to mention this would be great for the community to use as well.</p>
<p>Now let&#8217;s get on to the script!</p>
<h2>Get Reboot History Using Powershell Script</h2>
<pre class="brush: powershell; title: ; notranslate">

Function Get-RebootHistory {
&lt;#
.SYNOPSIS
    This will output who initiated a reboot or shutdown event.

.NOTES
    Name: Get-RebootHistory
    Author: theSysadminChannel
    Version: 1.0
    DateCreated: 2020-Aug-5

.LINK
    https://thesysadminchannel.com/get-reboot-history-using-powershell -

.EXAMPLE
    Get-RebootHistory -ComputerName Server01, Server02

.EXAMPLE
    Get-RebootHistory -DaysFromToday 30 -MaxEvents 1

.PARAMETER ComputerName
    Specify a computer name you would like to check.  The default is the local computer

.PARAMETER DaysFromToday
    Specify the amount of days in the past you would like to search for

.PARAMETER MaxEvents
    Specify the number of events you would like to search for (from newest to oldest)
#&gt;


    [CmdletBinding()]
    param(
        [Parameter(
            Mandatory = $false,
            ValueFromPipeline = $true,
            ValueFromPipelineByPropertyName = $true
        )]
        [string[]]  $ComputerName = $env:COMPUTERNAME,

        [int]       $DaysFromToday = 7,

        [int]       $MaxEvents = 9999
    )

    BEGIN {}

    PROCESS {
        foreach ($Computer in $ComputerName) {
            try {
                $Computer = $Computer.ToUpper()
                $EventList = Get-WinEvent -ComputerName $Computer -FilterHashtable @{
                    Logname = 'system'
                    Id = '1074', '6008'
                    StartTime = (Get-Date).AddDays(-$DaysFromToday)
                } -MaxEvents $MaxEvents -ErrorAction Stop


                foreach ($Event in $EventList) {
                    if ($Event.Id -eq 1074) {
                        [PSCustomObject]@{
                            TimeStamp    = $Event.TimeCreated
                            ComputerName = $Computer
                            UserName     = $Event.Properties.value[6]
                            ShutdownType = $Event.Properties.value[4]
                        }
                    }

                    if ($Event.Id -eq 6008) {
                        [PSCustomObject]@{
                            TimeStamp    = $Event.TimeCreated
                            ComputerName = $Computer
                            UserName     = $null
                            ShutdownType = 'unexpected shutdown'
                        }
                    }

                }

            } catch {
                Write-Error $_.Exception.Message

            }
        }
    }

    END {}
}


</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Get-Reboot-History-Using-Powershell-Examples.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Get-Reboot-History-Using-Powershell-Examples.png" alt="Get Reboot History Using Powershell Examples" width="2238" height="1144" class="aligncenter size-full wp-image-2575" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/Get-Reboot-History-Using-Powershell-Examples.png?v=1607839790 2238w, https://thesysadminchannel.com/wp-content/uploads/2020/12/Get-Reboot-History-Using-Powershell-Examples-1024x523.png?v=1607839790 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/12/Get-Reboot-History-Using-Powershell-Examples-768x393.png?v=1607839790 768w" sizes="(max-width: 2238px) 100vw, 2238px" /></a></p>
<p>&nbsp;</p>
<p>So now that you have the script in hand, just copy and paste to a local file so you can start sending nice notes to people for rebooting machines.</p>
<p>Anyway I hope you enjoyed this script and can put it to use.  If you liked it and want to see more, be sure to check out our own <a href="https://thesysadminchannel.com/powershell/" rel="noopener noreferrer" target="_blank">Powershell repository</a> full of useful, real world scripts that I&#8217;m certain you can use in your environment.  While you&#8217;re at it, don&#8217;t forget to check out our <a href="https://www.youtube.com/c/theSysadminChannel" rel="noopener noreferrer" target="_blank">Youtube Page</a> for awesome sysadmin video content.</p>
<p>The post <a href="https://thesysadminchannel.com/get-reboot-history-using-powershell/">Get Reboot History Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/get-reboot-history-using-powershell/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2571</post-id>	</item>
		<item>
		<title>How To Setup SSL Certificates on XAMPP</title>
		<link>https://thesysadminchannel.com/setup-ssl-certificates-on-xampp/</link>
					<comments>https://thesysadminchannel.com/setup-ssl-certificates-on-xampp/#respond</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Mon, 24 Aug 2020 06:49:50 +0000</pubDate>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[httpd -vhosts.conf]]></category>
		<category><![CDATA[Setup SSL Certificates on XAMPP]]></category>
		<category><![CDATA[SSL on xampp]]></category>
		<category><![CDATA[xamp virtual host]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2485</guid>

					<description><![CDATA[<p>In the recent days I&#8217;ve been dabbing more and more into the php and web application world. The reason was that I wanted to create a web application that the helpdesk or Jr Sysamins can use without necessarily giving them&#8230; <a href="https://thesysadminchannel.com/setup-ssl-certificates-on-xampp/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/setup-ssl-certificates-on-xampp/">How To Setup SSL Certificates on XAMPP</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the recent days I&#8217;ve been dabbing more and more into the php and web application world.  The reason was that I wanted to create a web application that the helpdesk or Jr Sysamins can use without necessarily giving them full blown permissions to the infrastructure.  Some examples of this would be automating the new hire onboarding process, deploying a server in VMware or even generating a LAPS password.   The benefits (or topic) of this is not really in scope of the article but I did want to document the process to use and <strong>setup SSL Certificates on XAMPP</strong>.</p>
<p>I wanted to setup a quick and dirty site on my localhost and found that xampp was the perfect solution for my Windows 10 machine.  However, when it came to test the security I realized that it had not been secured with a proper certificate so I was unable to use HTTPS.  The code that I was testing required https so I was off to my Google-venture.</p>
<h2>Setup SSL Certificates on XAMPP</h2>
<p>As we can see here I&#8217;ve setup my local xampp server and after piecing together a couple of articles, I finally got it working.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-Setup-for-Xampp.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-Setup-for-Xampp.png" alt="SSL Certificate Setup for Xampp" width="594" height="276" class="aligncenter size-full wp-image-2560" /></a><br />
&nbsp;</p>
<p>I should mention that the certificate I am using is not a self signed cert, but rather an actual Public SSL certificate from Let&#8217;s Encrypt.  If you want to know how I did that, please check out my article on how to <a href="https://thesysadminchannel.com/create-free-lets-encrypt-ssl-certificates-using-powershell/" rel="noopener noreferrer" target="_blank">Create Free Lets Encrypt SSL Certificates Using Powershell</a>.  This article goes in depth and even has a video walkthrough if you prefer that method.</p>
<p>&nbsp;<br />
Now that we got that covered, let&#8217;s take this step by step on how to setup SSL certificates on Xampp.  Assuming you installed Xampp in the default directory of C:\xampp here&#8217;s how to do it.</p>
<ul>
<li>Navigate to <strong>c:\xampp\apache</strong> and create a <strong>&#8216;cert&#8217;</strong> folder</li>
<li>Copy the <strong>cert.cer</strong> and the <strong>cert.key</strong> that we got from Let&#8217;s Encrypt</li>
<li>Paste those 2 files in to this directory</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/Certificates-in-cert-directory.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/Certificates-in-cert-directory.png" alt="Certificates in cert directory" width="795" height="312" class="aligncenter size-full wp-image-2561" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/Certificates-in-cert-directory.png?v=1607486786 795w, https://thesysadminchannel.com/wp-content/uploads/2020/12/Certificates-in-cert-directory-768x301.png?v=1607486786 768w" sizes="(max-width: 795px) 100vw, 795px" /></a><br />
&nbsp;</p>
<p>Next, since I want to eventually access the web application from other browsers I am going to setup a DNS HOST A record.  This will allow any computer in the domain to access the URL and have it point to our instance.  Since I am running this at the domain level, I am using Domain Admin privileges.  </p>
<ul>
<li>While logged into a domain controller, open DNS Management</li>
<li>Expand the root of the domain namespace you want to use</li>
<li>In my case I&#8217;m using tool.thesysadminchannel.com so I&#8217;m using thesysadminchannel.com namespace</li>
<li>Right click and create New Host (A or AAAA) record</li>
<li>Enter the URL you would like to have</li>
<li>Enter the IPaddress of the server you want to point it back to (In this case our local xampp server)</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-A-Record-Creation.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-A-Record-Creation.png" alt="SSL Certificate A Record Creation" width="1089" height="495" class="aligncenter size-full wp-image-2563" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-A-Record-Creation.png?v=1607488087 1089w, https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-A-Record-Creation-1024x465.png?v=1607488087 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/12/SSL-Certificate-A-Record-Creation-768x349.png?v=1607488087 768w" sizes="(max-width: 1089px) 100vw, 1089px" /></a><br />
&nbsp;</p>
<p>Now that we have the certificate placed in the correct directory and we&#8217;ve setup our Host A record to be able to access the URL from any location in our network. It&#8217;s time to modify the apache config file to use this cert.</p>
<ul>
<li>Navigate to <strong>C:\xampp\apache\conf\extra\httpd-vhosts.conf</strong> and open with your editor of choice</li>
<li>Enter in the following config to create a new https virtual host</li>
</ul>
<pre class="brush: xml; title: ; notranslate">
&lt;VirtualHost *:443&gt;
    ServerAdmin webmaster@thesysadminchannel.com
    DocumentRoot &quot;C:/xampp/htdocs&quot;
    ServerName tool.thesysadminchannel.com
    ErrorLog &quot;logs/tool.log&quot;
    CustomLog &quot;logs/tool-access.log&quot; common
    SSLEngine on
    SSLCertificateFile &quot;C:/xampp/apache/cert/cert.cer&quot;
    SSLCertificateKeyFile &quot;C:/xampp/apache/cert/cert.key&quot;
&lt;/VirtualHost&gt;
</pre>
<p>&nbsp;</p>
<p>On the above be sure to take note of the following things.</p>
<ul>
<li>VirtualHost *:443 &#8211; This creates the port over 443 which is what SSL uses</li>
<li>The servername is the URL you plan on using.  In my case i&#8217;m using tool.thesysadminchannel.com so this is what I have configured here and my DNS records</li>
<li>SSL Engine is turned on</li>
<li>The SSL Certificate File and the SSL Certificate Key File are set to the path we created</li>
<li>The paths have forward slashes and not backslashes</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/12/httpd-Certificate-Setup.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/12/httpd-Certificate-Setup.png" alt="httpd Certificate Setup" width="1285" height="801" class="aligncenter size-full wp-image-2565" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/12/httpd-Certificate-Setup.png?v=1607488899 1285w, https://thesysadminchannel.com/wp-content/uploads/2020/12/httpd-Certificate-Setup-1024x638.png?v=1607488899 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/12/httpd-Certificate-Setup-768x479.png?v=1607488899 768w" sizes="(max-width: 1285px) 100vw, 1285px" /></a></p>
<p>Once you have that, we should be all done as far as the process on how to setup SSL Certificates on XAMPP server. Check it out and let me know if you run into any  snags with your setup.</p>
<p>Thanks again and if you&#8217;re interested in more sysadmin content, be sure to check out our <a href="https://thesysadminchannel.com/server-administration/" rel="noopener noreferrer" target="_blank">Server Administration category</a> as well as our <a href="https://www.youtube.com/c/theSysadminChannel" rel="noopener noreferrer" target="_blank">Youtube Channel</a>.</p>
<p>The post <a href="https://thesysadminchannel.com/setup-ssl-certificates-on-xampp/">How To Setup SSL Certificates on XAMPP</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/setup-ssl-certificates-on-xampp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2485</post-id>	</item>
		<item>
		<title>Break Glass Account: What Is It And Why Do You Need It</title>
		<link>https://thesysadminchannel.com/break-glass-account-what-is-it-and-why-do-you-need-it/</link>
					<comments>https://thesysadminchannel.com/break-glass-account-what-is-it-and-why-do-you-need-it/#respond</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Tue, 07 Jul 2020 05:56:47 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Break Glass Account]]></category>
		<category><![CDATA[Break glass account Azure]]></category>
		<category><![CDATA[break glass account best practices]]></category>
		<category><![CDATA[break glass account meaning]]></category>
		<category><![CDATA[monitor break glass accounts]]></category>
		<category><![CDATA[What Is A Break Glass Account]]></category>
		<category><![CDATA[Why Do You Need A Break Glass Account]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2171</guid>

					<description><![CDATA[<p>What Is A Break Glass Account and Why You Need It A break glass account is an account that is used for emergency purposes to gain access to a system or service that is not accessible under normal controls. You,&#8230; <a href="https://thesysadminchannel.com/break-glass-account-what-is-it-and-why-do-you-need-it/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/break-glass-account-what-is-it-and-why-do-you-need-it/">Break Glass Account: What Is It And Why Do You Need It</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>What Is A Break Glass Account and Why You Need It</h2>
<p><strong>A break glass account is an account that is used for emergency purposes to gain access to a system or service that is not accessible under normal controls</strong>.  You, as a systems administrator should not only document all of your break glass accounts but regularly audit those accounts to ensure that the correct people have access.  </p>
<p>More importantly, the reason you need a break glass account is to bypass the controls put in place that are there to increase security.<br />
&nbsp;</p>
<div id="tableofcontents">
<h2>Table Of Contents</h2>
<ul>
<li><a href="#Roles">What Roles Should Break Glass Accounts Have?</a></li>
<li><a href="#HowMany">How Many Emergency Accounts Should I Have?</a></li>
<li><a href="#Monitoring">How To Monitor Break Glass Accounts Sign-in And Audit Logs</a></li>
<ul>
<li><a href="#SignInLogs">Get-AzureADAuditSignInLogs Example</a></li>
</ul>
<li><a href="#Conclusion">Conclusion</a></li>
</ul>
</div>
<p>&nbsp;</p>
<div id="Roles" style="scroll-margin-top: 15px;"></div>
<h2>What Roles Should Break Glass Accounts Have?</h2>
<p>Typically any account that is used for emergency purposes needs to have the rights to be able to gain access to the system and revert any controls or lockouts that are in place. Nine times out of ten, I would recommend that the account have administrator rights to ensure you&#8217;re up and running as soon as possible.  Furthermore, <strong>a break glass account is usually highly privileged</strong> and has the least amount of controls in place so it needs to be secured in a vault that very few people have access to.<br />
&nbsp;</p>
<div id="HowMany" style="scroll-margin-top: 15px;"></div>
<h2>How Many Emergency Accounts Should I Have?</h2>
<p>Ideally you would want 1-2 emergency account per platform.  Let&#8217;s take Microsoft&#8217;s Azure Active Directory for example.  Although you can have many administrators or Global Admins, Microsoft recommends 2 break glass accounts for the M365 platform.  The reason being is that you&#8217;ll want a backup to the backup just for good measure.</p>
<p>&nbsp;<br />
Lets say you <a href="https://thesysadminchannel.com/deploy-mfa-using-azure-ad-conditional-access/" rel="noopener noreferrer" target="_blank">deploy Multifactor Authentication</a> and your policy is scoped to all users, you&#8217;ll want to have this break glass account excluded from that policy to ensure that you can still login if admins aren&#8217;t able to get in. </p>
<p>In this scenario, the Azure AD account would have Global Admin rights, it would be excluded from the MFA policy and finally, it would NOT be an on-premises account.  Specifically, this Global Admin account should be an onmicrosoft.com account in the event your on-prem AD has issues.<br />
&nbsp;</p>
<div id="Monitoring" style="scroll-margin-top: 15px;"></div>
<h2>How To Monitor Break Glass Accounts Sign-in And Audit Logs</h2>
<p>Every platform is different so it will be nearly impossible to give an answer to anything really specific. However, if we use our example of Azure Active Directory (Azure AD), I can give you a general idea of what this would look like in a real world example.  If you&#8217;re already using Azure AD that&#8217;s great!  If you&#8217;re not, but you plan to migrate sooner than later we got you covered in our <a href="https://www.youtube.com/watch?v=sSqV7FQyfFg&#038;list=PL60ejEuI_nxuO16nhkXE-QArnfzdftFlr" rel="noopener noreferrer" target="_blank">Exchange Migration YouTube Playlist</a>. </p>
<p>As I mentioned, it is recommended that you monitor sign-in and audit log activity from emergency accounts.  I would also highly recommend you trigger a notification to your administrators when there has been activity. How do I do this you ask? Here is a quick break down of what that looks like.</p>
<ul>
<li>Import or Install AzureAD Module</li>
<li>The cmdlet <strong>Get-AzureADAuditSignInLogs</strong> can quickly gather those logs using Powershell</li>
<li>The cmdlet <strong>Send-MailMessage</strong> can send an email to send you a notification, also using Powershell</li>
<li>Setup a scheduled task to check on a regular basis</li>
</ul>
<div id="SignInLogs" style="scroll-margin-top: 15px;"></div>
<h3>Get-AzureADAuditSignInLogs Example</h3>
<p>Here is a quick example of what Get-AzureADAuditSignInLogs would look like.<br />
&nbsp;</p>
<pre class="brush: powershell; title: ; notranslate">
#Connect to Azure Active Directory
Import-Module AzureAD
Connect-AzureAD -AccountId username@thesysadminchannel.com

#Get Date and then check for sign-ins after said date
$Date = (Get-Date).AddDays(-1).ToString(&quot;yyyy-MM-dd&quot;)
Get-AzureADAuditSignInLogs -Filter &quot;UserPrincipalName  eq 'breakglass@thesysadminchannel.onmicrosoft.com' AND CreatedDateTime gt $Date&quot; 
</pre>
<p>&nbsp;<br />
This short script block above will show the same information you&#8217;re used to seeing in the GUI.<br />
<a href="https://thesysadminchannel.com/wp-content/uploads/2020/07/BreakGlass-Account-Monitor-Signin.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/07/BreakGlass-Account-Monitor-Signin.png" alt="BreakGlass Account Monitor Signin" width="1688" height="616" class="aligncenter size-full wp-image-2393" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/07/BreakGlass-Account-Monitor-Signin.png?v=1601535312 1688w, https://thesysadminchannel.com/wp-content/uploads/2020/07/BreakGlass-Account-Monitor-Signin-1024x374.png?v=1601535312 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/07/BreakGlass-Account-Monitor-Signin-768x280.png?v=1601535312 768w" sizes="(max-width: 1688px) 100vw, 1688px" /></a></p>
<div id="Conclusion" style="scroll-margin-top: 15px;"></div>
<h2>Conclusion</h2>
<p>At the end of the day you&#8217;ll need to ensure you have a backdoor to get into your platform and a break glass account is a perfect use case for it.  I hope this article was informative for you and if there&#8217;s one take away from this article, that is&#8230; Subscribe to my <a href="https://www.youtube.com/c/theSysadminChannel" rel="noopener noreferrer" target="_blank">Youtube Channel</a>.  Because why not. 🙂</p>
<p>The post <a href="https://thesysadminchannel.com/break-glass-account-what-is-it-and-why-do-you-need-it/">Break Glass Account: What Is It And Why Do You Need It</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/break-glass-account-what-is-it-and-why-do-you-need-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2171</post-id>	</item>
		<item>
		<title>Get Logged In Users Using Powershell</title>
		<link>https://thesysadminchannel.com/get-logged-in-users-using-powershell/</link>
					<comments>https://thesysadminchannel.com/get-logged-in-users-using-powershell/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Sun, 17 May 2020 05:16:09 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[command to check users logged in windows remotely]]></category>
		<category><![CDATA[find all computers a user has logged into]]></category>
		<category><![CDATA[find what computer a user is logged into powershell]]></category>
		<category><![CDATA[find where a user is logged on in a domain]]></category>
		<category><![CDATA[get logged in user powershell]]></category>
		<category><![CDATA[powershell get logged on user on remote computer]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2159</guid>

					<description><![CDATA[<p>A while back I posted my initial script to find the users that are logged into a server and log them off remotely. That was several years ago and I thought I would take another crack at it to try&#8230; <a href="https://thesysadminchannel.com/get-logged-in-users-using-powershell/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/get-logged-in-users-using-powershell/">Get Logged In Users Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A while back I posted my initial script to <a href="https://thesysadminchannel.com/find-users-logged-into-a-server-and-log-them-off-remotely/" rel="noopener noreferrer" target="_blank">find the users that are logged into a server</a> and log them off remotely.  That was several years ago and I thought I would take another crack at it to try to improve the speed, improve the formatting and add some dedicated switches with a bit more flexibility. Lastly, I wanted to change that ugly, unconventional name to something more Powershell approved.  I call this new function <strong>Get Logged In Users</strong>. </p>
<div id="tableofcontents">
<h2>Table Of Contents</h2>
<ul>
<li><a href="#LoggedInUsers">Get Logged In Users Using Powershell</a></li>
<ul>
<li><a href="#Parameters">Parameters</a></li>
<li><a href="#PowershellCode">Powershell Code</a></li>
</ul>
<li><a href="#HowToRunScript">How To Run Get Logged In User Powershell Script</a></li>
<li><a href="#QueryRemoteMachines">How To Query Remote Computers</a></li>
<li><a href="#Conclusion">Conclusion</a></li>
</ul>
</div>
<p>&nbsp;<br />
The underlying structure is still going to be using query session so that hasn&#8217;t changed.  What has changed is now we can specify a specific user or find where a user is logged on in a domain.  Another note is the ability to log them off using a simple switch so that can definitely come in handy if you&#8217;re checking a log of systems.</p>
<div id="LoggedInUsers" style="scroll-margin-top: 15px;"></div>
<h2>Get Logged In Users Using Powershell</h2>
<p>Looking back I don&#8217;t know why I added the ActiveDirectory Module and made it run as an administrator.  That is simply not needed and not required to run this function.  However, I would highly recommend you run this on a Windows 10 machine or Server 2016 and later with Powershell 5 because well let&#8217;s face it, we&#8217;re in 2020.</p>
<div id="Parameters" style="scroll-margin-top: 15px;"></div>
<h2>Parameters</h2>
<h3>    -ComputerName</h3>
<p>Description: This will specify the ComputerName that you would like to check.  If no ComputerName is specified, it will check the local computer.</p>
<h3>    -UserName</h3>
<p>Description: If the specified username is found logged into a machine, it will display it in the output.</p>
<div id="PowershellCode" style="scroll-margin-top: 15px;"></div>
<p>&nbsp;</p>
<pre class="brush: powershell; title: ; notranslate">

Function Get-LoggedInUser {
&lt;#
.SYNOPSIS
    This will check the specified machine to see all users who are logged on.
    For updated help and examples refer to -Online version.

.NOTES
    Name: Get-LoggedInUser
    Author: Paul Contreras
    Version: 3.0
    DateUpdated: 2021-Sep-21

.LINK
    https://thesysadminchannel.com/get-logged-in-users-using-powershell/ -
    For updated help and examples refer to -Online version.

.PARAMETER ComputerName
    Specify a computername to see which users are logged into it.  If no computers are specified, it will default to the local computer.

.PARAMETER UserName
    If the specified username is found logged into a machine, it will display it in the output.

.EXAMPLE
    Get-LoggedInUser -ComputerName Server01
    Display all the users that are logged in server01

.EXAMPLE
    Get-LoggedInUser -ComputerName Server01, Server02 -UserName jsmith
    Display if the user, jsmith, is logged into server01 and/or server02


#&gt;

    [CmdletBinding()]
        param(
            [Parameter(
                Mandatory = $false,
                ValueFromPipeline = $true,
                ValueFromPipelineByPropertyName = $true,
                Position=0
            )]
            [string[]] $ComputerName = $env:COMPUTERNAME,


            [Parameter(
                Mandatory = $false
            )]
            [Alias(&quot;SamAccountName&quot;)]
            [string]   $UserName
        )

    BEGIN {}

    PROCESS {
        foreach ($Computer in $ComputerName) {
            try {
                $Computer = $Computer.ToUpper()
                $SessionList = quser /Server:$Computer 2&gt;$null
                if ($SessionList) {
                    $UserInfo = foreach ($Session in ($SessionList | select -Skip 1)) {
                        $Session = $Session.ToString().trim() -replace '\s+', ' ' -replace '&gt;', ''
                        if ($Session.Split(' ')[3] -eq 'Active') {
                            [PSCustomObject]@{
                                ComputerName = $Computer
                                UserName     = $session.Split(' ')[0]
                                SessionName  = $session.Split(' ')[1]
                                SessionID    = $Session.Split(' ')[2]
                                SessionState = $Session.Split(' ')[3]
                                IdleTime     = $Session.Split(' ')[4]
                                LogonTime    = $session.Split(' ')[5, 6, 7] -as [string] -as [datetime]
                            }
                        } else {
                            [PSCustomObject]@{
                                ComputerName = $Computer
                                UserName     = $session.Split(' ')[0]
                                SessionName  = $null
                                SessionID    = $Session.Split(' ')[1]
                                SessionState = 'Disconnected'
                                IdleTime     = $Session.Split(' ')[3]
                                LogonTime    = $session.Split(' ')[4, 5, 6] -as [string] -as [datetime]
                            }
                        }
                    }

                    if ($PSBoundParameters.ContainsKey('Username')) {
                        $UserInfo | Where-Object {$_.UserName -eq $UserName}
                      } else {
                        $UserInfo | Sort-Object LogonTime
                    }
                }
            } catch {
                Write-Error $_.Exception.Message

            }
        }
    }

    END {}
}

</pre>
<p>&nbsp;</p>
<div id="HowToRunScript" style="scroll-margin-top: 15px;"></div>
<h2>How To Run Get Logged In User Powershell Script</h2>
<p>In order to the run the script there are a couple of things you need to do.  First and foremost, you need to <a href="https://thesysadminchannel.com/set-execution-policy-in-powershell/" target="_blank" rel="noopener noreferrer">set your execution policy</a> to RemoteSigned or bypass.  This is a standard with running <em>any</em> Powershell script.</p>
<p>Next you need to dot source the script since it is a function.  To dot source the script do the following:</p>
<ul>
<li>Copy the script above and save it any location. In this example I&#8217;ll save it to my C:\_Scripts folder.</li>
<li>Within the Powershell Window type: <strong>. .\_Scripts\Get-LoggedInUser.ps1</strong> &#8211; Note the two dots before the backslash.</li>
</ul>
<p>&nbsp;</p>
<div id="QueryRemoteMachines" style="scroll-margin-top: 15px;"></div>
<h2>Get Logged On Users On Remote Computers</h2>
<p>The best thing I love about this script is your ability to get who is logged into a remote computer.  This mitigates the need to physically log into computer and checking that way.  Since this Powershell script allows you to query remote servers and computers, it makes it highly automatable and very scalable.  Using this script, you can check 1 server or 1,000 servers and it would be the same amount of effort for the person who is running it.  It&#8217;s awesome and I love how you can do it all from your own Windows 10 computer.</p>
<p>You can also <strong>find where a user is logged on in a domain</strong> very easily.   Depending on how many machines you&#8217;re going to be iterating through, it can obviously take some time but it can be done.  Here is a simple code snippet of how to get where a user is logged in to.</p>
<pre class="brush: powershell; title: ; notranslate">
PS C:\&gt; . .\_Scripts\Get-LoggedInUser.ps1
PS C:\&gt;
PS C:\&gt; Get-LoggedInUser -ComputerName PAC-WIN1001, PAC-ADC01, PAC-DC01
 
ComputerName UserName   SessionState LogonTime
------------ --------   ------------ ---------
PAC-WIN1001  pcontreras Active       8/5/2021 10:00:00 PM
PAC-ADC01    pcontreras Disconnected 6/22/2021 7:27:00 AM
PAC-DC01     pcontreras Disconnected 6/22/2021 4:29:00 PM

</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/05/Get-Logged-In-User.png"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/05/Get-Logged-In-User.png" alt="Get-Logged In User" width="800" height="317" class="aligncenter size-full wp-image-3311" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/05/Get-Logged-In-User.png?v=1628287856 800w, https://thesysadminchannel.com/wp-content/uploads/2020/05/Get-Logged-In-User-768x304.png?v=1628287856 768w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
<p>&nbsp;</p>
<div id="Conclusion" style="scroll-margin-top: 15px;"></div>
<h2>Conclusion</h2>
<p>So there you have it,  a quick and easy solution to a problem that many IT Administrators have come across in their sysadmin journey.  I am well aware that you can also do this via group policy if you wanted to go that route, or you can do this via some GUI tool but I always like to get my hands dirty with Powershell.</p>
<p>Thanks again for taking the time to visit and go ahead and drop a comment if you have any questions about the script or its intended fuctions.  Also, don&#8217;t forget to check out our <a href="https://www.youtube.com/c/theSysadminChannel" rel="noopener noreferrer" target="_blank">Youtube Channel</a> for visual video content and our own <a href="https://thesysadminchannel.com/powershell/" rel="noopener noreferrer" target="_blank">personal Powershell gallery</a> full of real world scripts.</p>
<p>The post <a href="https://thesysadminchannel.com/get-logged-in-users-using-powershell/">Get Logged In Users Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/get-logged-in-users-using-powershell/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2159</post-id>	</item>
		<item>
		<title>Get Directory Tree Size Using Powershell (Recursive)</title>
		<link>https://thesysadminchannel.com/get-directory-tree-size-using-powershell/</link>
					<comments>https://thesysadminchannel.com/get-directory-tree-size-using-powershell/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Sun, 15 Mar 2020 06:46:26 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Get Directory Tree Size Using Powershell]]></category>
		<category><![CDATA[get folder size powershell]]></category>
		<category><![CDATA[powershell get directory tree size]]></category>
		<category><![CDATA[PowerShell Get folder size including subfolders]]></category>
		<category><![CDATA[PowerShell Get network folder size]]></category>
		<category><![CDATA[PowerShell list all files in directory and subdirectories with size]]></category>
		<category><![CDATA[PowerShell script to get folder size on remote computer]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=2072</guid>

					<description><![CDATA[<p>The other day I got some alerts saying that one of our file servers was running out of space. Typically, I would just go into VMware vCenter, expand the disk and call it a day. The problem was that this&#8230; <a href="https://thesysadminchannel.com/get-directory-tree-size-using-powershell/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/get-directory-tree-size-using-powershell/">Get Directory Tree Size Using Powershell (Recursive)</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The other day I got some alerts saying that one of our file servers was running out of space.  Typically, I would just go into <a href="https://thesysadminchannel.com/vmware/" rel="noopener noreferrer" target="_blank">VMware</a> vCenter, expand the disk and call it a day.  The problem was that this was a relatively new server with several terabytes of disk space.  I thought it to be highly unusual that it could be filled up so fast so I wanted to see what folders were taking the most space remotely.  I know there are programs such as windirstat and treesize but I didn&#8217;t necessarily want to install anything on my server, much less worry about patching it or removing it later.  I wanted something a bit more portable and most of all, I wanted something clean!  I decided I was going to write a Powershell script to get folder sizes on remote computers and ultimately came up with <strong>Get Directory Tree Size Using Powershell</strong>.</p>
<p>&nbsp;<br />
The goal of the script was to have Powershell get all files in a directory and subdirectories with size.  As mentioned above I also wanted it to be portable so I wanted to make sure it was able get folder sizes for remote computers.  I was in luck because Get-ChildItem -Recurse does exactly that, and it does it very quickly. The best thing of all is that it supports remote UNC paths, mapped drives and local drives.  This would be the base of the function.</p>
<h2>Things to Note</h2>
<p>There are a couple of things I wanted to highlight and/or clarify just in case it might be misleading.</p>
<ul>
<li><strong>Get-DirectoryTreeSize</strong> supports remote UNC (Network), Local and Mapped Drives</li>
<li>It uses <strong>Get-Childitem</strong> and <strong>Measure-Object as the base cmdlets</strong> to quickly calculate data</li>
<li>Only specifying the path parameter will show files, folders and size for the <strong>specified directory</strong></li>
<li><strong>Recurse </strong>shows files, folders and sizes for <strong>each directory respectively</strong></li>
<li>To avoid long subfolder strings, subfolders will <strong>display &#8220;.\&#8221; instead of $Path</strong></li>
<li><strong>AllItemsAndAllFolders </strong>will get all files, all folders and the total size for the <strong>specified directory and all subdirectories</strong></li>
<li>Get-DirectoryTreeSize -Path C:\Temp -Recurse | Sort-Object FolderSizeInMB -Descending will quickly get the largest folder in your query</li>
<li>There are 3 decimal places so smaller files won&#8217;t show 0 size</li>
</ul>
<p>&nbsp;<br />
<em>If you have any questions feel free to drop me a comment and I&#8217;ll do my best to get back to you.</em> </p>
<h2>Get Directory Tree Size Using Powershell</h2>
<pre class="brush: powershell; title: ; notranslate">

Function Get-DirectoryTreeSize {
&lt;#
.SYNOPSIS
    This is used to get the file count, subdirectory count and folder size for the path specified. The output will show the current folder stats unless you specify the &quot;AllItemsAndAllFolders&quot; property.
    Since this uses Get-ChildItem as the underlying structure, this supports local paths, network UNC paths and mapped drives.

.NOTES
    Name: Get-DirectoryTreeSize
    Author: theSysadminChannel
    Version: 1.0
    DateCreated: 2020-Feb-11


.LINK
    https://thesysadminchannel.com/get-directory-tree-size-using-powershell -


.PARAMETER Recurse
    Using this parameter will drill down to the end of the folder structure and output the filecount, foldercount and size of each folder respectively.

.PARAMETER AllItemsAndAllFolders
    Using this parameter will get the total file count, total directory count and total folder size in MB for everything under that directory recursively.

.EXAMPLE
    Get-DirectoryTreeSize &quot;C:\Some\Folder&quot;

    Path            FileCount DirectoryCount FolderSizeInMB
    ----            --------- -------------- --------------
    C:\Some\folder          3              3          0.002

.EXAMPLE
    Get-DirectoryTreeSize &quot;\\MyServer\Folder&quot; -Recurse

    Path                 FileCount DirectoryCount FolderSizeInMB
    ----                 --------- -------------- --------------
    \\MyServer\Folder            2              1         40.082
    .\Subfolder                  1              0         26.555

.EXAMPLE
    Get-DirectoryTreeSize &quot;Z:\MyMapped\folder&quot; -AllItemsAndAllFolders

    Path                  TotalFileCount TotalDirectoryCount TotalFolderSizeInMB
    ----                  -------------- ------------------- -------------------
    Z:\MyMapped\folder                 3                   1              68.492

#&gt;

[CmdletBinding(DefaultParameterSetName=&quot;Default&quot;)]

param(
    [Parameter(
        Position = 0,
        Mandatory = $true
    )]
    [string]  $Path,



    [Parameter(
        Mandatory = $false,
        ParameterSetName = &quot;ShowRecursive&quot;
    )]
    [switch]  $Recurse,



    [Parameter(
        Mandatory = $false,
        ParameterSetName = &quot;ShowTopFolderAllItemsAndAllFolders&quot;
    )]
    [switch]  $AllItemsAndAllFolders
)

    BEGIN {
        #Adding a trailing slash at the end of $path to make it consistent.
        if (-not $Path.EndsWith('\')) {
            $Path = &quot;$Path\&quot;
        }
    }

    PROCESS {
        try {
            if (-not $PSBoundParameters.ContainsKey(&quot;AllItemsAndAllFolders&quot;) -and -not $PSBoundParameters.ContainsKey(&quot;Recurse&quot;)) {
                $FileStats = Get-ChildItem -Path $Path -File -ErrorAction Stop | Measure-Object -Property Length -Sum
                $FileCount = $FileStats.Count
                $DirectoryCount = Get-ChildItem -Path $Path -Directory | Measure-Object | select -ExpandProperty Count
                $SizeMB =  &quot;{0:F3}&quot; -f ($FileStats.Sum / 1MB) -as [decimal]

                [PSCustomObject]@{
                    Path                 = $Path#.Replace($Path,&quot;.\&quot;)
                    FileCount            = $FileCount
                    DirectoryCount       = $DirectoryCount
                    FolderSizeInMB       = $SizeMB
                }
            }

            if  ($PSBoundParameters.ContainsKey(&quot;AllItemsAndAllFolders&quot;)) {
                $FileStats = Get-ChildItem -Path $Path -File -Recurse -ErrorAction Stop | Measure-Object -Property Length -Sum
                $FileCount = $FileStats.Count
                $DirectoryCount = Get-ChildItem -Path $Path -Directory -Recurse | Measure-Object | select -ExpandProperty Count
                $SizeMB =  &quot;{0:F3}&quot; -f ($FileStats.Sum / 1MB) -as [decimal]

                [PSCustomObject]@{
                    Path                 = $Path#.Replace($Path,&quot;.\&quot;)
                    TotalFileCount       = $FileCount
                    TotalDirectoryCount  = $DirectoryCount
                    TotalFolderSizeInMB  = $SizeMB
                }
            }

            if ($PSBoundParameters.ContainsKey(&quot;Recurse&quot;)) {
                Get-DirectoryTreeSize -Path $Path
                $FolderList = Get-ChildItem -Path $Path -Directory -Recurse | select -ExpandProperty FullName

                if ($FolderList) {
                    foreach ($Folder in $FolderList) {
                        $FileStats = Get-ChildItem -Path $Folder -File | Measure-Object -Property Length -Sum
                        $FileCount = $FileStats.Count
                        $DirectoryCount = Get-ChildItem -Path $Folder -Directory | Measure-Object | select -ExpandProperty Count
                        $SizeMB =  &quot;{0:F3}&quot; -f ($FileStats.Sum / 1MB) -as [decimal]

                        [PSCustomObject]@{
                            Path                 = $Folder.Replace($Path,&quot;.\&quot;)
                            FileCount            = $FileCount
                            DirectoryCount       = $DirectoryCount
                            FolderSizeInMB       = $SizeMB
                        }
                        #clearing variables
                        $null = $FileStats
                        $null = $FileCount
                        $null = $DirectoryCount
                        $null = $SizeMB
                    }
                }
            }
        } catch {
            Write-Error $_.Exception.Message
        }

    }

    END {}

}

</pre>
<p>When you call the function and only specify the path parameter, here is what it looks like.<br />
<div id="attachment_2096" style="width: 1034px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2096" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize.png" alt="Get-DirectoryTreeSize" width="1024" height="561" class="size-full wp-image-2096" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize.png?v=1597626108 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-768x421.png?v=1597626108 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><p id="caption-attachment-2096" class="wp-caption-text">In this example, I have 3 files and 2 subdirectories, totalling 66678.063 MB (65.11 GB) <strong>for that current directory</strong></p></div></p>
<div id="attachment_2098" style="width: 1228px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-AllItemsAndAllFolders.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2098" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-AllItemsAndAllFolders.png" alt="Get-DirectoryTreeSize -AllItemsAndAllFolders" width="1218" height="461" class="size-full wp-image-2098" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-AllItemsAndAllFolders.png?v=1597626344 1218w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-AllItemsAndAllFolders-1024x388.png?v=1597626344 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-AllItemsAndAllFolders-768x291.png?v=1597626344 768w" sizes="(max-width: 1218px) 100vw, 1218px" /></a><p id="caption-attachment-2098" class="wp-caption-text">There are a total of 12 files and 5 directories amounting to 181759.929 MB (177.49 GB) &#8211; <strong>This for this directory and all subdirectories</strong>.  This is also equivalent to right clicking the folder and selecting properties.</p></div>
<p>Finally, we can get the folder tree recursively so I&#8217;m going to run the same script locally (thanks to its portability), from my other computer that&#8217;s hosting the backup folder.<br />
<div id="attachment_2101" style="width: 1239px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-Recurse.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2101" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-Recurse.png" alt="Get-DirectoryTreeSize-Recurse" width="1229" height="685" class="size-full wp-image-2101" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-Recurse.png?v=1597627653 1229w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-Recurse-1024x571.png?v=1597627653 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-DirectoryTreeSize-Recurse-768x428.png?v=1597627653 768w" sizes="(max-width: 1229px) 100vw, 1229px" /></a><p id="caption-attachment-2101" class="wp-caption-text">The Recurse parameter allows you to drill down all folders and view stats.  You can also sort by FolderSizeInMB and see which folder has the most space.</p></div></p>
<p>&nbsp;</p>
<p>Another thing to note is that I wanted to shorten the display of the subfolders so it doesn&#8217;t push the file, directory and size counts off the screen. For this I replaced the original $Path location with &#8220;.\&#8221; so it&#8217;s relative to $Path.</p>
<p>So hopefully you were able to make use of the Powershell script to get directory tree size including all subfolders.  I&#8217;m pretty stoked how quickly it was able to process remote servers and I&#8217;m sure I&#8217;ll be adding this to my list of audit tasks.  It&#8217;s not that much effort to run and it provides a ton of useful information so it&#8217;s pretty much a no brainer.</p>
<p>&nbsp;<br />
All in all I wanted to say thanks a lot for taking the time to visit and hopefully you can make use of the Powershell script in your environment.  If you like these kinds of posts, feel free to check out our <a href="https://thesysadminchannel.com/powershell/" rel="noopener noreferrer" target="_blank">gallery full of useful real-world scripts</a>.  Don&#8217;t forget to check out our <a href="https://www.youtube.com/c/TheSysadminChannel" rel="noopener noreferrer" target="_blank">Youtube Page for sysadmin video content</a>.</p>
<p>Post Updated: August 2020</p>
<p>The post <a href="https://thesysadminchannel.com/get-directory-tree-size-using-powershell/">Get Directory Tree Size Using Powershell (Recursive)</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/get-directory-tree-size-using-powershell/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2072</post-id>	</item>
		<item>
		<title>[Solved] Add-WindowsCapability failed. Error code = 0x800f0954 &#8211; RSAT Fix</title>
		<link>https://thesysadminchannel.com/solved-add-windowscapability-failed-error-code-0x800f0954-rsat-fix/</link>
					<comments>https://thesysadminchannel.com/solved-add-windowscapability-failed-error-code-0x800f0954-rsat-fix/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Tue, 11 Feb 2020 06:37:07 +0000</pubDate>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[add-windowscapability access is denied]]></category>
		<category><![CDATA[Add-WindowsCapability failed]]></category>
		<category><![CDATA[add-windowscapability failed. error code]]></category>
		<category><![CDATA[Add-WindowsCapability failed. Error code = 0x800f0954]]></category>
		<category><![CDATA[add-windowscapability failed. error code = 0x800f0954 snmp]]></category>
		<category><![CDATA[add-windowscapability failed. error code = 0x800f0954 windows 10 1909]]></category>
		<category><![CDATA[dism error: 0x800f0954]]></category>
		<category><![CDATA[Error code = 0x800f0954]]></category>
		<category><![CDATA[error code 0x800f0954 when installing rsat]]></category>
		<category><![CDATA[get-windowscapability error 0x800f0954]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=1566</guid>

					<description><![CDATA[<p>If you have tried to install Remote Server Administration tools for Windows 10 version 1809, 1903 or later you might have come across: Add-WindowsCapability failed. Error code = 0x800f0954. If you haven&#8217;t, that&#8217;s great! If you have, you&#8217;re in luck&#8230; <a href="https://thesysadminchannel.com/solved-add-windowscapability-failed-error-code-0x800f0954-rsat-fix/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/solved-add-windowscapability-failed-error-code-0x800f0954-rsat-fix/">[Solved] Add-WindowsCapability failed. Error code = 0x800f0954 &#8211; RSAT Fix</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you have tried to <a href="https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/" rel="noopener noreferrer" target="_blank">install Remote Server Administration tools for Windows 10 version 1809, 1903 or later</a> you might have come across: <strong>Add-WindowsCapability failed. Error code = 0x800f0954</strong>.  If you haven&#8217;t, that&#8217;s great!  If you have, you&#8217;re in luck because today we&#8217;re going to go over the steps needed to fix the issue.</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Error.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Error.png" alt="Add-WindowsCapability -Name RSAT Error" width="1227" height="512" class="aligncenter size-full wp-image-2029" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Error.png?v=1597118909 1227w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Error-1024x427.png?v=1597118909 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Error-768x320.png?v=1597118909 768w" sizes="(max-width: 1227px) 100vw, 1227px" /></a></p>
<p>&nbsp;</p>
<p>By default, the WindowsCapability logs are stored in <strong>C:\Windows\Logs\DISM\dism.log</strong> so we&#8217;ll check there to see what&#8217;s happening behind the scenes.</p>
<pre class="brush: plain; light: true; title: ; notranslate">
DISM   DISM Package Manager: PID=1280 TID=6320  Error in operation: (null) (CBS HRESULT=0x800f0954) - CCbsConUIHandler::Error
DISM   DISM Package Manager: PID=1280 TID=5772 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x800f0954)
DISM   DISM Package Manager: PID=1280 TID=5772 Failed processing package changes with session options - CDISMPackageManager::ProcessChangesWithOptions(hr:0x800f0954)
DISM   API: PID=11232 TID=1244 Failed to install capability. - CAddCapabilityCommandObject::InternalExecute(hr:0x800f0954)
DISM   API: PID=11232 TID=1244 InternalExecute failed - CBaseCommandObject::Execute(hr:0x800f0954)
DISM   API: PID=11232 TID=8352 CAddCapabilityCommandObject internal execution failed - DismAddCapabilityInternal(hr:0x800f0954)
</pre>
<h2>Fix: Add-WindowsCapability failed. RSAT Error code = 0x800f0954</h2>
<p>The steps to fix this are pretty simple and should only take a couple of minutes.</p>
<ul>
<li>On the problem child machine open <strong>gpedit.msc</strong></li>
<li>Go to <strong>Computer Configuration</strong> -> <strong>Administrative Templates</strong> -> <strong>System</strong></li>
<li>Open <strong>Specify settings for optional component installation and component repair</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Gpedit-settings-for-windows-capability-fix.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Gpedit-settings-for-windows-capability-fix.png" alt="Gpedit settings for windows capability fix" width="1227" height="529" class="aligncenter size-full wp-image-2038" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Gpedit-settings-for-windows-capability-fix.png?v=1597120428 1227w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Gpedit-settings-for-windows-capability-fix-1024x441.png?v=1597120428 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Gpedit-settings-for-windows-capability-fix-768x331.png?v=1597120428 768w" sizes="(max-width: 1227px) 100vw, 1227px" /></a><br />
&nbsp;</p>
<ul>
<li>With that settings open, select <strong>Enabled</strong></li>
<li>Check <strong>Download repair content and optional features directly from Windows Updates instead of Windows Server Updates Services (WSUS)</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Specify-Settings-for-optional-component-installations.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Specify-Settings-for-optional-component-installations.png" alt="Specify Settings for optional component installations" width="686" height="636" class="aligncenter size-full wp-image-2041" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Go back in your Powershell Window</li>
<li>Run a <strong>gpupdate /force</strong></li>
<li>Rerun the <strong>Add-WindowsCapability</strong> again to install the feature</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Succeeded.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Succeeded.png" alt="Add-WindowsCapability -Name RSAT Succeeded" width="1229" height="704" class="aligncenter size-full wp-image-2042" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Succeeded.png?v=1597123111 1229w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Succeeded-1024x587.png?v=1597123111 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-Succeeded-768x440.png?v=1597123111 768w" sizes="(max-width: 1229px) 100vw, 1229px" /></a></p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3.png" alt="Apps Settings 3" width="1024" height="628" class="aligncenter size-full wp-image-2012" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3.png?v=1597013424 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3-768x471.png?v=1597013424 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Once you&#8217;ve installed the RSAT tools for 1809, 1903 and later you might want to consider undoing those settings because this will install unnecessary updates on your machine.  You would especially want to reconsider this if you&#8217;re <a href="https://youtu.be/a2AWwhUaQuw" rel="noopener noreferrer" target="_blank">deploying software updates using SCCM</a>.  Hopefully you&#8217;ve been able to fix the <strong>Add-WindowsCapability failed. Error code = 0x800f0954</strong> error that so many of us have been running into.</p>
<p>Finally, feel free to check out the rest of our <a href="https://thesysadminchannel.com/server-administration/" rel="noopener noreferrer" target="_blank">server administration</a> for more of that content.</p>
<p>The post <a href="https://thesysadminchannel.com/solved-add-windowscapability-failed-error-code-0x800f0954-rsat-fix/">[Solved] Add-WindowsCapability failed. Error code = 0x800f0954 &#8211; RSAT Fix</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/solved-add-windowscapability-failed-error-code-0x800f0954-rsat-fix/feed/</wfw:commentRss>
			<slash:comments>37</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1566</post-id>	</item>
		<item>
		<title>Install RSAT for Windows 10 Version 1809, 1903 and Later</title>
		<link>https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/</link>
					<comments>https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Tue, 04 Feb 2020 06:52:35 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[active directory users and computers windows 10 1809]]></category>
		<category><![CDATA[enable rsat windows 10 1903 powershell]]></category>
		<category><![CDATA[how to install rsat]]></category>
		<category><![CDATA[install rsat windows 10 1809]]></category>
		<category><![CDATA[rsat 1809]]></category>
		<category><![CDATA[rsat not showing in windows 10 features]]></category>
		<category><![CDATA[rsat windows 10 1809]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=1875</guid>

					<description><![CDATA[<p>In the previous versions of Windows, you always had to download and install the Remote Server Administration Tools aka RSAT from Microsoft&#8217;s page. Many people complained about the fact that every time you would upgrade to a later build, it&#8230; <a href="https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/">Install RSAT for Windows 10 Version 1809, 1903 and Later</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the previous versions of Windows, you always had to download and install the Remote Server Administration Tools aka RSAT from Microsoft&#8217;s page.  Many people complained about the fact that every time you would upgrade to a later build, it would wipe out the tools and you would have to reinstall them. With more recent builds of Windows 10, the remote server administration tools are now part of the build as a Feature and can by accessed by enabling the Feature on Demand.   Let&#8217;s take a look and install RSAT for Windows 10 Version 1809, 1903 and later using the GUI method as well as using the Powershell method.</p>
<h2>Install RSAT for Windows 10 Version 1809, 1903 and Later in the GUI</h2>
<p>Although I much prefer the Powershell method, we&#8217;ll start off with the GUI method.</p>
<ul>
<li>Open Settings -> Apps -> Optional Features</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-1.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-1.png" alt="Apps Settings 1" width="1279" height="642" class="aligncenter size-full wp-image-2010" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-1.png?v=1597013336 1279w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-1-1024x514.png?v=1597013336 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-1-768x386.png?v=1597013336 768w" sizes="(max-width: 1279px) 100vw, 1279px" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Select the tools you want to install and click install</li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-2.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-2.png" alt="Apps Settings 2" width="1279" height="763" class="aligncenter size-full wp-image-2011" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-2.png?v=1597013415 1279w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-2-125x75.png?v=1597013415 125w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-2-1024x611.png?v=1597013415 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-2-768x458.png?v=1597013415 768w" sizes="(max-width: 1279px) 100vw, 1279px" /></a><br />
&nbsp;</p>
<h2>Install RSAT for Windows 10 Version 1809, 1903 and Later in Powershell</h2>
<ul>
<li>Open <strong>Powershell</strong> as <strong>Administrator</strong></li>
<li>Type: <strong>Get-WindowsCapability -Name RSAT* -Online</strong></li>
</ul>
<div id="attachment_2015" style="width: 1349px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-WindowsCapability-Name-RSAT.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2015" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-WindowsCapability-Name-RSAT.png" alt="Get-WindowsCapability -Name RSAT" width="1339" height="752" class="size-full wp-image-2015" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-WindowsCapability-Name-RSAT.png?v=1597111236 1339w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-WindowsCapability-Name-RSAT-1024x575.png?v=1597111236 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Get-WindowsCapability-Name-RSAT-768x431.png?v=1597111236 768w" sizes="(max-width: 1339px) 100vw, 1339px" /></a><p id="caption-attachment-2015" class="wp-caption-text">Take note of the name and status</p></div>
<ul>
<li>To install the feature, you can either pipe the command to Add-WindowsCapability -or-</li>
<li><strong>Add-WindowsCapability -Name <em>Name-of-Feature</em> -Online</strong></li>
</ul>
<div id="attachment_2018" style="width: 1349px" class="wp-caption aligncenter"><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT.png" target="_blank" rel="noopener noreferrer"><img decoding="async" aria-describedby="caption-attachment-2018" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT.png" alt="Add-WindowsCapability -Name RSAT" width="1339" height="752" class="size-full wp-image-2018" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT.png?v=1597111788 1339w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-1024x575.png?v=1597111788 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Add-WindowsCapability-Name-RSAT-768x431.png?v=1597111788 768w" sizes="(max-width: 1339px) 100vw, 1339px" /></a><p id="caption-attachment-2018" class="wp-caption-text">In this example, I&#8217;m installing the RSAT: Active Directory Domain Services and Lightweight Directory Services Tools</p></div>
<ul>
<li>The items should now be in the <strong>Start Menu</strong> -> <strong>Windows Administrative Tools</strong></li>
</ul>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3.png" alt="Apps Settings 3" width="1024" height="628" class="aligncenter size-full wp-image-2012" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3.png?v=1597013424 1024w, https://thesysadminchannel.com/wp-content/uploads/2020/08/Apps-Settings-3-768x471.png?v=1597013424 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<p>I&#8217;d love to hear your feedback and I hope you can now add RSAT easily using the Features on Demand.  As always be sure to check out our Youbtube Channel <a href="https://www.youtube.com/c/TheSysadminChannel" rel="noopener noreferrer" target="_blank">https://www.youtube.com/c/theSysadminChannel</a> or if you want more Server Administration content, check out our <a href="https://thesysadminchannel.com/server-administration/" rel="noopener noreferrer" target="_blank">Server Administration Category</a>.  There is a lot of useful information on both links.</p>
<p>The post <a href="https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/">Install RSAT for Windows 10 Version 1809, 1903 and Later</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/install-rsat-for-windows-10-version-1809-1903-and-later/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1875</post-id>	</item>
	</channel>
</rss>
