<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://myitforum.com/cs2/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>VB Script : ConfigMgr 2007</title><link>http://myitforum.com/cs2/files/folders/vbscripts/tags/ConfigMgr+2007/default.aspx</link><description>Tags: ConfigMgr 2007</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP2 (Build: 31113.47)</generator><item><title>The System OU Collection Creator Script </title><link>http://myitforum.com/cs2/files/folders/vbscripts/entry120436.aspx</link><pubDate>Thu, 24 Jul 2008 20:50:52 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:120436</guid><dc:creator>rodtrent</dc:creator><slash:comments>0</slash:comments><description>&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;From: &lt;strong&gt;Nicholas Aquino&lt;/strong&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;The System OU Collection Creator Script is a visual basic script that will create SMS collections based on the System_OU_Name0 information acquired from SMS via the Active Directory System Group Discovery.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;The script queries the System_System_OU_Name_ARR table inside SQL.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;For each distinct object returned (each unique System_OU_Name0 value), a WMI method is called to SMS that will create a query based collection of clients with that particular System_OU_Name0 value.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;When a collection is created, the following instance rights are added to the collection for the username who launched the script: &lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;Read&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;Delete&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;Modify&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;Advertise&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;ViewCollectedFiles&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;ReadResource&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;In addition to the user&amp;#39;s rights, the script will also add any group that resides in the local SMS Admins group to the instance permissions with the above rights as long as the group name is the same as the last OU listed in the System_OU_Name0 value.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;For example:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;The discovery method reported that a client resided in contoso.com\NorthAmerica\Building100.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;There is a group called contoso\Building100 in the local SMS Admins group on the primary server.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;The group contoso\building100 would be added to the instance permissions with the rights that are listed above.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;The script echoes out each System OU Name as it is being created, so launching using cscript.exe is preferred.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The command line is as&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;follows:&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;Cscript.exe SystemOUCollectionCreator.vbs &amp;lt;ServerName&amp;gt; &amp;lt;ParentCollectionID&amp;gt; &amp;lt;site code&amp;gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;ParentCollectionID is the collection ID of the collection where all of the System OU collections will reside.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;If you would like these collections at the root, simply specify collroot as the ParentCollectionID.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;The script will also produce a log file named SystemOUCollectionCreator.log so that you can reference all the newly created collections.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;It is recommended that a scheduled task be created to launch this script under the Primary&amp;#39;s System account.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;If run on a schedule, new System OU data will be queried automatically and a collection will be created.&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;Have Fun!&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;&lt;strong&gt;Nicholas Aquino&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoPlainText" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Tahoma" size="2"&gt;&lt;strong&gt;Systems Engineer - Asset &amp;amp; Configuration Management&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><enclosure url="http://www.myITforum.com/downloads/SystemOUCollectionCreator.zip" length="3812" type="application/x-zip-compressed" /></item></channel></rss>