Disable email notifications in SharePoint 2010

January 13th, 2011 2 comments

Out of the box in SharePoint 2010 all users who have a profile are also defaulted to having email notifications set to “on”.   This might make sense in a small scale implementation but for my customer that was unacceptable.  I created a powershell script that iterates through the user profiles and turns the notifications off.  This script is similar to ones I’ve posted before for working with the user profile however it uses different fields.  The SharePoint field is called SPS-EmailOptin. This field disables both SharePoint and NewsGator emails.

Of course in future releases these field names might change so you should verify before using this script.  In my case this was SharePoint 2010 October CU and NewsGator Social Sites 1.2.2419.

#Load the SharePoint snap-in
Add-PsSnapin Microsoft.SharePoint.PowerShell;

#Load the SharePoint assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server");
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles");

#Specify the MySite URL
$MySiteUrl = "http://sharepoint.vallery.net/";

#Get the server context for the profile manager
$site = Get-SPSite $MySiteUrl;
$ServerContext = Get-SPServiceContext $site;
$UPManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext);

#Count variables
$ucount = 0;

$enumProfiles = $UPManager.GetEnumerator();
"Total User Profiles available:" + $UPManager.Count
$count=0;

#Loop through the profile entries and update the property
#Recieve Instant Notifications - NGAllowMetaEmail (bool)
#24 Hour Digest Email - NGReceiveDigestEmail (bool)
#RSS NewsFeed Email - NGAllowRssEmail (bool)
#SharePoint Notification emails - SPS-EmailOptin (int)
#This field has 3 values one for each email type

foreach ($oUser in $enumProfiles)
{
    $count = $count + 1;
    $u = $oUser.Item("Accountname");
    Write-Output "($count):  Setting values for $u";

    $oUser["NGAllowMetaEmail"].Value = $false;
    $oUser["NGReceiveDigestEmail"].Value = $false;
    $oUser["NGAllowRssEmail"].Value = $false;
    $oUser["SPS-EmailOptin"].Value = 111; 

    $oUser.Commit();
} 

#Dispose of site object
$site.Dispose();

My 2010 travel statistics

January 7th, 2011 1 comment

Now that the year has drawn to a close I took a few minutes to tally up all of my nights away from home.  I was surprised to learn that I actually spent LESS time away than I initially would have assumed.  It certainly was a grueling year of back and forth across the country (and the world!).

After all was said and done I spent 38.63% of the nights last year away from home.  Here are the numbers as they break down by city visited:

Location Nights Away
Stockholm, Sweden 37
Rahway, NJ 33
Springfield, VA 32
Whitehouse Station, NJ 17
New York City 5
Wailea, HI 5
30,000 feet 3
Portland, OR 3
Toronto, Canada 2
Chicago, IL 1
Colorado Springs, CO 1
Newark, DE 1
Williamsburg, VA 1
Total 141
%age of year 38.63%
Categories: Travel Tags: ,

Enumerating user profile property fields in SharePoint 2010 with PowerShell

November 30th, 2010 No comments

I’ve been working quite a bit with SharePoint 2010 lately and have written a number of PowerShell scripts that I think will be useful to folks. This is the first of these.

This script connects to the User Profile managed service application and iterates through all of the properties that have been configured dumping the result to XML. The script additionally pulls in any mappings to active directory.

I’m currently working on a script that will import this XML and update the properties accordingly. I hope to post that soon as well.

#Define our configuration. This is the name you gave the import connection to AD
$url = "http://sharepoint.vallery.net/";
$connectionName = "Profile Sync";

#Setup our SharePoint objects
$site = Get-SPSite $url;
$serviceContext = Get-SPServiceContext($site);
$upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext);
$syncConnection = $upManager.ConnectionManager[$connectionName];

#This is a collection of mappings to AD that we will use later 
$pmc = $syncConnection.PropertyMapping;

#This is a collection of all of the properties which we will iterate
$properties = $upManager.GetProperties();

# Create a new XML writer settings object 
$settings = New-Object system.Xml.XmlWriterSettings;
$settings.Indent = $true;
$settings.OmitXmlDeclaration = $false;
$settings.NewLineOnAttributes = $true;

# Create a new string writer to capture the output 
$sw = new-object System.IO.StringWriter;

# Create a new XmlWriter 
$writer = [system.xml.XmlWriter]::Create($sw, $settings); 

#Start the document and add the root node
$writer.WriteStartDocument();
$writer.WriteStartElement("properties");

#Iterate through the properties
foreach ($item in $properties);
{

    #Create the property element
    $writer.WriteStartElement("property");

    #Add in the fields as attributes
    $writer.WriteAttributeString("Name", $item.Name);
    $writer.WriteAttributeString("DisplayName",$item.DisplayName);
    $writer.WriteAttributeString("ManagedPropertyName",$item.ManagedPropertyName);
    $writer.WriteAttributeString("Type",$item.Type);
    $writer.WriteAttributeString("ChoiceList",$item.ChoiceList);
    $writer.WriteAttributeString("Description",$item.Description);
    $writer.WriteAttributeString("URI",$item.URI);
    $writer.WriteAttributeString("IsSystem",$item.IsSystem);
    $writer.WriteAttributeString("AllowPolicyOverride",$item.AllowPolicyOverride);
    $writer.WriteAttributeString("IsUserEditable",$item.IsUserEditable);
    $writer.WriteAttributeString("IsAdminEditable",$item.IsAdminEditable);
    $writer.WriteAttributeString("IsImported",$item.IsImported);
    $writer.WriteAttributeString("Length",$item.Length);
    $writer.WriteAttributeString("IsMultivalued",$item.IsMultivalued);
    $writer.WriteAttributeString("ChoiceType",$item.ChoiceType);
    $writer.WriteAttributeString("DefaultPrivacy",$item.DefaultPrivacy);
    $writer.WriteAttributeString("UserOverridePrivacy",$item.UserOverridePrivacy);
    $writer.WriteAttributeString("IsReplicable",$item.IsReplicable);
    $writer.WriteAttributeString("PrivacyPolicy",$item.PrivacyPolicy);
    $writer.WriteAttributeString("DisplayOrder",$item.DisplayOrder);
    $writer.WriteAttributeString("IsColleagueEventLog",$item.IsColleagueEventLog);
    $writer.WriteAttributeString("IsAlias",$item.IsAlias);
    $writer.WriteAttributeString("IsSearchable",$item.IsSearchable);
    $writer.WriteAttributeString("IsUpgrade",$item.IsUpgrade);
    $writer.WriteAttributeString("IsUpgradePrivate",$item.IsUpgradePrivate);
    $writer.WriteAttributeString("IsVisibleOnEditor",$item.IsVisibleOnEditor);
    $writer.WriteAttributeString("IsVisibleOnViewer",$item.IsVisibleOnViewer);
    $writer.WriteAttributeString("IsTaxonomic",$item.IsTaxonomic);
    $writer.WriteAttributeString("Separator",$item.Separator);
    $writer.WriteAttributeString("MaximumShown",$item.MaximumShown);
    $writer.WriteAttributeString("IsSection",$item.IsSection);
    $writer.WriteAttributeString("IsRequired",$item.IsRequired);
    $writer.WriteAttributeString("SubtypeName",$item.SubtypeName);

    #Look up any AD mappings in the PropertyManagerCollection and include them
    $writer.WriteAttributeString("IsImport",$pmc.Item($item.Name).IsImport);
    $writer.WriteAttributeString("IsExport",$pmc.Item($item.Name).IsExport);
    $writer.WriteAttributeString("DataSourcePropertyName",$pmc.Item($item.Name).DataSourcePropertyName);
    $writer.WriteAttributeString("OriginalDataSourcePropertyName",$pmc.Item($item.Name).OriginalDataSourcePropertyName);
    $writer.WriteAttributeString("AssociationName",$pmc.Item($item.Name).AssociationName);
    $writer.WriteAttributeString("Connection",$pmc.Item($item.Name).Connection.DisplayName);
    $writer.WriteEndElement(); 

}

