<?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>Donnie Taylor at myITforum.com</title><link>http://myitforum.com/cs2/blogs/dtaylor/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP2 (Build: 31113.47)</generator><item><title>Prepare for ConfigMgr 2012 with these handy Powershell scripts!</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2011/03/22/prepare-for-configmgr-2012-with-these-handy-powershell-scripts.aspx</link><pubDate>Tue, 22 Mar 2011 18:59:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:155937</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=155937</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2011/03/22/prepare-for-configmgr-2012-with-these-handy-powershell-scripts.aspx#comments</comments><description>&lt;p&gt;So the time is coming - you need to prepare to ConfigMgr 2012.&amp;nbsp; Sure, the migration tool built into 2012 is an awesome product, but don&amp;#39;t you think you should clean up your ConfigMgr 2007 infrastructure before you run down the migration path?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Yes...yes you should.&lt;/p&gt;&lt;p&gt;Here are some scripts we have thrown together for a MMS 2011 presentation, but we thought it would be nice to share them out a bit early.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;u&gt;&lt;b&gt;Word of advice:&amp;nbsp; Change servername and site_123 in the following examples to the appropriate ConfigMgr Primary server and Site code.&lt;/b&gt;&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Packages missing version or manufacturer fields:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let&amp;#39;s talk about package source.&amp;nbsp; You have hundreds of packages in 2007 - some of which have been there before your packaging standards went in.&amp;nbsp; Perhaps you have packages that don&amp;#39;t have a version number assigned to them, or don&amp;#39;t have a manufacturer assigned to them....you need a quick way to see those packages.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;i&gt;gwmi -computer servername -namespace root\sms\site_123 -class sms_package | % {if ($_.version -eq &amp;quot;&amp;quot;) {$_.packageid}} &lt;br /&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;This simple one-line command (watch word wrap!!) shows you a list of packages that don&amp;#39;t have a version.&amp;nbsp; Need to check manufacturer?&amp;nbsp; Just change the script a slight bit:&lt;/p&gt;&lt;p&gt;&lt;i&gt;gwmi -computer servername -namespace root\sms\site_123 -class sms_package | % {if ($_.manufacturer-eq &amp;quot;&amp;quot;) {$_.packageid}} &lt;/i&gt;&lt;/p&gt;&lt;p&gt;Simple, huh?&amp;nbsp; Now go hunt down the techs that created those packages and beat them around the head and neck.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Unused Packages:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Wait - why would you want to move packages that aren&amp;#39;t even being used?&amp;nbsp; Who would want to do that?&amp;nbsp; This script is a bit longer, but gives you a nice output of packages that aren&amp;#39;t used in advertisements, depenedent (run another program first) programs, or Task Sequences:&lt;/p&gt;&lt;p&gt;&lt;i&gt;$adverts = gwmi -computer &lt;/i&gt;&lt;i&gt;servername&lt;/i&gt;&lt;i&gt; -namespace root\sms\site_123 -class sms_advertisement | select-object packageid&lt;br /&gt;$packages = gwmi -computer &lt;/i&gt;&lt;i&gt;servername&lt;/i&gt;&lt;i&gt; -namespace root\sms\site_123 -class sms_package |select-object packageid&lt;br /&gt;$references = gwmi -computer &lt;/i&gt;&lt;i&gt;servername &lt;/i&gt;&lt;i&gt;-namespace root\sms\site_123 -class sms_tasksequencereferencesinfo |select-object referencepackageid&lt;br /&gt;$dependent = gwmi -computer &lt;/i&gt;&lt;i&gt;servername&lt;/i&gt;&lt;i&gt; -namespace root\sms\site_123 -query &amp;quot;select dependentprogram from sms_program where dependentprogram != &amp;#39;&amp;#39;&amp;quot; | select-object dependentprogram&lt;br /&gt;&lt;br /&gt;$packagelist = @()&lt;br /&gt;$adverts|%{$packagelist+=$_.packageid}&lt;br /&gt;$references|%{$packagelist+=$_.referencepackageid}&lt;br /&gt;$dependent|%{$packagelist+=$_.dependentprogram}&lt;br /&gt;&lt;br /&gt;Foreach ($package in $packages)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pkgid = $package.packageid&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!($packagelist -contains $pkgid))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {gwmi -computer servername -namespace root\sms\site_123 -query &amp;quot;select * from sms_package where packageid = &amp;#39;$pkgid&amp;#39;&amp;quot;| select-object packageid,manufacturer, name, version}&lt;br /&gt;} &lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;Great - now you can clean those up or just refuse to migrate them.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Validate Package Source:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So now you have a list of packages that are being used, they should have the right version numbers and other fields filled out - better validate your package source before you do any migrating, or this whole thing will come to a crashing halt!&lt;/p&gt;&lt;p&gt;&lt;i&gt;$packages = gwmi -computer servername -namespace root\sms\site_123 -class sms_package&lt;br /&gt;$packages | %{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($_.pkgsourcepath -ne &amp;quot;&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!(test-path $_.pkgsourcepath)) {$_|select-object manufacturer, name, version, packageid, pkgsourcepath}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/i&gt;&lt;/p&gt;&lt;p&gt;There is one caveot with this script - if you aren&amp;#39;t on the site server when you run this command, and if the package source is local (d:\packagesource) then the packages will show up in the invalid list.&amp;nbsp; Either run it from the primary server, or just understand that anything that shows a local path will need to be checked outside of this script.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Move package source:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Right - you have valid sources, packages with all of the appropriate fields...now what?&amp;nbsp; Well, if you are like us, you will probably be moving that package source to a new server when you stand up your new hierarchy.&amp;nbsp; Here is a simple script that will take your package list, move the source files from your old site, and place them in a new source location that is built around the information in the packages.&amp;nbsp; I.e. \\server\packagesource\manufacturer\packagename\version\&amp;lt;actual source files&amp;gt;.&lt;/p&gt;&lt;p&gt;&lt;i&gt;gwmi -computer servername -namespace root\sms\site_123 -class sms_package&amp;nbsp; | % {$pkgman = $_.manufacturer; $pkgname = $_.name; $pkgversion = $_.version; if (!(test-path c:\pub\temp\$pkgman\$pkgname\$pkgversion)) {mkdir c:\pub\temp\$pkgman\$pkgname\$pkgversion}; robocopy $_.pkgsourcepath d:\newpackagesource\$pkgman\$pkgname\$pkgversion /E /R:100 /NP /NFL /NDL}&lt;br /&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Find App Model Candidates:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Ok - So now you have your new source - let&amp;#39;s talk about finding App Model candidates for CM2012.&amp;nbsp; Obviously MSI packages are the easiest to place in app model - let&amp;#39;s find those real quick:&lt;/p&gt;&lt;p&gt;&lt;i&gt;gwmi -computer servername -namespace root\sms\site_123 -class sms_program | % {$prgname = $_.programname; $pkgid = $_.packageid; $commandline = $_.commandline; if ($commandline.contains(&amp;quot;msi&amp;quot;)) {gwmi -computer servername -namespace root\sms\site_123 -query &amp;quot;select manufacturer, name,version from sms_package where packageid = &amp;#39;$pkgid&amp;#39;&amp;quot;| select-object manufacturer, name, version}}&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Great!&amp;nbsp; A list of packages that will make excellent App Models in CM2012.&amp;nbsp; That will make Microsoft very happy.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;List Program Requirements:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;One last script around packages - let&amp;#39;s find out what the program requirements are on your existing packages.&amp;nbsp; It will be nice to have those documented then moving apps over.&amp;nbsp; Warning!&amp;nbsp; This can take a while to run!&lt;/p&gt;&lt;p&gt;&lt;i&gt;#Modify SiteServer value, and Namespace value for your environment.&lt;br /&gt;$SiteServer = &amp;quot;Servername&amp;quot;&lt;br /&gt;$NameSpace = &amp;quot;root\sms\site_123&amp;quot;&lt;br /&gt;&lt;br /&gt;#Get all Advertisements&lt;br /&gt;$adv = gwmi sms_advertisement -computer $SiteServer -namespace $NameSpace&lt;br /&gt;#Create an Array for all objects created...&lt;br /&gt;$allObjs = @()&lt;br /&gt;$adv | foreach {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myPackageID = $_.PackageID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myProgramName = $_.ProgramName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myAdvertName = $_.AdvertisementName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #grab the program for this advertisement&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $prg = gwmi sms_program -computer $SiteServer -namespace $NameSpace -filter &amp;quot;PackageID=&amp;#39;$myPackageID&amp;#39; and Programname=&amp;#39;$myProgramName&amp;#39;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #see if it&amp;#39;s configured to run on &amp;quot;Any Platform&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($prg.ProgramFlags -band 0x08000000) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #it is configured to run on &amp;quot;Any Platform&amp;quot; - create a new object, and add it to the array.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Obj = New-Object PSObject -Property @{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AdvertisementName = $myAdvertName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PackageID = $myPackageID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProgramName = $myProgramName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnyPlatform = $True&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Platform = $null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxVersion = $null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MinVersion = $null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = $null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $allObjs += $obj&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #have to use a wmi accelerator, because SupportedOperatingSystems is a lazy property&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $prg = [wmi] (gwmi sms_program -computer $SiteServer -namespace $NameSpace -filter &amp;quot;PackageID=&amp;#39;$myPackageID&amp;#39; and Programname=&amp;#39;$myProgramName&amp;#39;&amp;quot;).__Path&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $prg.SupportedOperatingSystems | foreach {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #create a new object for each supported OS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Obj = New-Object PSObject -Property @{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AdvertisementName = $myAdvertName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PackageID = $myPackageID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProgramName = $myProgramName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnyPlatform = $False&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Platform = $_.Platform&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxVersion = $_.MaxVersion&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MinVersion = $_.MinVersion&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = $_.Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $allObjs += $obj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;#select column order, sort, and display in gridview&lt;br /&gt;$allObjs | select AdvertisementName, PackageID, ProgramName, AnyPlatform, Platform, Name, MinVersion, MaxVersion | Sort-Object AnyPlatform, advertisementname | out-gridview&lt;br /&gt;#export to csv&lt;br /&gt;$allObjs | select AdvertisementName, PackageID, ProgramName, AnyPlatform, Platform, Name, MinVersion, MaxVersion | Sort-Object AnyPlatform, advertisementname | export-csv c:\temp\Platforminfo.csv -notypeinformation&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;This one is a bit longer - mostly because program requirements flag is a lazy WMI property (YUCK!).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;List Disabled Software Metering Rules:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Ok, let&amp;#39;s swtich gears.&amp;nbsp; How about we look at something else we don&amp;#39;t want to migrate....Disabled Software Metering Rules.&amp;nbsp; I mean, really - they were disabled for a reason, right? &lt;/p&gt;&lt;p&gt;&lt;i&gt;gwmi -computer servername -namespace root\sms\site_123 -class sms_meteredproductrule | % { if ($_.enabled -eq $FALSE) {$_.ProductName}}&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Quick, simple, and to the point.&amp;nbsp; You could even through some parentheses around that command and appeand a delete to automatically get rid of them.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=155937" width="1" height="1"&gt;</description></item><item><title>Dell Server Deployment Pack for ConfigMgr 1.2 Released</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2010/02/25/dell-server-deployment-pack-for-configmgr-1-2-released.aspx</link><pubDate>Thu, 25 Feb 2010 14:52:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:145166</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=145166</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2010/02/25/dell-server-deployment-pack-for-configmgr-1-2-released.aspx#comments</comments><description>&lt;p&gt;The DSDP 1.2 has been released, bringing support for ConfigMgr SP2!&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Download:&lt;br /&gt;&lt;a href="http://support.dell.com/support/downloads/download.aspx?c=us&amp;amp;l=en&amp;amp;s=gen&amp;amp;releaseid=R260665&amp;amp;SystemID=PWE_R710&amp;amp;servicetag=&amp;amp;os=WNET&amp;amp;osl=en&amp;amp;deviceid=19942&amp;amp;devlib=0&amp;amp;typecnt=0&amp;amp;vercnt=2&amp;amp;catid=-1&amp;amp;impid=-1&amp;amp;formatcnt=0&amp;amp;libid=36&amp;amp;typeid=-1&amp;amp;dateid=-1&amp;amp;formatid=-1&amp;amp;fileid=382477"&gt;http://support.dell.com/support/downloads/download.aspx?c=us&amp;amp;l=en&amp;amp;s=gen&amp;amp;releaseid=R260665&amp;amp;SystemID=PWE_R710&amp;amp;servicetag=&amp;amp;os=WNET&amp;amp;osl=en&amp;amp;deviceid=19942&amp;amp;devlib=0&amp;amp;typecnt=0&amp;amp;vercnt=2&amp;amp;catid=-1&amp;amp;impid=-1&amp;amp;formatcnt=0&amp;amp;libid=36&amp;amp;typeid=-1&amp;amp;dateid=-1&amp;amp;formatid=-1&amp;amp;fileid=382477&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;dell.com/configmgr&lt;/p&gt;&lt;p&gt;dell.com/systemcenter&lt;/p&gt;&lt;p&gt;delltechcenter.com&lt;br /&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=145166" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Dell/default.aspx">Dell</category></item><item><title>Check for open transactions on the ConfigMgr database</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/12/09/check-for-open-transactions-on-the-configmgr-database.aspx</link><pubDate>Wed, 09 Dec 2009 21:38:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:143666</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=143666</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/12/09/check-for-open-transactions-on-the-configmgr-database.aspx#comments</comments><description>&lt;p&gt;Open transactions - transactions that run too long or are hung - can cause havoc on the ConfigMgr database.&amp;nbsp; Notice a backlog of files (DDRs or Mifs)?&amp;nbsp; Slow processing in general?&amp;nbsp; Collections having a problem updating?&amp;nbsp; You might want to give this a quick check.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;First, lets find out what the oldest transaction on the ConfigMgr database is.&amp;nbsp; Open SQL Management Studio, and start a new query.&amp;nbsp; Change the focus to your SCCM database,and run this command first:&lt;/p&gt;&lt;p&gt;DBCC OPENTRAN &lt;/p&gt;&lt;p&gt;Did any transactions come back?&amp;nbsp; If so, check their start time and make sure they aren&amp;#39;t too long in the past.&amp;nbsp; Anything past a couple of minutes, except for the largest of queries, would be unacceptable.&amp;nbsp; Note the Process ID - we will use that next.&lt;/p&gt;&lt;p&gt;So now we know what the oldest transaction is, but what do we do with this info?&amp;nbsp; Let&amp;#39;s see what that transaction is doing.&amp;nbsp; Run this command next:&lt;/p&gt;&lt;p&gt;DBCC INPUTBUFFER(&amp;lt;processid&amp;gt;)&lt;/p&gt;&lt;p&gt;You will see a snippet of the code that the process is running.&amp;nbsp; Does this help track down what the open transaction is?&amp;nbsp; Perhaps a long-running query rule for a collection, or a site maintenance task that is hung.&amp;nbsp; Typically you can get a decent idea what it is by examine the output of Inputbuffer.&lt;/p&gt;&lt;p&gt;Now that you know what is causing the problem, how do you deal with it?&amp;nbsp; Well, if you are sure that you want to stop this transaction, you do it easily with one more command.&amp;nbsp; Use it with caution!&lt;/p&gt;&lt;p&gt;kill &amp;lt;processid&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note that if is sometimes helpful to do these same steps on the tempdb of the SQL server the ConfigMgr database sits on...especially for long running transactions.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=143666" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/SCCM/default.aspx">SCCM</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/SQL/default.aspx">SQL</category></item><item><title>Check how long ConfigMgr Site Maintenance Tasks run</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/12/08/check-how-long-configmgr-database-maintenance-tasks-run.aspx</link><pubDate>Tue, 08 Dec 2009 20:00:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:143617</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=143617</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/12/08/check-how-long-configmgr-database-maintenance-tasks-run.aspx#comments</comments><description>&lt;p&gt;Here is a quick and dirty SQL script that will list the site maintenance tasks and how long they ran last.&amp;nbsp; Run this in SQL Management Studio and target your ConfigMgr database.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select *,&lt;br /&gt;floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/3600) as Hours,&lt;br /&gt;floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/60)- floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/3600)*60 as Minutes,&lt;br /&gt;floor(DATEDIFF(ss,laststarttime,lastcompletiontime))- floor(DATEDIFF(ss,laststarttime,lastcompletiontime)/60)*60 as TotalSeconds&lt;br /&gt;from SQLTaskStatus&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=143617" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/SQL/default.aspx">SQL</category></item><item><title>Find packages not Nomad enabled via Powershell</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/11/19/find-packages-not-nomad-enabled-via-powershell.aspx</link><pubDate>Thu, 19 Nov 2009 14:47:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:143086</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=143086</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/11/19/find-packages-not-nomad-enabled-via-powershell.aspx#comments</comments><description>&lt;p&gt;Here is a quick little script that will search a site server for all packages (software dist, boot image, TS, Image, etc...) that don&amp;#39;t have Nomad enabled on them.&amp;nbsp; The script requires Powershell 2 (comes installed in Win7 and 2008R2 - otherwise get it from &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=e7d37355-8776-4ade-bdc8-e9fe915a228d"&gt;here&lt;/a&gt;).&amp;nbsp; The grid-view output shows package id, package class (image-package, boot-image, etc..), Mfg, Name, etc...&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Replace the Sitecode and SiteServer variables with the appropriate values for your infrastructure.&amp;nbsp; Depending on the number of packages, this script might take a minute or two to run.&amp;nbsp; Watch word-wrap!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;cls&lt;br /&gt;$Sitecode = &amp;quot;001&amp;quot;&lt;br /&gt;$SiteServer = &amp;quot;servername&amp;quot;&lt;br /&gt;$completed = @()&lt;br /&gt;(gwmi -Namespace root\sms\site_$sitecode -Class SMS_PackageBaseClass -ComputerName $siteserver | % {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj = New-Object psobject&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $package = $_;$pkgs = [wmi] $_.__Path&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (($pkgs.AlternateContentProviders|Out-String) -notlike &amp;quot;*nomad*&amp;quot;){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | add-member NoteProperty Class $package.__Class&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | add-member NoteProperty ID $package.PackageID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | add-member NoteProperty Name $package.Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | add-member NoteProperty Version $package.version&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | add-member NoteProperty Path $package.PkgSourcePath&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write-output $obj;$completed = $completed + $obj}} ) |Out-Null&lt;br /&gt;$completed | where-Object {$_.Class -notlike &amp;quot;*updates*&amp;quot; -and $_.class -notlike &amp;quot;*driver*&amp;quot;} | out-gridview &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=143086" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/1E/default.aspx">1E</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Nomad/default.aspx">Nomad</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Dell Win7 Driver Cabs Released!</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/11/03/dell-win7-driver-cabs-released.aspx</link><pubDate>Wed, 04 Nov 2009 05:34:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:142691</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=142691</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/11/03/dell-win7-driver-cabs-released.aspx#comments</comments><description>&lt;p&gt;The Windows 7 Dell driver cabs for currently shipping systems have been released!&lt;/p&gt;&lt;p&gt;They can be downloaded from here directly: &lt;a href="http://www.delltechcenter.com/page/Dell+Business+Client+Operating+System+Deployment+-+The+.CAB+Files"&gt;http://www.delltechcenter.com/page/Dell+Business+Client+Operating+System+Deployment+-+The+.CAB+Files&lt;/a&gt;&lt;/p&gt;&lt;p&gt;They can also be downloaded from &lt;a&gt;ftp://ftp.dell.com/sysman&lt;/a&gt; or from&lt;a href="http://support.dell.com/"&gt; http://support.dell.com&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;The cabs allow for easy import into ConfigMgr or MDT - simplifying driver management of those Dell systems.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Check them out and let us know what you think!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Big thanks go out to the Dell Product Group as well as Greg, Warren and Chris for putting a lot of work into getting these into production.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=142691" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Dell/default.aspx">Dell</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Driver/default.aspx">Driver</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Win7/default.aspx">Win7</category></item><item><title>Dell Remote Access Controller (DRAC) info in ConfigMgr</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/08/19/dell-remote-access-controller-drac-info-in-configmgr.aspx</link><pubDate>Wed, 19 Aug 2009 17:38:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:140824</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=140824</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/08/19/dell-remote-access-controller-drac-info-in-configmgr.aspx#comments</comments><description>&lt;p&gt;New page about getting sample DRAC information into ConfigMgr inventory!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.delltechcenter.com/page/Inventory+DRAC+IP+Information+Using+ConfigMgr"&gt;http://www.delltechcenter.com/page/Inventory+DRAC+IP+Information+Using+ConfigMgr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=140824" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Dell/default.aspx">Dell</category></item><item><title>Track System Discoveries per site</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/04/08/track-system-discoveries-per-site.aspx</link><pubDate>Wed, 08 Apr 2009 17:55:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:134056</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=134056</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/04/08/track-system-discoveries-per-site.aspx#comments</comments><description>&lt;p&gt;This is a handy little SQL statement we managed to whip up while working on a discovery problem.&amp;nbsp; This script will show you a count of Machine based discoveries (not user) per site and per discovery type.&amp;nbsp; Output will look something like this:&lt;/p&gt;
&lt;table cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Count&lt;/td&gt;
&lt;td&gt;Site Code&lt;/td&gt;
&lt;td&gt;Discovery Type&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1999&lt;/td&gt;
&lt;td&gt;001&lt;/td&gt;
&lt;td&gt;Heartbeat&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;001&lt;/td&gt;
&lt;td&gt;AD_System_Discovery&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3000&lt;/td&gt;
&lt;td&gt;002&lt;/td&gt;
&lt;td&gt;AD_System_Group&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Basically it will give you a much better chance of finding run-away discoveries in your infrastructure….discoveries that have been set too low or aren’t set frequently enough.&amp;nbsp; You can also narrow it down to a smaller collection, if you wish.&amp;nbsp; To do so, change the ‘SMS00001’ collection ID.&lt;/p&gt;
&lt;p&gt;The @variable is the number of days you want counts for.&amp;nbsp; Setting it to 30, for example, would show you the discovery counts from the last month.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;-----SCRIPT BELOW HERE-----&lt;/p&gt;
&lt;p&gt;declare @variable as int &lt;/p&gt;
&lt;p&gt;set @variable = &amp;#39;7&amp;#39; &lt;/p&gt;
&lt;p&gt;SELECT&amp;nbsp; count(agent.resourceid),fcm.SiteCode,Agent.AgentName &lt;br /&gt;FROM v_AgentDiscoveries Agent &lt;br /&gt;JOIN v_R_System SYS ON Agent.ResourceId = SYS.ResourceID &lt;br /&gt;JOIN v_FullCollectionMembership fcm on SYS.ResourceID=fcm.ResourceID &lt;br /&gt;WHERE @variable &amp;gt;= DateDiff(Day,Agent.AgentTime,GetDate()) and fcm.CollectionID = &amp;#39;SMS00001&amp;#39; &lt;br /&gt;GROUP BY Agent.AgentName,fcm.SiteCode &lt;br /&gt;ORDER By count (sys.resourceid) desc&lt;/p&gt;
&lt;p&gt;-----SCRIPT ABOVE HERE-----&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=134056" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/SQL/default.aspx">SQL</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/statistics/default.aspx">statistics</category></item><item><title>Central Texas Systems Management User Group meeting - March 27th</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/03/04/central-texas-systems-management-user-group-meeting-march-27th.aspx</link><pubDate>Thu, 05 Mar 2009 02:36:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:132101</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=132101</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/03/04/central-texas-systems-management-user-group-meeting-march-27th.aspx#comments</comments><description>&lt;p&gt;Mark your calendars!&amp;nbsp; The next CTSMUG meeting will occur at the Microsoft 
offices in Austin Texas on March 27th.&amp;nbsp; Our special guests this time will be 
none other than Quest software!&amp;nbsp; Come learn how Quest extends and enhances your 
System Center infrastructures.&amp;nbsp; The festivities will begin at 9:30am.&amp;nbsp; 
Registration and agenda to be sent out at a later date.&lt;/p&gt;&lt;blockquote&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Microsoft Offices:&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Stonebridge Plaza, Building One&lt;br /&gt;9606 N. Mopac Expressway, Suite 
200&lt;br /&gt;Austin, TX 78759&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=132101" width="1" height="1"&gt;</description></item><item><title>VBScript for Computer Association with logging</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/08/vbscript-for-computer-association-with-logging.aspx</link><pubDate>Thu, 08 Jan 2009 21:05:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:126958</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=126958</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/08/vbscript-for-computer-association-with-logging.aspx#comments</comments><description>&lt;p&gt;Here is a quick and dirty vbscript that will generate a computer associate between 2 resourceids, logging information to your systemdrive\ConfigMgrComputerAssociation.log.&amp;nbsp; &lt;/p&gt; &lt;p&gt;To use the script, call it with three arguments - script.vbs &amp;lt;sccmservername&amp;gt; &amp;lt;source-computer-resouceid&amp;gt; &amp;lt;destination-computer-resourceid&amp;gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;#39;******************Code Below Here****************&lt;/p&gt; &lt;p&gt;set colargs = wscript.arguments&lt;br /&gt;strSMSServer = colargs(0)&lt;br /&gt;strSourcePC = colargs(1)&lt;br /&gt;strDestinationPC = colargs(2)  &lt;/p&gt;&lt;p&gt;&amp;#39;Set Environment Variables&lt;br /&gt;Set oShell = CreateObject( &amp;quot;WScript.Shell&amp;quot; )&lt;br /&gt;systemdrive=oShell.ExpandEnvironmentStrings(&amp;quot;%systemdrive%&amp;quot;)&lt;br /&gt;computername = oshell.ExpandEnvironmentStrings(&amp;quot;%computername%&amp;quot;)  &lt;/p&gt;&lt;p&gt;&amp;#39;Create Output Log&lt;br /&gt;stroutputlog = systemdrive &amp;amp; &amp;quot;\ConfigMgrComputerAssociation.log&amp;quot;&lt;br /&gt;if objfso.fileexists(stroutputlog) then&lt;br /&gt;&amp;nbsp;&amp;nbsp; objfso.deletefile(stroutputlog)&lt;br /&gt;end if&lt;br /&gt;Set objFileoutput = objFSO.CreateTextFile(stroutputlog)&lt;br /&gt;log &amp;quot;Output log created.&amp;quot;  &lt;/p&gt;&lt;p&gt;&amp;#39;log the arguments&lt;br /&gt;log &amp;quot;Argument 1: &amp;quot; &amp;amp; colargs(0)&lt;br /&gt;log &amp;quot;Argument 2: &amp;quot; &amp;amp; colargs(1)&lt;br /&gt;log &amp;quot;Argument 3: &amp;quot; &amp;amp; colargs(2)  &lt;/p&gt;&lt;p&gt;&amp;#39;Setup Connection&lt;br /&gt;Set objLoc = CreateObject(&amp;quot;WbemScripting.SWbemLocator&amp;quot;)&lt;br /&gt;Set objSMS = objLoc.ConnectServer(strSMSServer, &amp;quot;root\sms&amp;quot;)&lt;br /&gt;Set Results = objSMS.ExecQuery ( &amp;quot;SELECT * From SMS_ProviderLocation WHERE ProviderForLocalSite = true&amp;quot; )&lt;br /&gt;For Each Loc In Results&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Loc.ProviderForLocalSite = True Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objSMS = objLoc.ConnectServer(Loc.Machine, &amp;quot;root\sms\site_&amp;quot; &amp;amp; Loc.SiteCode)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log &amp;quot;Connection established to &amp;quot; &amp;amp; strsmsserver &amp;amp; &amp;quot;.&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;Next  &lt;/p&gt;&lt;p&gt;&amp;#39;Create the Computer association&lt;br /&gt;associatecomputer objsms, strSourcePC, strDestinationPC  &lt;/p&gt;&lt;p&gt;log &amp;quot;Exiting Main Script Body&amp;quot;&lt;br /&gt;WScript.Quit  &lt;/p&gt;&lt;p&gt;Sub AssociateComputer(connection, referenceComputerResourceId, destinationComputerResourceId)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log &amp;quot;Starting AssociateComputer Subroutine&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim stateMigrationClass&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim inParams&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim outParams&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log &amp;quot;Connection: &amp;quot; &amp;amp; connection &amp;amp; &amp;quot; SourceID: &amp;quot; &amp;amp; referenceComputerResourceId &amp;amp; &amp;quot; DestinationID : &amp;quot; &amp;amp; destinationComputerResourceId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Get the state migration class.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set stateMigrationClass = connection.Get(&amp;quot;SMS_StateMigration&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Set up the parameters.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set inParams = stateMigrationClass.Methods_(&amp;quot;AddAssociation&amp;quot;).InParameters.SpawnInstance_&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inParams.SourceClientResourceID = referenceComputerResourceId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inParams.RestoreClientResourceID = destinationComputerResourceId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Call the method.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set outParams = connection.ExecMethod( &amp;quot;SMS_StateMigration&amp;quot;, &amp;quot;AddAssociation&amp;quot;, inParams)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log &amp;quot;Exiting Associate Computer Subroutine&amp;quot;&lt;br /&gt;End Sub  &lt;/p&gt;&lt;p&gt;SUB Log( message )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Log the given message&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objfileoutput.writeline(message)&lt;br /&gt;END SUB &lt;/p&gt;&lt;p&gt;&amp;#39;******************Code Above Here****************&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=126958" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/vbscript/default.aspx">vbscript</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Computer+Association/default.aspx">Computer Association</category></item><item><title>Transcript from DCCU chat on DellTechCenter (1/6/2009)</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/07/transcript-from-dccu-chat-on-delltechcenter-1-6-2009.aspx</link><pubDate>Wed, 07 Jan 2009 20:10:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:126772</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=126772</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/07/transcript-from-dccu-chat-on-delltechcenter-1-6-2009.aspx#comments</comments><description>&lt;p&gt;&lt;a title="http://www.delltechcenter.com/page/01-06-09+DCCU+3.0+%E2%80%93+Dell+Client+Configuration+Utility+3.0" href="http://www.delltechcenter.com/page/01-06-09+DCCU+3.0+%E2%80%93+Dell+Client+Configuration+Utility+3.0"&gt;http://www.delltechcenter.com/page/01-06-09+DCCU+3.0+%E2%80%93+Dell+Client+Configuration+Utility+3.0&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Dennis led the chat - and a good one it was!&amp;nbsp; Everything you wanted to know about the Client Configuration Utility.&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=126772" width="1" height="1"&gt;</description></item><item><title>List of default Task Sequence Variables</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/07/list-of-default-task-sequence-variables.aspx</link><pubDate>Wed, 07 Jan 2009 18:37:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:126741</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=126741</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/07/list-of-default-task-sequence-variables.aspx#comments</comments><description>&lt;p&gt;Here is a handy link to the Technet library page that contains all of the default Task Sequence Variables.&amp;nbsp; Bookmark this one to keep it handy!&lt;/p&gt; &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb632442.aspx" title="http://technet.microsoft.com/en-us/library/bb632442.aspx"&gt;http://technet.microsoft.com/en-us/library/bb632442.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;It has recently gone through an update, so most of the variables are no longer on the same page - but the links are on this page to take you to the specific sections.&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=126741" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/OSD/default.aspx">OSD</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/Task+Sequence/default.aspx">Task Sequence</category></item><item><title>Script Skeleton for ConfigMgr with Logging</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/05/script-skeleton-for-sccm-with-logging.aspx</link><pubDate>Mon, 05 Jan 2009 15:57:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:126416</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=126416</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2009/01/05/script-skeleton-for-sccm-with-logging.aspx#comments</comments><description>&lt;p&gt;If you are like me, you want a consistent look to your scripts, verbose yet readable output, and a quick connection to your SCCM server or client.&amp;nbsp; Here is a script framework that I use when developing new code.&amp;nbsp; Simply change the &lt;b&gt;SCCMServer&lt;/b&gt; variable, change the output log file name, and put your code after the comment &lt;i&gt;&amp;#39;Start the bulk of your code here&amp;quot;&lt;/i&gt;.&lt;/p&gt; &lt;p&gt;Now, whenever you want to write something to the output log, simply preface it with the keyword &lt;b&gt;&lt;i&gt;Log&lt;/i&gt;&lt;/b&gt;.&amp;nbsp; For example:&lt;/p&gt; &lt;p&gt;&lt;i&gt;Log &amp;quot;This is a sample line in the log file.&amp;nbsp; I can append variable names, such as the SCCMServer variable (&amp;quot; &amp;amp; SCCMSERVER &amp;amp; &amp;quot;) anywhere I want.&amp;quot;&lt;/i&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;********CODE BELOW HERE***********&lt;/p&gt; &lt;p&gt;&amp;#39;Creates an environment for the script to work&lt;br /&gt;Set wshshell = WScript.CreateObject(&amp;quot;WScript.Shell&amp;quot;)  &lt;/p&gt;&lt;p&gt;&amp;#39;Set File System Object&lt;br /&gt;set objFSO = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)  &lt;/p&gt;&lt;p&gt;&amp;#39;Set Environment Variables&lt;br /&gt;Set oShell = CreateObject( &amp;quot;WScript.Shell&amp;quot; )&lt;br /&gt;systemdrive=oShell.ExpandEnvironmentStrings(&amp;quot;%systemdrive%&amp;quot;)&lt;br /&gt;computername = oshell.ExpandEnvironmentStrings(&amp;quot;%computername%&amp;quot;)  &lt;/p&gt;&lt;p&gt;&amp;#39;Create Output Log&lt;br /&gt;stroutputlog = systemdrive &amp;amp; &amp;quot;\DefaultScript.log&amp;quot;&lt;br /&gt;if objfso.fileexists(stroutputlog) then&lt;br /&gt;&amp;nbsp;&amp;nbsp; objfso.deletefile(stroutputlog)&lt;br /&gt;end if&lt;br /&gt;Set objFileoutput = objFSO.CreateTextFile(stroutputlog)&lt;br /&gt;log &amp;quot;Output log created.&amp;quot;  &lt;/p&gt;&lt;p&gt;&amp;#39;Set the SCCM Server&lt;br /&gt;SCCMServer = &amp;quot;&amp;lt;YOURSERVERNAME&amp;gt;&amp;quot;  &lt;/p&gt;&lt;p&gt;&amp;#39; Setup a connection to the provider.&lt;br /&gt;Set swbemLocator = CreateObject(&amp;quot;WbemScripting.SWbemLocator&amp;quot;)&lt;br /&gt;Set swbemServices= swbemLocator.ConnectServer(SCCMServer, &amp;quot;root\sms&amp;quot;)&lt;br /&gt;Set providerLoc = swbemServices.InstancesOf(&amp;quot;SMS_ProviderLocation&amp;quot;)  &lt;/p&gt;&lt;p&gt;For Each Location In providerLoc&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If location.ProviderForLocalSite = True Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set swbemServices = swbemLocator.ConnectServer(Location.Machine, &amp;quot;root\sms\site_&amp;quot; + Location.SiteCode)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; siteCode = Location.SiteCode&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log sitecode&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;Next  &lt;/p&gt;&lt;p&gt;&amp;#39;Start the bulk of your code here&lt;br /&gt;Log &amp;quot;Bulk code execution begins now.&amp;quot;  &lt;/p&gt;&lt;p&gt;&amp;#39;All Done with the script - time to exit&lt;br /&gt;Log &amp;quot;Exiting Script&amp;quot;&lt;br /&gt;WScript.Quit  &lt;/p&gt;&lt;p&gt;SUB Log( message )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Log the given message&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objfileoutput.writeline(message)&lt;br /&gt;END SUB  &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;*********CODE ABOVE HERE*********&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Let me know if you have any questions or comments.&amp;nbsp; Enjoy!&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=126416" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/vbscript/default.aspx">vbscript</category></item><item><title>Updating Statistics in SQL (and why you need to do it)</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/18/updating-statistics-in-sql-and-why-you-need-to-do-it.aspx</link><pubDate>Thu, 18 Dec 2008 15:36:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:125558</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=125558</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/18/updating-statistics-in-sql-and-why-you-need-to-do-it.aspx#comments</comments><description>&lt;p&gt;SQL server uses statistics to keep track of values in an index, and determine when and how to use that particular index while processing a query.&amp;nbsp; This is a horribly simplified definition (because I barely understand it), but basically it means that statistics are a way for SQL to find the best index to use.&amp;nbsp; By default when you create a database in SQL 2005 (such as the ConfigMgr Database), the Auto Update Statistics option is turned on.&amp;nbsp; You can check it by opening SQL Management Studio, right click on the database, select properties, then select the Options.&lt;/p&gt; &lt;p&gt;Now that you know what they are, it&amp;#39;s important to know when to manually kick off an update to the statistics.&amp;nbsp; There are times when the key values in an index will change - especially in the ConfigMgr database.&amp;nbsp; Patch Tuesday, for example - there is a lot of new data flooding the ConfigMgr and WSUS databases as clients scan and report back patch status.&amp;nbsp; After large distributions also change a large amount of data in the indexes (status from distribution and advertisements).&amp;nbsp; &lt;/p&gt; &lt;p&gt;Auto-Update of Statistics will catch these changes, but there will be times when you want your queries to execute at their fastest without waiting for the system task to kick off.&amp;nbsp; There are also times when the system task will take a lower priority to other tasks, effectively keeping your statistics out of date.&amp;nbsp; When you need to update the stats on index manually, use the following command:&lt;/p&gt; &lt;p&gt;&lt;i&gt;UPDATE STATISTICS TABLENAME --replace Tablename with appropriate table&lt;/i&gt;&lt;/p&gt; &lt;p&gt;This works great on a single table, but who wants to do that for an entire database?&amp;nbsp; Use the built-in stored procedure to update all statistics on all indexes in your database.&amp;nbsp; Be aware that this can take some time, and if you don&amp;#39;t have Async Auto Update Statistics on, could cause queries to time-out while it&amp;#39;s running.&amp;nbsp; &lt;/p&gt;&lt;pre&gt;&lt;code&gt;/******Code Below Here******/&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;USE ConfigMgr --change to the name of your database&lt;br /&gt;EXEC sp_updatestats &lt;br /&gt;&lt;code&gt;/******Code Above Here******/&lt;/code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&amp;nbsp;&lt;/pre&gt;&lt;code&gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;
&lt;p&gt;&lt;code&gt;&lt;code&gt;We use this on a set schedule, every 12 hours, to keep our stats update to date, and avoid any priority problems with the auto-update process.&amp;nbsp; This does have an impact on indexes, so be sure you test accordingly.&amp;nbsp; &lt;br /&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you have any questions or comments, please feel free to contact!&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=125558" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/SQL/default.aspx">SQL</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/statistics/default.aspx">statistics</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/performance/default.aspx">performance</category></item><item><title>Rebuilding Indexes in ConfigMgr Databases</title><link>http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/17/rebuilding-indexes-in-configmgr-databases.aspx</link><pubDate>Wed, 17 Dec 2008 17:30:00 GMT</pubDate><guid isPermaLink="false">8e8f7986-475c-475d-bdc9-a1b3a63b955b:125400</guid><dc:creator>dtaylor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://myitforum.com/cs2/blogs/dtaylor/rsscomments.aspx?PostID=125400</wfw:commentRss><comments>http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/17/rebuilding-indexes-in-configmgr-databases.aspx#comments</comments><description>&lt;p&gt;If you suspect that you have fragmented SQL indexes in your ConfigMgr database (confirm those suspicions &lt;a href="http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/15/check-sql-index-fragmentation-on-the-configmgr-database.aspx"&gt;here&lt;/a&gt;), then what are your options?&amp;nbsp; You could wait for your &amp;quot;Rebuild Indexes&amp;quot; ConfigMgr maintenance task to come around again, or you could just go ahead and rebuild those indexes quickly from SQL Management Studio.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;If you want to rebuild all indexes in the ConfigMgr database, which is quite a lengthy and process consuming task, you can run this query.&amp;nbsp; Keep in mind that this is an intensive operation, so it&amp;#39;s best to do it off hours.&amp;nbsp; Expect it to take quite a while to complete.&lt;/p&gt; &lt;p&gt;/********************CODE BELOW HERE*************/ &lt;/p&gt;&lt;p&gt;USE SCCM --Enter the name of the database you want to reindex  &lt;/p&gt;&lt;p&gt;DECLARE @TableName varchar(255)  &lt;/p&gt;&lt;p&gt;DECLARE TableCursor CURSOR FOR &lt;br /&gt;SELECT table_name FROM information_schema.tables &lt;br /&gt;WHERE table_type = &amp;#39;base table&amp;#39;  &lt;/p&gt;&lt;p&gt;OPEN TableCursor  &lt;/p&gt;&lt;p&gt;FETCH NEXT FROM TableCursor INTO @TableName &lt;br /&gt;WHILE @@FETCH_STATUS = 0 &lt;br /&gt;BEGIN &lt;br /&gt;DBCC DBREINDEX(@TableName,&amp;#39; &amp;#39;,90) &lt;br /&gt;FETCH NEXT FROM TableCursor INTO @TableName &lt;br /&gt;END  &lt;/p&gt;&lt;p&gt;CLOSE TableCursor  &lt;/p&gt;&lt;p&gt;DEALLOCATE TableCursor  &lt;/p&gt;&lt;p&gt;/********************CODE ABOVE HERE*************/&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;But what if you just want to rebuild a single index?&amp;nbsp; First, you need to know the name of the index.&amp;nbsp; You can find that out a variety of ways, including just looking directly at the table in SQL Management Studio - there is a sub-folder per table for indexes.&amp;nbsp; You can also check out the instructions at the bottom of this page to find the name of the index (&lt;a href="http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/15/check-sql-index-fragmentation-on-the-configmgr-database.aspx" title="http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/15/check-sql-index-fragmentation-on-the-configmgr-database.aspx"&gt;http://myitforum.com/cs2/blogs/dtaylor/archive/2008/12/15/check-sql-index-fragmentation-on-the-configmgr-database.aspx&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Once you have the index name, you can run this quick statement to just rebuild that particular index:&lt;/p&gt; &lt;p&gt;/********************CODE BELOW HERE*************/&lt;/p&gt; &lt;p&gt;DBCC dbReindex(&amp;#39;INDEX_NAME_GOES_HERE&amp;#39;,&amp;#39; &amp;#39;,90)&lt;/p&gt; &lt;p&gt;/********************CODE ABOVE HERE*************/&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;BTW, the 90 in both queries is a fill factor.&amp;nbsp; Typically you won&amp;#39;t have to change that.&amp;nbsp; A useful tip page can be found here:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.mssqlcity.com/Tips/tipSrvSet.htm" title="http://www.mssqlcity.com/Tips/tipSrvSet.htm"&gt;http://www.mssqlcity.com/Tips/tipSrvSet.htm&lt;/a&gt;&lt;/p&gt;&lt;img src="http://myitforum.com/cs2/aggbug.aspx?PostID=125400" width="1" height="1"&gt;</description><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/ConfigMgr/default.aspx">ConfigMgr</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/SQL/default.aspx">SQL</category><category domain="http://myitforum.com/cs2/blogs/dtaylor/archive/tags/index/default.aspx">index</category></item></channel></rss>
