SharePoint Jokes

Since it hasn't been done yet, I thought I would create some funny jokes around SharePoint…enjoy:

What did one sharepoint site say to another sharepoint site? 
    Hey, aren't we called webs?

What did the end user say to the developer?
    Oh, I didn't create that column, I was smart, I just renamed the "title" column!

What did one sharepoint web developer say to the asp.net developer?
    Why me?

What did the production portal say to the author portal?
    I'm sorry, I can't seem to find your object!

What did the parent content type say to the child content type?
    I won't give you my jeans, but I'll buy you another pair just like them and we can share!

How many people does it take to create a web part?
    two, one to write the code, another to figure out the permissions problem in production!

How many times does it take to create a Shared Service Provider?
    3, one time to screw it up without knowing it, twice to do it because sharepoint won't do right the second time and
the third after you have blown away everything and started over!

What did the server admin say to the sharepoint web developer?
    Why can't we just do this with static html?

what did the sharepoint 2003 environment tell the sharepoint 2007 environment?
    Don't worry, reboot will still fix everything.

What did the sharepoint admin do to fix an "Unexpected Error has occured"
    Delete sharepoint and start again!

What did one w3wp process say to the other?
    Hey, can I borrow one of your SPSite's?  You have plenty!       

One day a user called the helpdesk, no one answered.  Being that he was in the helpdesk office he walked down and asked the admin why they weren't answering.
She simply stated, they quit when they heard we were implementing sharepoint!

A consultant was asked to build an estimate for a SharePoint two layer approval workflow with SharePoint Designer. 
The consultant never replied.  When asked "why", he simply stated, "Impossible".

SharePoint 14 features

There is a lot of speculation about the next version of SharePoint (I'd simply say that don't believe everything you read on the public blogs).  I have had several students in my classes over the past few weeks where the product team has given a nice preview of the things to come.  If you are really wanting to get a handle on the upcoming features (UI redesign using AJAX and new css styles, core changes, etc).  I'd suggest you get with your local SharePoint Evangelist and ask for a product team demonstration.  They ARE doing it, and if you have spent alot of money on SharePoint with Microsoft, you should definitely ask about and for a demo!

Although i can't say anything about a lot of the new features, I'm looking forward to building/refreshing the next version of courses to match the really awesome next version of SharePoint!

WCF – MessageSecurityException: The security timestamp is invalid because its creation time (‘2009-03-30T20:33:51.481Z’) is in the future.

What a crazy error.  I spent two hours on this today!  What ended up happening was that my machine ran it's Windows Time update and my web server did it's…they updated to be 15 minutes apart!  This caused my messages to stop working!  Man…wish the auth error had bubbled up the stack!  You have to add settings to the service side to get it to log the error, otherwise you will never know what is going on!  Reference this to see how to add the configuration value:

 <serviceSecurityAudit auditLogLocation="Application" serviceAuthorizationAuditLevel="Failure" messageAuthenticationAuditLevel="Failure" />

http://msdn.microsoft.com/en-us/library/ms731694.aspx

Chris

ACS Course Builder – Now Available on CodePlex!

This is the secret to how ACS can build courses so fast.  Now you can use the tool and take advantage of our WCF services layer to get our proprietary course building tools!  More tools will be added as the tool becomes more popular.  If you want a userid to gain access to the WCF layer, email me.  The test account will only work for so long…

http://coursebuilder.codeplex.com

Chris

Creating Security Descriptors for MOSS 2007 Managed Protocol Handlers

A few months ago I found this great blog by John Kozell at Microsoft.  He showed us how to build custom SharePoint Search extensions that I though was very innovative and included in my SharePoint 2007 Search Customization course.  Here is a link to the code that I modified to use the new .NET 3.0 classes.

http://blogs.msdn.com/johnkoz/archive/2009/03/05/creating-security-descriptors-for-moss-2007-managed-protocol-handlers.aspx

Enjoy!
Chris

Creating Folders/Users/Permissions Programtically

Set of code to do some cool things programatically…

 

