<?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>add devices to sccm collection from csv Archives - the Sysadmin Channel</title>
	<atom:link href="https://thesysadminchannel.com/tag/add-devices-to-sccm-collection-from-csv/feed/" rel="self" type="application/rss+xml" />
	<link>https://thesysadminchannel.com/tag/add-devices-to-sccm-collection-from-csv/</link>
	<description>Documenting My Life as a System Administrator</description>
	<lastBuildDate>Sat, 25 Jul 2020 19:16:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
<site xmlns="com-wordpress:feed-additions:1">144174110</site>	<item>
		<title>Add Multiple Computers To SCCM Collection Using Powershell</title>
		<link>https://thesysadminchannel.com/add-multiple-computers-to-sccm-collection-using-powershell/</link>
					<comments>https://thesysadminchannel.com/add-multiple-computers-to-sccm-collection-using-powershell/#respond</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Wed, 21 Aug 2019 04:05:12 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SCCM]]></category>
		<category><![CDATA[add computers to collection in sccm using text file]]></category>
		<category><![CDATA[add devices to sccm collection from csv]]></category>
		<category><![CDATA[add list of computers to collection sccm]]></category>
		<category><![CDATA[Add Multiple Computers To SCCM Collection Using Powershell]]></category>
		<category><![CDATA[add multiple machines to sccm collection]]></category>
		<category><![CDATA[sccm add multiple resources to collection]]></category>
		<category><![CDATA[sccm create direct membership rule wizard add multiple computers]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=1820</guid>

					<description><![CDATA[<p>Anytime you&#8217;re working with multiple objects its always a good idea to try and streamline the process. In this article I&#8217;m going to show you how to add multiple computers to SCCM collection using Powershell as well as make an&#8230; <a href="https://thesysadminchannel.com/add-multiple-computers-to-sccm-collection-using-powershell/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/add-multiple-computers-to-sccm-collection-using-powershell/">Add Multiple Computers To SCCM Collection Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Anytime you&#8217;re working with multiple objects its always a good idea to try and streamline the process.  In this article I&#8217;m going to show you how to <strong>add multiple computers to SCCM collection using Powershell</strong> as well as make an effort to try to keep everything in the command line.  Let&#8217;s say we want to gather a group of Windows 10 devices that need to be patched.  I&#8217;m very well aware that we can accomplish this task using a query based collection, but what the hey, there might be other scenarios that we&#8217;ll need to get the list from a text file or maybe within a cluster from VMware.  </p>
<h3>Connect To SCCM Powershell</h3>
<p>If you&#8217;re doing this on a computer that&#8217;s NOT the SCCM site server, you&#8217;re going to need to install the SCCM admin console so you can install the binaries needed to connect.  However, let&#8217;s take look at the different paths for different machine types.</p>
<p>SCCM Site Server PSD1 Module Location:</p>
<li>Import-Module ‘E:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1’  </li>
<p><em>(Assuming the install dir is on the E Drive)</em></p>
<p>Windows 10 PSD1 Module Location:</p>
<li>Import-Module ‘C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1’</li>
<p><em>(Under the default install location)</em></p>
<p>Once you&#8217;ve imported the SCCM module you can now change directory into the Primary Site Code.<br />
<code>cd PAC:\</code></p>
<h3>Create Device Collection Using Powershell</h3>
<p>In our example we&#8217;re going to create a device collection for Windows 10 that needs to be patched. Since we&#8217;re now on our way to becoming Powershell Wizards we&#8217;ll also create the collection in Powershell.</p>
<pre class="brush: powershell; title: ; notranslate">
PS PAC:\&gt; New-CMDeviceCollection -Name &quot;Windows 10 Patch Devices&quot; -LimitingCollectionName &quot;All Systems&quot; 
</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/03/New-CMDeviceCollection-Windows-10-Patch-Devices.png" target="_blank" rel="noopener noreferrer"><img fetchpriority="high" decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/03/New-CMDeviceCollection-Windows-10-Patch-Devices.png" alt="New-CMDeviceCollection Windows 10 Patch Devices" width="781" height="251" class="aligncenter size-full wp-image-1827" srcset="https://thesysadminchannel.com/wp-content/uploads/2020/03/New-CMDeviceCollection-Windows-10-Patch-Devices.png?v=1584668596 781w, https://thesysadminchannel.com/wp-content/uploads/2020/03/New-CMDeviceCollection-Windows-10-Patch-Devices-768x247.png?v=1584668596 768w" sizes="(max-width: 781px) 100vw, 781px" /></a><br />
&nbsp;</p>
<h2>Add Multiple Computers To SCCM Collection Using Powershell</h2>
<p>To add a device to a group we&#8217;ll leverage the <strong>Add-CMDeviceCollectionDirectMembershipRule</strong> cmdlet from the SCCM module.  Next up we&#8217;ll run the little code snippet to execute the job.</p>
<pre class="brush: powershell; title: ; notranslate">

foreach ($Computer in $ComputerList) {
	Add-CMDeviceCollectionDirectMembershipRule -CollectionName &quot;Windows 10 Patch Devices&quot; -ResourceID (Get-CMDevice -Name $Computer).ResourceID 
}

</pre>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2020/03/Windows-10-Patch-Devices.png" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2020/03/Windows-10-Patch-Devices.png" alt="Windows 10 Patch Devices" width="624" height="250" class="aligncenter size-full wp-image-1835" /></a><br />
&nbsp;</p>
<p>That&#8217;s it! The great thing is that we can reuse that code to add more and more machines as needed.  I hope this article was able to help you with your SCCM administration as much as it helped it.</p>
<p>Finally, don&#8217;t forget to check out our <a href="https://www.youtube.com/playlist?list=PL60ejEuI_nxuFw3eWRCxmffag_nYUz4PZ" rel="noopener noreferrer" target="_blank">SCCM Playlist on YouTube</a> for more SCCM tips and tools. </p>
<p>The post <a href="https://thesysadminchannel.com/add-multiple-computers-to-sccm-collection-using-powershell/">Add Multiple Computers To SCCM Collection Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/add-multiple-computers-to-sccm-collection-using-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1820</post-id>	</item>
	</channel>
</rss>