#Finish up
$writer.WriteEndElement();
$writer.WriteEndDocument();
$writer.Flush();
$writer.Close(); 

#Capture the output into a string
$result = $sw.ToString();

# Write the XML out
Write-Output $result;

And here is an example of the XML output:

Using PowerShell and the DirectorySearcher class

April 9th, 2010 No comments

I needed to locate the LDAP distinguished name of an individual user account in a remote domain via PowerShell.   Assuming your script is running on a box that is part of a domain that has a trust to the remote domain we can do this by running a query against Active Directory with LDAP.

By using the DirectorySearcher class we can build complex LDAP queries to find objects in Active Directory.   With this information you can do all kinds of fun scripting things.

Here is a sample script:



#Specify the search criteria
$samname = "jasonv"
$domain = "dev.lcl"

#Get a list of domains in the forest and grab the DN of the one matching the above parameter.
$forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$domain = $forest.Domains | ? {$_.Name -eq $domain}
$domainDN = $domain.GetDirectoryEntry().distinguishedName
Write-Output  "Found the remote domain, the full LDAP distinguished name is $DomainDN"

#Create an LDAP searcher object and pass in the DN of the domain we wish to query
$Searcher = New-Object System.DirectoryServices.DirectorySearcher([ADSI]"LDAP://$domainDN")

#Pass in the ceriteria we are searching for.
#In this case we're looking for users with a particular SAM name.
$Searcher.filter = "(&(objectCategory=person)(objectClass=user)(sAMAccountName= $samname))"
$results = $Searcher.Findall()

#Loop through the results
Foreach($result in $results){
    $User = $result.GetDirectoryEntry()
    $userDN =  $user.DistinguishedName
    Write-Output "Found a user matching with the distingused name of $userDN"
}

Why I don’t recycle paper

April 8th, 2010 No comments

I had a run in with a co-worker today who was upset that I hadn’t placed a couple sheets of paper in the recycling bin instead opting for the trash. I do this on purpose and I thought it would make an interesting blog post to explain why.image

The primary goal of recycling is to minimize the impact of our consumption on the environment. The basic argument however as to why we recycle usually goes along the lines that as humans we should recycle our consumables so that they can be used again without depending on a natural resource to replenish them. The thing that the vast majority of folks fail to realize is that in many circumstances that statement is either incorrect or actually in opposition of the goal behind recycling.

To dig a bit further we need to look at recycling on a case by case basis for the material in question. Typically recyclable materials are broken down into the following types:

Paper

The source of paper is wood which obviously comes from trees. Those trees are typically purpose grown to provide paper. There are large swaths of forest that were planted specifically by the various providers of wood in order to meet the demand we have on it. In this very real sense wood is not a natural resource it is actually a crop. There are more trees today in the United States than when the original settlers landed on this continent centuries ago. Why? Because we need them. It’s basic supply and demand economics in that as this country’s appetite for wood increased more trees were planted.

The cost, both monetarily and ecologically, associated with producing a recycled sheet of paper exceeds the cost of producing one from new wood. This is because for recycled paper you have additional steps in the production process. You must collect the recyclables, sort them, haul them to a processing facility, separate the paper from other debris and items, grind the paper into pulp, bleach it (using harmful chemicals), and then produce a sheet of paper. All of these extra steps use energy which today is delivered in the form of fossil fuels. The diesel that the truck to haul the recyclables burned, the coal to run the power plant which provided the electricity to process the paper, etc. With new paper there is of course still energy expended but several studies indicate that the amount used for a recycled piece of paper exceeds the amount needed for a new sheet of paper.

The other benefit you have of using new paper is that you’re planting trees. By consuming more paper you’re asking the paper manufactures to plant more trees on your behalf. During the 25-30 years that the tree spends maturing to be ready for harvest it is busy eating carbon dioxide and producing oxygen. If you subscribe to the greenhouse gas and global warming theories you’re now demonstrably reducing the carbon dioxide levels in the atmosphere by not recycling paper.

This is why I think, and a lot of other folks do as well, that you’re actually hurting the environment more be recycling paper. Throw it in the trash and we will grow more trees.

If you think I’m alone look for yourself

Plastic (biodegradable) –

These plastics were designed specifically to decompose quickly in sunlight and the soil. They can sometimes even be used in compost. Again, it makes much more sense to throw these in the trash than to recycle them if you’re not a composter. The trip to the landfill uses much less energy than the equivalent required to process this in a recycling facility.

Plastic (Non-biodegradable) –

Recycle these!!!!! Non-biodegradable plastic is the single item that the average consumer throws away which has the largest negative environmental impact. It can sit around in landfills for centuries. If it can be recycled into something useful (which in this case is often a reuse) that is the best possible outcome.

Glass –

I’m on the fence about glass. The information is inconclusive. Glass is obviously derived from a natural resource (silicon) that has a finite supply. If you’ve ever been to a beach though you’ll recognize that even though it is finite it is also nearly inexhaustible. I don’t have a strong opinion one way or the other and will reserve judgment until more concrete studies are done that look at the cost/benefit of recycling glass.

Aluminum –

You should certainly recycle aluminum as the source is primarily bauxite. Since bauxite is a mined natural resource we can significantly limit our dependency by recycling. This same reason is why you can actually sell your aluminum soda cans back for cash. It’s much more efficient to recycle than to mine new bauxite and produce aluminum.

Other metals –

It really depends on the metal but like aluminum the source was most certainly a mined mineral. I recommend recycling these items (soup cans, etc).

My impression of the iPad after 72 hours

April 6th, 2010 No comments

In follow-up to my earlier post I wanted to share my thoughts now that I’ve actually used my iPad during my day to day routine.

I’m still very pleased with the hardware.   The size is just about perfect for taking to a meeting or sitting on the couch.  I haven’t yet traveled with it but will have that opportunity next week.   I expect it to be great for use on the plane.

When using the Apple case I find that sitting the slightly raised iPad down on the table to be at the perfect angle for typing.

The battery life is great.   While I had my initial concerns about the inability to charge the iPad with anything but the included wall charger, that hasn’t proved to be as big of an issue as I expected.   In reality I haven’t dropped below 60% battery usage after 2 days of fairly heavy  usage.  I just plug it in the wall charger at night before I go to bed.   I still think they will need to address the issue but it’s not bothering me.

The browser is absolutely fantastic.    Aside from the obvious and unfortunate omission of flash support it is actually a really capable device for basic web surfing.   Initially I was concerned that there is no native Facebook application that leverages the capabilities of the iPad.     I’ve actually found using the full web version of Facebook to be great thanks to the screen real estate and the capabilities of Safari.   I would argue that thanks to the touch interface surfing the web might actually be better on the iPad compared to a traditional PC.

I really can see the potential to lower my dependency on my laptop for basic tasks.   In example, I’ve found it to be particularly useful for basic emailing and calendar activities.   Contrary to my iPhone it is actually pretty easy to type on, copy/paste, etc.   I don’t mind writing an email on my iPhone in a pinch but it’s not something I would do regularly.   With the iPad it’s actually a much more pleasurable experience.

I’ve also been enjoying a few additional applications:

 

kindle

Kindle for iPad – To correct my earlier post, it turns out there is a Kindle app for the iPad.   I’m happy to see this since I have a decent investment in ebooks from Amazon.  The UI is fine, but not as polished as Apple’s iBook.


evernote

Evernote for iPad  -  I’m already a big user of Evernote so the iPad version was very welcome.   I used this in meetings yesterday and today to take notes.   It’s great to sit the iPad down on a conference table to keep track of what is being discussed.   I think this use case has the potential to be the single greatest “killer app” to bring the iPad to the enterprise.

twitterific

