Little more than out of the box development

  • How to build your own custom action for SharePoint Designer 2007

    Workflows in SharePoint can be built using Visual Studio or SharePoint Designer. There are some advantages with doing it in Visual Studio and there are others with building it in SharePoint Designer. One of the biggest benefits in building a workflow in SharePoint Designer is that you do not need any coding skills to do it. You can let your information worker build the workflow that suits their business needs. There are of course also drawbacks with both methods. One of the drawbacks of building it in SharePoint Designer is that you are limited to use the actions that are available within the designer.

    If you want to use SharePoint Designer to build your workflow (and thereby letting your information workers create their own workflows without bothering you) but can't find an action that fills your needs, you can extend the functionality in SharePoint Designer by creating your own actions!

    This process is not very complicated and there is a lot of information out there, but when I tried this myself I had to compile the information from several different resources to get this to work.
    Those were:

    This is really good, even a movie explaining how to do most things:
    http://msdn.microsoft.com/en-us/library/bb629922.aspx

    SharePoint Designer team has a good post on getting hold of the information about the list item once you're in the workflow
    http://blogs.msdn.com/sharepointdesigner/archive/2007/09/30/getting-to-workflow-information.aspx

    This one explains how to get data from the list item that is associated with the workflow:
    http://blogs.microsoft.co.il/blogs/davidbi/archive/2008/07/21/How-to-get-the-context-item-in-workflow-activity-sharepoint.aspx

    And last but not least:
    http://blogs.msdn.com/sharepointdesigner/archive/2007/03/27/tip-clearing-the-spd-workflow-assembly-cache.aspx this one is about how to make SharePoint Designer refresh its assembly cache. Very important if you for instance fixed a bug in your code, this will make sure that your new and improved assembly is deployed.

    I also made a screen cast to show how it is done, you can find it here on Channel9: http://channel9.msdn.com/posts/BomBom/How-to-build-your-own-custom-action-for-SharePoint-Designer-2007/

  • BPOS – it’s ALIVE!!

    Inför lanseringen av BPOS som sker den 19:e mars så har vi numera öppnat vårt datacenter på Irland. Detta betyder att man nu för tiden inte behöver skaffa sig ett Live ID där man låtsas att bo i Beverly Hills 90210 utan kan köra med sitt vanliga svenska konto.

    Gå in här och börja testa: https://mocp.microsoftonline.com/

  • Create your own list in SharePoint from a template

    So I've tried to create a list from one of my own list templates that I saved. This should be a really simple task barely worthy of a blog post… Or so I thought.

    This is what I did:

    1. Create a new list
    2. Fill it with entries
    3. Save the list as a list template (gave it a really good name)

    Fired up Visual Studio and started to code (first attempt):

    using (SPSite sitecollection = new SPSite(http://moss))
    {
        using (SPWeb web = sitecollection.AllWebs["TestSite"])
       
    {
            SPListTemplateCollection listtempColl = web.ListTemplates;
            SPListTemplate listTemp = listtempColl["MyOwnSavedList"];
            web.Lists.Add("NewlyCreatedList","", listTemp);
            web.Update();
        }
    }

    Now this didn't work, turns out the web.ListTemplates doesn't return ALL ListTemplates…
    If you want to create a list from a template that you have saved yourself you have to fetch those templates using this code instead:

    using (SPSite sitecollection = new SPSite(http://moss))
    {
        using (SPWeb web = sitecollection.AllWebs["TestSite"]) 
        {
            SPListTemplateCollection listtempColl = sitecollection.GetCustomListTemplates(web);
            SPListTemplate listTemp = listtempColl["MyOwnSavedList"];
            web.Lists.Add("NewlyCreatedList","", listTemp);
            web.Update();
        }
    }

  • Working with Active Directory and PowerShell (part 2) – Creating a user

    To create a user in our Organizational Unit we need the following LDAP string:
    $LDAPStringUsers = "LDAP://OU=Demo Users, DC=contoso,DC=com"

    And run the following command to connect to AD:
    $usersOU = [ADSI] $LDAPStringUsers

    To create a user run this command:
    $newUser = $usersOU.Create("user","cn=Kalle Becker ")
    $newUser.Put("sAMAccountName", "Kalle")
    $newUser.SetInfo()

    We need a password for this user, and I actually found a command that will do this:
    $newUser.SetPassword("pass@word1")
    $newUser.SetInfo()

    With that done let's enable the account (the account is disabled from the beginning)
    $newUser.psbase.InvokeSet('AccountDisabled', $false)
    $newUser.SetInfo()

    So around here is where it gets tricky. I want to set a lot of properties for my user (not only password). I went to http://www.live.com and search for "PowerShell set first name ad user" and found out that the command looks like this:
    $newUser.psbase.InvokeSet('FirstName',"Kalle")
    Ok – I could have guessed that one. But how about setting the login name for the user?
    Login, LoginName? Nope, it's UserPrincipalName. Couldn't have guessed that!

    I found a page (sorry but I can't seem to find my way back to it, but it's on the net J) that taught me how to look up what the first parameter in InvokeSet should be. Here's how you do it:

    1. Get your hands on adsiedit, check this link: http://technet2.microsoft.com/WindowsServer/en/library/ebca3324-5427-471a-bc19-9aa1decd3d401033.mspx?mfr=true
    2. Install it (duh!)
    3. Run it, and connect to you AD
    4. Find you user and right-click properties.

    This will give you a looong list of stuff that you can set for this user.
    To find out which one to user, go into AD (Users and Computers), enter a value in one of the fields (like "aaaStockholm"), go back to ADSIEdit and try to find it in the list. Then you know the name of the Attribute! Take that name and use it with the InvokeSet command in PowerShell!

    Some of my users have a manager so here's a little treat on how to set that in PowerShell:
    $teststring = "CN="+$user.Organization.ManagerName+",OU=Demo Users,DC=contoso,DC=com"
    $newUser.psbase.InvokeSet('manager',$teststring)

    $teststring is the LDAP string for the manager.

  • Building your own MemberShipProvider in ASP.NET and use it in SharePoint

    The last screencast (I think) from me about Authentication in SharePoint. You can find it over at Channel9 here:

    http://channel9.msdn.com/posts/BomBom/Building-your-own-MemberShipProvider-in-ASPNET-20-and-use-it-in-SharePoint/

    In this screencast I build a MemberShipProvider that is checking the users against an XML file instead of a SQL database ("using virtually no code at all").
    I build it in ASP.NET 2.0, use it that site and then show you how easy it is to move it over to SharePoint.

    This webcast builds on the previous ones, 
    Forms Authentication with SharePoint (in English) and Authentication Provider .Net 2.0 Out Of The Box.

    Yeah, I know the code speaks for itself, but this time I made it in English anyway.

    Enjoy!

  • Working with Active Directory and PowerShell (part 1) - Creating an Organizational Unit

    Next on the agenda for building this demo environment was to create users in Active Directory.

    I can honestly say that I didn't have a clue on how to do this, so I went to http://www.live.com and found this site:
    http://thelazyadmin.com/blogs/thelazyadmin/archive/2007/05/14/create-an-ad-user-in-powershell.aspx
    I also found this site:
    http://powershelllive.com/blogs/lunch/archive/2007/04/05/day-7-manage-users.aspx

    That gave me some pointers on how to do this.
    Our domain is contoso.com, and I want to place the users in an Organizational Unit called "Demo Users".
    To connect to Active Directory we need an LDAP string. It would in this case look like this:
    "LDAP://localhost:389/ DC=contoso, DC=com" – localhost since the Active Directory is on this machine.
    The PowerShell command would be this:
    $domainObj = [ADSI] "LDAP://localhost:389/ DC=contoso, DC=com"

    Creating the group is this command:
    $domainGroup = $domainObj.Create("OrganizationalUnit","ou=Demo Users")

    $domainGroup.SetInfo()

    Run this command to check the result:
    $domainObj.psbase.Get_Children()

    distinguishedName
    -----------------
    {CN=Builtin,DC=contoso,DC=com}
    {CN=Computers,DC=contoso,DC=com}
    {OU=Demo Users,DC=contoso,DC=com}
    {OU=Domain Controllers,DC=contoso,DC=com}
    {CN=ForeignSecurityPrincipals,DC=contoso,DC=com}
    {CN=Infrastructure,DC=contoso,DC=com}
    {CN=LostAndFound,DC=contoso,DC=com}
    {CN=NTDS Quotas,DC=contoso,DC=com}
    {CN=Program Data,DC=contoso,DC=com}
    {OU=Service Users,DC=contoso,DC=com}
    {CN=System,DC=contoso,DC=com}
    {CN=Users,DC=contoso,DC=com}

  • Using PowerShell to read xml-files

    A couple of months ago a colleague and I decided to try to build a demo-environment for SharePoint. We wanted to be able to take a new fresh installed Windows 2003 (or 2008) server, and just run a PowerShell script and then the environment should be up and running. The environment should of course include sample data, sites, and last but not least a number of users.
    In order to do this we first had to learn PowerShell. Always fun to learn new things! This post is about how we use PowerShell to read the userdata from the xml-file.

    Step 1: Download PowerShell from here:
    PowerShell Download
    Step 2: install it.

    Lesson 1:
    The first thing I wanted to do was to execute a script that we've made ourselves.
    Here's the result:

    PS C:\Tmp> .\TestScript.ps1
    File C:\Tmp\TestScript.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
    At line:1 char:16
    + .\TestScript.ps1 <<<<

    Ok, that was clearly not the result I wanted! Fortunate for me, the error message actually says what I need to do.
    PS C:\Tmp> Get-Help about_signing

    That gave me a lot of information, mainly this:

    Set-ExecutionPolicy <policy-name>

    Next command to try:
    PS C:\Tmp> Set-ExecutionPolicy -ExecutionPolicy Unrestricted

    Voila! We can now run our scripts without signing them.

    Lesson 2:
    Read data from an XML-file.
    The XML-file that I'm going to read from has the following structure:
    <Users>
      <User>
        <Name>Kalle</Name>
     
    </User>
      <User>
        <Name>Becker</Name>
      </User>
    </Users>
    Reading data from an XML-file is really easy in PowerShell! Use this command to load the file into an variable:
    PS C:\Tmp> [xml]$userfile = Get-Content Accounts.xml

    When the xml-file is loaded you can type "$userfile.U" and press tab to get auto completion!! It's a breeze.

    Lesson 3:

    After that it's time to do a foreach-loop to write the name of the users on the screen:
    foreach( $user in $userfile.Users.User)

        Write-Host $user.Name
    }

    Our script file now looks like this:
    [xml]$userfile = Get-Content Accounts.xml

    foreach( $user in $userfile.Users.User)
    {
        write-host $user.Name
    }

    And when we execute it we get the following written on the screen:
    PS C:\Tmp> .\TestScript.ps1
    Kalle
    Becker
    PS C:\Tmp>

    Super easy!! Next time we're going to create AD-accounts for the users in the xml-file. Till then: Enjoy!

  • External Collaboration Toolkit for SharePoint

    Ok, so ECTS is pretty cool! I've been playing with it for about a week and I finally got it to work on a 2 server setup.

    Check this document out on how to install it:

    http://cid-db958fde27ac9f71.skydrive.live.com/self.aspx/Offentlig/ECTS%20Installation%20manual%20in%20pictures.docx

    The thing that made me crazy was the creation of a group in SharePoint called ECTSAdministrators. I didn't find that in any document instead a colleague of mine Mr. Srikanth from India help me out! Thanks a lot for that! Don't you just LOVE globalization?

    Good luck!

  • Microsoft Search Server 2008

    I onsdags så lanserade vi Microsoft Search Server 2008 i sverige. En fantastisk produkt med otroligt bra funktionalitet. Eventet i sig var väldigt trevligt, det är alltid roligt att stå framför en publik och visa upp det sänaste!

    För er som inte var där (och er som vad det) här hittar ni länkarna till nerladdning av Microsoft Search Server 2008 Express

    http://www.microsoft.com/enterprisesearch/serverproducts/searchserverexpress/download.aspx

    Bara ladda ner, installera och testa. På mindre än 30 minuter är du igång (nerladdningstiden är inte inräknad, sitter du på ett 28,8 modem så kommer det dröja längre än 30 minuter innan du är igång).

    Tjohoooo!

  • Publicera din kalender till folk som inte jobbar på ditt bolag.

    Ett problem som jag har brottats med under en ganska lång tid är att jag är så tankspridd. Detta leder till att jag glömmer att allt som oftast att berätta för min fru om olika kvällsaktiviteter som jag har planerat med kompisar / jobb / träning. Att komma kvällen innan och säga: "Imorgon ska jag…" är inte så poppis hemma hos mig (jag brukar i och för sig köra med fulingen: "… som jag sa till dig förra veckan…", men den kan man ju bara använda ett begränsat antal gånger). Lösningen borde ju vara någon slags gemensam/delad kalender.

    Idé nr 1: SharePoint. Jag har ju en WSS som ligger och tickar, jag kan SharePoint, hur svårt kan det vara att fixa detta med en integrering till Office 2007?

    "När ditt enda verktyg är en hammare ser alla dina problem ut som spikar"

    När jag berättade om detta för mina kompisar så sa dom: "Varför gör du det inte bara i Outlook 2007?"

    VA??

    Här kommer en guide som visar hur man kan göra för att dela ut sin kalender till någon annan på det världsomspännande datanätverket Internet. Båda bör ha Outlook 2007 för bästa upplevelse. Den som tar emot kalendern måste också ha ett LiveID (i dagligt tal ett messenger login).

    Steg 1:
    Klicka på "Publish My Calender…"
    Bild 1

    Steg 2:
    Klicka på "Advanced…"
    Bild 2
    Här kan du ändra vilket beteende som du vill att kalendern som du delar ut ska ha.
    Klick på "OK"

    Steg 3:
    Klicka på "OK" igen
    Bild 3

    Steg 4:
    Kalendern publiceras på Internet
    Bild 4

    Steg 5:
    Klicka på "Yes" för att bjuda in folk till din delade kalender

    Steg 6:
    Skriv in adressen (LiveID e-post adressen) till den personen som ska få se din kalender.
    Bild 6

    Steg 7:
    Klicka på "Send"

    Steg 8:
    Se det härliga resultatet!!
    Bild 7

    Nuförtiden hemma hos mig:

    "- Imorgon ska jag jobba sent."
    "- Det har du inte sagt något om."
    "- Du har ju min kalender…"

    SEGER J!!

    Alla referenser till min hustru är naturligtvis påhittade och/eller våldsamt överdrivna…

  • Visual Studio 2008

    Installed it, failed! Installed .net framework 3.5 by myself. Tried to install again, worked like a charm!
    Made a one button application, called a webservice. Green lights all the way. My test phase of Visual Studio is complete!

    Send your own feedback on the installation to the team: http://blogs.msdn.com/aaronru/archive/2007/11/30/looking-to-improve-the-visual-studio-user-experience.aspx

  • Forms Authentication with SharePoint

    I've published a new screencast on http://channel9.msdn.com/niners/bombom. It shows you how to use FormsAuthentication on a Windows SharePoint Services 3.0 site (WSS 3.0).
    It then continues with showing how to enable multiple authentication methods on one site (using Windows authentication and FormsAthentication simultaneous).

    Last but not least it shows how to create a page in SharePoint that let you administrate your users that uses FormsAuthentication (in this case how to create new users).

    As usual it's in Swedish, but you'll get the picture anyway.

    Oh, yeah. It starts where http://channel9.msdn.com/ShowPost.aspx?PostID=314283#314283 left off.

    Enjoy!

  • How to create a minimal.master for WSS

    So I was asked by a partner of mine to help them create a minimal.master page for WSS. No problems, I've done that lots of times, search on http://www.live.com on "minimal.master" and you'll find the process is well documented here: http://msdn2.microsoft.com/en-us/library/aa660698.aspx

    Or so I thought… Turns out that description is only valid for MOSS. Darn! Ok, a few searches later and I came up with these two pages:

    http://www.sharepointblogs.com/tigirry/archive/2007/07/03/custom-site-definition-with-custom-master-page-for-sharepoint-portal-server-2007-moss-2007-and-wss-3-0.aspx

    http://blogs.msdn.com/cjohnson/archive/2006/09/22/765352.aspx (the secret is in the comments)

    I LOVE THE INTERNET!!

  • Building a SharePoint workflow in Visual Studio part 2

    Ok, you've all seen my Screencast about how to deploy a workflow from Visual Studio to SharePoint (if not, you'll find it further down). This Screencast is the next step; it shows how to work with tasks in a workflow. Catch it here: http://channel9.msdn.com/ShowPost.aspx?PostID=324936

    I showed this on the SommarKollo last week, so if you where there you remember that I promised to make it available on the net. You have NO idea how much work this took! J I'll never make such a promise again…

    Enjoy!

  • Authentication Provider .net 2.0

    This screen cast (http://channel9.msdn.com/Showpost.aspx?postid=314283) shows you how to get the build in functionality in the Authentication Provider in .net 2.0 to work. This will let you build a webpage that requires login from the users without writing a single line of code.

    Why is this interesting for SharePoint? Because if you want to use FormsAuthentication in SharePoint this is the components you want to use!

More Posts Next page »

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker