For whatever reason SharePoint teams sites tend to popup all over the network. Somehow marketing gets a server. Marketing then installs SharePoint on it themselves. Marketing becomes dependent on the data SharePoint houses. This usually underpowered and fault intolerant server crashes and burns. The data is lost. Orgnaization suffers.
This is just one senerio, but there are many reasons why you don’t want SharePoint weeds in your network. Licensing. The “What did you know and when did you know it factor” to name a few. @buckleyPlanet posted a microblog on twitter.
“Are there any community/3rd party replacements for the #SharePoint Asset Inventory Tool?” was the entire post that started me thinking about all that. At the time I had totally forgotten about this tool. Apparently it’s gone. I don’t know why, but the links I got to give me a 403. It could be misplaced or removed without notice. So I got to thinking about replacements for this thing.
All it did was tell you what servers were running SharePoint and how many sites and site collections there were on each server that it found. At least that’s what I think it did. Anyways my mind flooded with alternatives and started searching the web for more. THere are a few ways to do this, the one I actually tried out was using PowerShell. It took me about an hour to write:
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.Filter = '(OperatingSystem=Window*Server*)'
"Name","canonicalname","distinguishedname" | Foreach-Object {$null = $objSearcher.PropertiesToLoad.Add($_) }
$names = $objSearcher.FindAll() | Select-Object @{n='Name';e={$_.properties['name']}},@{n='ParentOU';e={$_.properties['distinguishedname'] -replace '^[^,]+,'}},@{n='CanonicalName';e={$_.properties['canonicalname']}},@{n='DN';e={$_.properties['distinguishedname']}}
$names | forEach-object{$_.name + "`n" + "=================="; get-wmiobject -computerName $_.name -class win32_product | where {$_.Name -eq "Microsoft SharePoint Server 2010 "}; "`n"; "`n"}
I say I wrote it. I copy and pasted my way to it. the first part I ripped off from http://social.technet.microsoft.com/Forums/eu/ITCG/thread/9d501454-2f51-43b5-8bea-303a1c9f2094 The second part I had from something I was doing earlier in the week.
This script isn’t awesome it just is.