Twitterific for iPad -   I had been using Tweetie 2 on my iPhone as of late for interaction with twitter.   Based on the great reviews of Twitterific for iPad I gave it a shot.    This is a much better UI for interacting with twitter, thanks to the additional screen real estate.  I’m hopeful that the folks behind Tweetie will come out with an iPad version because there are some features missing in Twitterific.   I particularly enjoy the location aware components of Tweetie including searching for “tweets near me” and the inclusion of google maps links when a tweet includes lat/lon information.

Categories: Reviews Tags: , , , ,

My first impression of the iPad

April 5th, 2010 1 comment

I’ve had the iPad now for 24 hours so I thought I’d write up my first impression.   I’m no longer the Apple fan boy that I once was.   I’m a bit more cynical about Apple these days so when I purchased my iPad I did it with eyes wide open.  I opted for the cheapest model available which is the 16GB version without 3G.

Out of the box the iPad feels very nice to hold.   It’s got a pleasant heft to it and feels very solid.  The weight feels very evenly distributed so it is easy to hold no matter what orientation.  Upon opening the box you’ll find the iPad, a standard iPod cable, and a wall charger.   There are no headphones included which was a bit of a disappointment for me.

The iPad came fully charged which was a nice touch, however in order to begin using it you must connect it to iTunes.   While Apple offered to do this in the store for me I declined and activated it when I got home.   This step seems a bit strange to me since there is no mobile phone service to activate.   I understand the rationale for the iPhone but I don’t see the need for the iPad.

After plugging the iPad into my computer for it to activate with iTunes the first thing that caught my attention is that in the upper right hand corner of the screen where the battery indicator is at said “Not charging”.   It turns out that there is an issue with the charging capability of the iPad currently and it can only be charged with a Mac computer or the included wall charger.   My Dell desktop apparently was insufficient to give this thing juice.   Curious, I took my iPad out to the car and plugged it in to see how it would behave in the car.   Sure enough, no charge love there either.    I expect this to be fairly inconvenient if not fixed soon.   I charge my phone almost exclusively at my desk and in the car.   I can get a sync and a charge at the same time this way.

I brought the iPad back inside and hooked it up to my PC again to let it sync with iTunes.  You have all the same sync capabilities as the iPhone so I won’t cover that in detail.   Given that I only purchased the 16GB version it filled up very fast.    The sync copied over most of my iPhone apps so my first experience  with 3rd party apps were the upscaled iPhone ones.

After the sync I opened up Facebook for iPhone to see how it worked.  It’s great that the iPad can use iPhone apps but in reality I can’t say that I would really want to.   For example take a look at this screenshot of Facebook scaled up to the “2x” mode.  As you can see the text becomes very grainy and it just looks plain awful.

IMG_0002

In comparison I downloaded the latest version of NetNewsWire from NewsGator which is an iPad native application and it looks simply stunning (notice the “Not Charging” in the upper right).

IMG_0004

There are a number of great apps similar to NetNewsWire that were available at lunch.   The much anticipated Netflix is probably my favorite.   I was able to stream a movie live from Netflix without any hiccups over my wifi.   It was a very enjoyable experience to watch a movie this way and I’m looking forward to using that extensively on my many work trips in the hotel.

I was a bit surprised that Apple has cut out some of the applications that ship with the iPad compared to the iPhone.   The stocks, weather, calculator, and voice memo applications are all suspiciously missing.

Purchasing content with the app store is just as easy on the iPhone.   The cost of applications seems to have gone up dramatically.   Many apps are looking at $9.99 price tags which seems a bit high to me.   I’m sure the market will adjust as both more applications and iPads are on the market.

Reading books via iBook is very pleasant.   I’m particularly impressed with the page turn effect.   I know it’s just eye candy but I still love it.  I previously owned a kindle so I’m hopeful that Amazon will release a kindle application (and that Apple doesn’t block it) similar to the one they have for iPhone.    I have a several titles I’ve already purchased in the Amazon store and I’d hate to not be able to access those on the iPad.