SPSite site = new SPSite("http://sharepoint2007:100");
            site.AllowUnsafeUpdates = true;
            SPWeb web = site.RootWeb;
            web.AllowUnsafeUpdates = true;

            SPListTemplateCollection coll = web.ListTemplates;
            SPList newList = null;

            //create a list
            try
            {
                newList = web.Lists[web.Lists.Add("Assignments", "Student Assignments", coll[1])];
            }
            catch (Exception ex)
            {
                newList = web.Lists["Assignments"];
            }

            string[] users = {"training\administrator","training\student"};

            //iterate all the users (from database?)
            foreach (string s_user in users)
            {
                //add to site
                SPUser user = web.EnsureUser(s_user);                                                              
                string name = s_user;

                if ( user.LoginName.Contains("\"))
                    name = user.LoginName.Substring(user.LoginName.IndexOf("\") + 1);

                //create a folder for each user
                SPListItem folder = newList.Items.Add("", SPFileSystemObjectType.Folder,name);
                try
                {
                    folder.Update();
                    newList.Update();
                }
                catch (Exception ex)
                {                    
                }

                //set permissions            
                SPRoleDefinition RoleDefinitionRdr = web.RoleDefinitions.GetByType(SPRoleType.Administrator);
                SPRoleAssignment roleAssignment = new SPRoleAssignment((SPPrincipal)user);
                roleAssignment.RoleDefinitionBindings.Add(RoleDefinitionRdr);

                //adds permissions to site
                web.RoleAssignments.Add(roleAssignment);

                if (!folder.HasUniqueRoleAssignments)
                {
                    folder.BreakRoleInheritance(false);
                }

                while (folder.RoleAssignments.Count > 0)
                    folder.RoleAssignments.Remove(0);

                folder.RoleAssignments.Add(roleAssignment);
                folder.Update();
            }

Powershell script to backup My Sites!

This one rocks too!

 $ssppath = "http://sharepoint2007:100/personals"

$out = stsadm -o enumsites -url $ssppath
$out = [xml] $out

ForEach ($web in $out.Sites.Site )
{
$url = $web.url

$name = "c:" + $url.SubString($url.LastIndexOf("/")+1).replace(":","") + ".bak"

write-host "stsadm -o backup -url $url -filename $name -overwrite"
stsadm -o backup -url $url -filename $name -overwrite

}

Most Commonly Missed Best Practice with Internet Sites

Wanna know what it is?  It is a disaster waiting to happen!  

Some day an IIS 6.0 vulnerability will come out that allows you to get administrator access to the _vti_bin directory of your SharePoint site.  You will then be able to execute a call to the Lists web service and delete the "Pages" document library!  

To prove it, do a search on Pages/default.aspx in google.  You will get a listing on all the sites on the internet that are running sharepoint as their internet site.  Check their _vti_bin directory access by appending /_vti_bin/lists.asmx

 If you get the web service page for the list service, that company has setup there site WRONG!

The correct way of doing things is to create an extended web application that HAS the _vti_bin and the original with the _vti_bin DELETED!  The original is the internet accessable one and the extended one is accessible only by internal staff (so you can use SharePoint Designer and such).

Anyone feel like writing a vulnerability and the code to delete all the pages  document libraries on the internet to prove my point???  Couldn't be too hard 🙂

CJG

Powershell script to create Active Directory user Profiles and MySites

This is awesome…check it out!  A powershell script that will create a profile for every AD user, then creates there My Site!

 [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Portal")

$dom = "LDAP://CN=Users;DC=training;DC=corp"
$root = new-object DirectoryServices.DirectoryEntry $dom

$selector = new-object DirectoryServices.DirectorySearcher
$selector.SearchRoot = $root

$adobj = $selector.findall() | where {$_.properties.objectcategory -match "CN=Person"}
$spsite = new-object Microsoft.SharePoint.SPSite("http://sharepoint2007:100")
$context = [Microsoft.Office.Server.ServerContext]::GetContext($spsite)
$pmanager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

ForEach ($person in $adobj)
{
$prop = $person.properties
$prop.cn

$exists = $pmanager.UserExists($prop.cn)

if ($exists -eq $false)
{
$pmanager.CreateUserProfile($prop.cn)
}

$up = $pmanager.GetUserProfile($prop.cn)
$up.CreatePersonalSite()

}

 

Windows Workflow Foundation Course

Oh yeah, I'm writing it.  And I'll tell you…it's going to be awesome!  I'll post the outline later, but so far, it's looking really good! 

I'll also be posting a Powershell script to backup "My Sites" in the next couple of days!  I would have done it today, but I have had the flu!  Yuk!  Just now getting over it!

Hope everyone is doing great!
Chris