The last comment I’ll make is that 16GB is surprisingly little.  When I opted for the small version I didn’t really expect to load it down with media.   I expected that most of the time I would be using Pandora/Netflix for movies and music so storage wouldn’t be an issue.   It turns out many of the iPad applications are surprisingly large.   For example the “Real Racing HD” game comes in at a whopping 171 MB.

Categories: Reviews Tags: , ,

Using powershell to set SSP profile properties

April 1st, 2010 No comments

I recently put together a powershell script that can be used to update a profile property of all of the users stored in the SharePoint SSP.  At NewsGator we use a boolean property field to indicate if a particular part of our product has been activated or not.  There are some cases where this boolean flag needs to be reset for all users. To do this I put together a simple powershell script to reset this value for all users.

This could easily be adapted for other users so I thought I would post share it.

###########################
# "Configure Settings"
$SSPName = "SSPAdmin"
$MySiteUrl = "http://mysite/"
$propName = "newsgator-x-onboarded"
$propValue = "true"
###########################

#Load the SharePoint assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")

$ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($SSPName);
$UPManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext);
$enumProfiles = $UPManager.GetEnumerator();
"Total User Profiles available:" + $UPManager.Count
$count=0;

#Loop through the SSP entries and update the property
foreach ($oUser in $enumProfiles)
{
    $count = $count + 1;
    $u = $oUser.Item("Accountname");
    Write-Output "($count):  Setting '$propName' to '$propValue' for $u";
    $oUser[$propName].Value = $propValue;
    $oUser.Commit();
} 


Activating features in bulk on the MySite with PowerShell

April 1st, 2010 2 comments

I recently came across a client who needed to activate a couple of features on their MySites in batches.   Given that they have a significant number of MySites already created we needed to find a way to stage the deployment of the new functionality that the features offer.   I put together a PowerShell script that iterates through the SSP looking for users who:

  • Have a MySite
  • Either one of both of the required features are not currently active

For each of the users that match the above criteria both of the features are activated. A counter is incremented and once we reach the desired number of users for the batch the script exits. When we are ready to process another batch the script effectively picks up where it left off since we’re skipping the users who are already activated.

You could then have the execution of this script automatically executed on a regular basis during low utilization hours. Eventually everyone will have the features activated and the new functionality deployed. You could continue to let the script execute to catch any new users (if you decide not to staple the features like we are).

For others looking to do something similar I’m posting the original script in its entirety.


###########################
# "Configure Settings"
$SSPName = "SSPAdmin"
$mysiteurl = "http://mysite"
$ngsite_feature_id = "6a91335c-5ecc-4afc-aa68-14d73afbb1bc"
$webpart_feature_id = "5174F049-99D9-4d68-96E0-93AB2AE1C7BC"
$userCount = 500
$stsadm = "$env:programfiles\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE"
###########################

#Load the SharePoint Assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")

#Create the SSP objects
$ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($SSPName);
$UPManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext);

$enumProfiles = $UPManager.GetEnumerator();
"Total User Profiles available:" + $UPManager.Count
$count=0;

#Loop through every user who has an entry in the SSP
foreach ($oUser in $enumProfiles)
{
    #Get the username for the user
    $u = $oUser.Item("Accountname")

    #How many have we activated?  If more than $userCount above stop processing
    if ($count -ge $userCount) {
        Write-Output "Okay, we're stopping for now because we've activated for $userCount MySites"
        break
    } else {

    #Does the user have a MySite?  If so continue
    if ($oUser['PersonalSpace'].Value -ne $null) {
        #Create an SPSite (Site Collection) and SPWeb (Web) object for the given users MySite
        $siteurl = $mysiteurl + $oUser['PersonalSpace'].Value
        $spSite = new-object Microsoft.SharePoint.SPSite($siteurl)
        $spWeb = $spSite.OpenWeb() 

        #Let's check to see if either of the features we want to activate are currently activated.  
        #If not we should activate them.   Remember that the NewsGator Site Feature is "site" scoped thus we use SPWeb
        #The web part feature is Site Collection scoped so we have to use SPSite
        if (($spWeb.Features[$ngsite_feature_id] -eq $null) -or ($spSite.Features[$webpart_feature_id] -eq $null)) {

            #Execute STSADM -o activatefeature to activate the NewsGator Site Feature for this user, if it fails capture that and stop execution of the program.
            $sResult = &stsadm -o activatefeature -id $ngsite_feature_id -force -url  $siteurl
            if(!($sResult -like "*Operation completed successfully*")){
                Write-Host -ForegroundColor "red" -BackgroundColor "white" "Activate of site upgrade feature failed for $u on $siteurl : `n $sResult"
                break
            }

            #Execute STSADM -o activatefeature to activate the Webpart deployment feature, if it fails capture that and stop execution
            $sResult = &stsadm -o activatefeature -id $webpart_feature_id -force -url  $siteurl
            if(!($sResult -like "*Operation completed successfully*")){
                Write-Host -ForegroundColor "red" -BackgroundColor "white" "Activate of mysite web parts feature failed for $u on $siteurl : `n $sResult"
                break
            }

            #increment the count and output a status
            $count = $count + 1;
            Write-Output "($count):  Features activated on $siteurl for $u succesfully";
        } else {
            Write-Output "Skipping $siteurl for $u as they are already active."
        }
    } else {
        Write-Output "Skipping $siteurl for $u as they do not have a MySite."
    }

    #Clean up our objects to prevent a memory leak
    $spWeb.Dispose();
    $spSite.Dispose();
    $siteurl = $null;
    }
} 

My response to the new healthcare legislation

March 22nd, 2010 No comments

I wrote part of this blog article a few months ago when the healthcare bill was just starting to pick up steam. Now that it has passed I felt compelled to update it and post it in response to many of my very liberal friends rants.

Let’s define morality. Merriam-Webster has several definitions however I think the most appropriate one is “conformity to ideals of right human conduct”. The open questions out of that statement are of course who defines what is “right” and who gets to enforce it?

If my four year old son has a toy and another child does not, he knows that the right thing to do is share his toy. I don’t have to tell him. I don’t have to force him. Every action that I do sets an example for him in which he uses to build his own definition of “right”. If he refused to share, and I insisted that he did, my ownly recourse would be to force him on threat of punishment.

I honestly believe that the vast majority of people are good, caring, and compassionate. I believe that they have their own moral compass that guides them as to what is right and wrong. I believe that morality can never be forced as it is a part of who we are. While we can’t force someone to be moral by the definition of the majority, we can punish them for not agreeing. That is what is happening with healthcare and a great many other things in our country today.

I believe that most people would openly assist those in need in whatever way they can. Healthcare organizations have programs to assist those in need. Pharmaceutical companies have programs to get drugs to those that need them but can’t afford them. The statement I often hear is that “Nobody should go without the basic right of healthcare”. While that statement is partially true in that “Nobody should go without healthcare” it is not a right. A right is something granted to us as Americans by the bill of rights and our constitution. A right is something to be protected by the government, not given.

Like so many government programs they are yet again using their guns (by threat of jail) to force morality on the people. I find this particularly interesting in that my liberal friends are also very outspoken about the government staying out of their personal morality. Why is it okay for the government to force people to share their wealth with the less fortunate (an act which should be governed by an individual’s morality) but not okay for them to tell them how to live their lives? How can you possibly be for nationalized healthcare while also against the ban on gay marriage? How can you be for repeal of drug prohibition while supporting new social legislation?

The role of the government is to protect my rights as granted to me by the constitution and the bill of rights; it is not to tell me how I should live my life. If I want to share my wealth with those less fortunate that should be my decision. If I want to get married to another man that should be my decision. If I want to smoke marijuana that should be my decision. Unless my actions infringe on the rights of those around me in a truly free country the government has no authority to have a say about my actions. This new healthcare bill is just another way for the government to force us to the majority’s idea of what is “right”.

There are many folks out there who have not been courteous and respectful during the debate on healthcare. To anyone who used disrespectful, selfish, or hateful tactics to try and stop the passing of this legislation, I fully deplore your actions. However the partisan nature of the comments I see flying in rebuttal to those people are completely disrespectful and not helpful either. Just like you would never go around stereotyping all persons of a specific race or ethnicity, you should not stereotype all republicans and democrats.

While I am certainly not a republican, I am very offended by a couple specific tweets I’ve read from my more liberal friends.

A few examples:

“Let’s just say it: the most profound difference between Dems & Repubs = the former cares about those less fortunate; the latter does not”

“I truly wish that the small percentage of tea-baggers who can read at a 10th grade level would read this: http://bit.ly/bcTDj7”

“Hope americans are watching these old white gnarled hands of GOP hate try to keep health impoverished americans crushed and hopeless”

“Those on the other side of the aisle for whom it applies: Hope you have nightmares tonite about “socialized” medicine & the end of the world”

“”Party of no” spewing lies hate and fear. Any of these guys look like they are suffering from health care poverty?”

“Unbelievable listening to middle age white gop hate mongering men attack America in the people’s house.”

I don’t believe for one second that the members of congress who opposed this bill are also opposed to helping those in need. I believe that they understand that trying to legislate a solution to a problem as far reaching as healthcare would ultimately prove disastrous.

Assuming you can get past the argument of morality and think that the government should be implementing such a policy, we are ultimately left with the effectiveness of their solution. When has the government done anything better than a private organization? Why would they be able to manage healthcare better? The problem with our healthcare system is too much government intervention not too little.

Instead of adding more laws we should think about repealing some already on the books. If the healthcare system was deregulated and liability limited, doctors would be able to practice medicine without fear of getting sued. Insurance companies who offer malpractice insurance would be able to lower their premiums to the doctors. The ability to actually make a good living as a medical professional without the fear of going bankrupt at the slightest mistake would entice more of our brightest minds into the profession.

With the additional legislation just passed it is only going to be costlier for them to do business. Organizations which provide their employees premium coverage are now going to be taxed for doing so. With the increase in cost employers will compensate by reducing benefits to those “legally required”. The decrease in benefits means that there will be fewer people able to have access to cutting edge treatments and procedures. Fewer people with access will mean that the cost will stay prohibitively high or that the research dollars will not be spent to create them in the first place.

In the pharmaceutical realm deregulation would mean companies wouldn’t be afraid to spend larger amounts of money on R&D if they didn’t have to worry about getting sued all the time. They wouldn’t have to worry about their patent expiring and a generic hitting the market that completely undermined their research efforts and took away any chance they had at making a profit. They wouldn’t have to worry about paying out billions and billions of dollars in a class action lawsuit when a drug that hits the market doesn’t perform as expected or has undesired side effects. They would know that because there are folks who have “premium” coverage out there they can charge the amount required to recover their investment and know that there is a market for it.

We are free to choose what we put in our body based on the recommendations of a doctor we trust. Why do we need the FDA to tell us what is okay? Do you know there are drugs out there that could save the lives of millions of people but are blocked by FDA trials? Individuals need to take responsibility for their own action, and where the individual doesn’t have the knowledge to make the right decision, they need to turn to someone they can trust. Can you honestly tell me you trust the government more than your family doctor?

If all of the above happened and doctors, hospitals, and pharmaceutical companies were allowed to do what they do best, save people’s lives, healthcare prices would drop dramatically. It would become affordable to the vast majority of Americans. For the few that still were unable to afford it there are still private solutions and charities. It is not the government’s responsibility to provide for its people.

I have friends who are on Medicare/Medicaid (In full disclosure my Mom was before she passed away as well) and it drives me nuts how abused the system is. They have better coverage than I have and I consider the policy that my employer offers me to be very generous. When I see them take a sick child to the ER because of a fever it drives me insane. They didn’t pay a single cent but the taxpayer just paid through the nose when all they needed to do was ensure rest, liquids, and maybe a little Tylenol. Again, healthcare is not a right it’s a privilege.

When something is available without individual cost and consequence it will encourage abuse. A system which holds nobody accountable is one that will inevitably fail.