2/07/2010

SharePoint: Prevent Accidental Overwrites when Uploading to a Library

This applies to both SharePoint 2007 and SharePoint 2010. The only difference is the page name, upload.aspx for SP 2007 and uploadex.aspx for SP 2010.

 

Problem… Users are uploading files and are accidentally overwriting existing files, or if versioning is enabled, accidentally adding a new version to the wrong file (one with the same name as the upload).

 

One possible solution would be to modify the upload.aspx page (uploadex.aspx in 2010) to change the default of the "Overwrite existing files" checkbox. This normally defaults to checked. (I tell people that "Overwrite existing files" is short for "Overwrite existing files and don't tell me that I'm about to destroy days of someone else's work")

        Click for full size

 

You will need access to the web servers…
The edit is simple, but you will be modifying a LAYOUTS page on the web server. This generally to avoided as it may get overwritten on the next service pack update, and the change must be part of your disaster recovery plan and these files are not backed up with the content databases.


That said... do the following at your own risk...

  1. On the web server (and this must be duplicated on each web server) drill down to the SharePoint 12 hive and find "12\TEMPLATE\LAYOUTS\upload.aspx".  (NOTE: for SharePoint 2010 edit uploadex.aspx)
     
  2. Play it safe and Right-click, Copy and Right-click Paste to make a backup!
  3. Open the file with Notepad. Search for "Overwritesingle" and just after that change "true" to "false"
        <asp:CheckBox id="OverwriteSingle" Checked="false" ...
     
  4. Search for "Overwritemultiple" and just after that change "true" to "false"
        <asp:CheckBox id="OverwriteMultiple" Checked="false" ...
  5. Save the file and go upload a file and see if it does what you want

This takes care of Upload and Upload Multiple.


Windows Explorer will prompt the user by default "This folder already contains a file named....", so that’s covered.

This edit will not impact email enabled libraries and overwrites or new versions are still possible.


One final note... the same checkbox is used for versioning and says "Add as a new version to existing files" instead of "Overwrite existing files". After the above edits if the user forgets to checkmark the box, they just get a "file exists" error.

 

 

.

2/03/2010

SharePoint 2010: What’s the same for Site Owners…

The following is for the November 09 Beta 2…

Most of the articles I see about SharePoint 2010 are about what’s new. To add some comfort for people who are considering upgrading from 2007 to 2010 I thought I would start to document what has not changed, or has only changed a little. So here is a list of things, features and screens that have not changed to much.

This is work in progress… please check back…

This list is for the Site Owners… (Dev list coming soon)

 

  • Site Actions, Site Settings
    • Although it looks completely different, very little has changed. Click the image below to see how the “old” maps to the “new”, and what is really new (circled in green).  Almost looks like they moved things around just to move things around! 
      Site Settings for a Team Site (i.e. non-publishing)  (Click for a bigger image) 
      image
                                       what a spider web!  but it shows that it’s still all there…
    • So what is new?
      • All People (just a new link, not a new item. Same as in 2007 by clicking People and Groups and then clicking All People.)
      • Themes – a new gallery of Themes (Themes can be uploaded, or downloaded. The files are ZIP files! Download one, rename it to .ZIP and see what is inside!)
      • Solutions – These are new “Sandboxed” solutions where can deploy custom code directly to a site collection instead physically to the server drives.
      • FAST – Microsoft’s other search (extra cost) technology.  If you do not have FAST installed you will just get: “Error: Access to this functionality requires FAST Search for SharePoint be installed.”
      • Content Type Publishing - (Lots of blog articles! HERE)
      • SharePoint Designer Settings – Let you limit site user access to features of… guess what…)
      • Visual Upgrade – SharePoint 2007 sites can be left with the 2007 look and feel and later be upgraded to the 2010 look and feel (and the Ribbon).
      • Help settings – Lets you exclude from Help features you may not have installed, like the Office Web Apps.
  • Site Actions, Create (2007) or More Options (2010)
    • There is a new user interface, but the old interface is still available at /_layouts/create.aspx. The new interface is a Silverlight widget that pops up over the Settings.aspx page. The old style interface will be displayed if the user’s browser does not have Silverlight installed. I still prefer the old style interface! Big icons do not make for a better experience.
       
    • For a table of lists and site templates see here
       
    • New list types?
      • Asset Library
      • External List
      • Status List
      • The “new” items in the Pages and Sites section are not new. They include a direct link to the Blog template and Content Page (the old Basic Page, but you have not choice of libraries, it is now always saved in SitePages). In Beta 2 both “Team Sites” and “Sites and Workspaces” both link to the old “Sites and Workspaces” page (but with slightly different URLs!).
         
    • The new user interface: (click for a bigger image) 
      image

    • The 2007 vs. 2010 Create pages (using the 2010 old style interface)
      New items circled.
      image_thumb[10]

    more to come as I get time…

  • 2/02/2010

    Silly Word 2007 Tricks - Lorem ipsum!

     

    Open a new document in Word 2007,

     

    type     =lorem(3,8)     and press enter...    Lorem ipsum!

     

    move to a blank line and type    =rand(10,5)    and press enter...     you are now a tech writer!

     

    again...     =rand.old(5,5)  and press enter…    and you are a typewriter tester!

     

     

    Now get back to work............

     

     

    and when you have some free time… click here…  http://en.wikipedia.org/wiki/Lorem_ipsum

    2/01/2010

    Cincinnati SharePoint User Group Meeting (February 2010)

     

    We have a new URL! http://www.CincinnatiSPUG.org
    (this still works:  http://cincyspug.securespsites.com )

     

    We have door prizes!  In addition to free pizza, we have a number of SharePoint books, mice, Windows 7 Ultimate, X-Box games and other goodies to give away!
    We will also have some discount codes from several major book publishers just for people who attend.

     

     

    February 2010 Meeting agenda

    Date: Feb. 4, 2010, Thursday

    Time: 6:00 – 8:15 pm.

    Where: Max Technical Training, 4900 Parkway Dr. #160 Mason, OH.

    Click on the link for directions http://www.maxtrain.com/directions/

    Agenda:

    • 6:00 – 6:30 - Socials and Networking - No Registration required

    • 6:30 – 6:35 - Introduction of Agenda and Speakers

    • 6:35 - 8:15 - SharePoint 2007 Best practices of Web part development
                   – Matt Tallman of RCM

    We will take a look at some known best practices for developing and deploying web parts within SharePoint environment. You will get armed with some valuable information that you may want to consider for your next web part development project. Learn how to develop web parts efficiently and how to separate UI logic from code, learn how to encapsulate web parts into features and deploy them easily to your SharePoint environment. 

     

    .

    SharePoint 2010: VHDs Now Available

     

    Update: Microsoft has released the RTM VHDs for 2010. See here: http://techtrainingnotes.blogspot.com/2010/05/sharepoint-2010-evaluation-vhd-download.html

     

     

     

     

    (2007 VPC/VHD info here: http://techtrainingnotes.blogspot.com/2008/01/sharepoint-vpcs.html)

     

    Updates:

     

    I have updated this article with more info about the Microsoft VHD download…

    • I have added some more info on the install process
    • I have added a list of what I “found” in the VHDs (password, software installed, etc)
    • I have documented some version and setup info (IPs etc)

     

    Download VHDs from Microsoft (below) or build your own…

    Step by step build using  VMWARE Workstation
    http://faizal-comeacross.blogspot.com/2009/11/step-by-step-sharepoint-server-2010.html

    Step by step build using  VirtualBox (http://www.virtualbox.org/ )
    http://www.ericharlan.com/Moss_SharePoint_2007_Blog/how-to-install-sharepoint-2010-guide-a166.html

    A good comparison of what others have done:
    http://www.sharepointjoel.com/Lists/Posts/Post.aspx?List=0cd1a63d%2D183c%2D4fc2%2D8320%2Dba5369008acb&ID=298


     

    SharePoint 2010 Beta VHDs now available

    Microsoft has released a two VHD set of images to help you evaluate just about everything in SharePoint 2010, including FAST search, Project Server 2010, Visual Studio 2010 and Office 2010.  “Everything” comes with a price… 13 GB of download!  And… these expand into 47 GB VHDs! 

    You will need Windows Server 2008 R2, 50 GB of disk, 8 GB of RAM and Hyper-V to run these.

    The description and instructions on the download page are formatted as two big paragraph with everything run together, so I have reformatted it here so you can see the cool stuff preinstalled for you.

     

    Download here:


    http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&displaylang=en

     

     

    (text from the link above… see the link for the latest info)

    Overview

    This download contains a two Virtual Machine set for evaluating and demonstrating Office 2010 and SharePoint 2010.

     

    Virtual machine “a” contains the following pre-configured software:

    1. Windows Server 2008 SP2 Standard Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS
    2. Microsoft SQL Server 2008 SP2 Enterprise Edition with Analysis, Notification, and Reporting Services
    3. Microsoft Office Communication Server 2007 R2
    4. Visual Studio 2010 Beta 2 Ultimate Edition
    5. Microsoft SharePoint Server 2010 Enterprise Edition Beta 2
    6. Microsoft Office Web Applications Beta 2
    7. FAST Search for SharePoint 2010 Beta 2
    8. Microsoft Project Server 2010 Beta 2
    9. Microsoft Office 2010 Beta 2 10. Microsoft Office Communicator 2007 R2

     

    Virtual machine “b” contains the following pre-configured software:

    1. Windows Server 2008 R2 Standard Evaluation Edition x64, joined to the “CONTOSO.COM” domain
    2. Microsoft Exchange Server 2010 Active directory has been preconfigured over 200 “demo” users with metadata in an organizational structure. All of these user profiles have been imported and indexed for search within SharePoint Server 2010, with “contoso\administrator” granted administrator permissions.

    SharePoint Server 2010 has been configured in a “Complete” farm using Kerberos authentication and the default SQL Server 2008 instance for data, and has a site collection created using the Team Site template at http://intranet.contoso.com/ and a FAST Search Center at http://intranet.contoso.com/search/.

     

    Performance Considerations

    1. If possible, unpack and run the VM image on a separate, fast hard drive (7200 RPM or better) from the operating system of the host machine. If this is being done on a laptop, a second internal drive or external eSATA drive works best, though USB 2.0 (make sure it's 2.0, 1.1 is too slow) or Firewire is acceptable. For absolute best performance use a second internal SSD drive.

     

    Install

     

    Note: The instructions on the download page are not quite complete and I have learned a few things with multiple installs…  I have added comments in red…

    Note: If you choose to create a new virtual machine instead of importing the exact configuration then be careful about what the “virtual hardware” looks like or you will have to reauthenticate Windows (and you don’t know the key!”.  In a nutshell:  both machines: a virtual LAN named “internal”, two virtual CPUs and 5 GB for the “a” machine and 1 GB for the “b” machine.

    Instructions:

    You will need: Windows Server 2008 R2 with Hyper-V and at least 8 GB of RAM

    Extract the files by double-clicking the EXEs from the download. (I created a folder name “C:\SP2010Demo\” and under the files creating  “C:\SP2010Demo\Ext 2010-4a” and “C:\SP2010Demo\Ext 2010-4b”

    1. Start Hyper-V Manager from Control Panel -> Administrative Tools
    2. Confirm that the local host machine appears in the Hyper-V Manager list and select it if not already done
    3. Under Actions, click Virtual Network Manager…
    4. Confirm that you have created an Internal virtual network named “Internal”. (Only use the name “Internal”! Any other name and the import “will succeed with errors” and you will need to reconnect the virtual network and reconfigure the IP4 settings – see notes below for correct IP addresses to use) Internal networks limit connectivity to only VMs and the host. If a suitable not, create one now using the following steps:
      1. Click on Virtual Network Manager in the Actions pane
      2. Choose New virtual network in the Virtual Networks pane
      3. Choose Internal from the type list and click Add
      4. Enter a name of Internal and click OK
      5. On the local server, not a virtual machines, click Start menu -> right-click Network –> Properties
      6. Click Change adapter settings
      7. Find the adapter with a description of Internal, right-click and choose Properties
      8. Double-click on Internet Protocol Version 4 and enter the following values:
        1. IP address: 192.168.150.6
        2. Subnet mask: 255.255.255.0
        3. Default gateway: (leave blank)
        4. Preferred DNS server: 192.168.150.1
      9. Click OK
    5. Close the Virtual Network Manager dialog.
      1. Under Actions, click Import Virtual Machine…
      2. Use the Browse button to select the folder where the virtual machine package was extracted. Do not check “Duplicate all files”
        They did not mention to select “Copy” or “Move”. I used “Move” and had no problems".
      3. Click Import and wait for the Import to complete – the import status will appear in the Operations column
      4. Select the newly imported virtual machine and click Settings in the right pane of the Hyper-V Manager
      5. Confirm (and correct if necessary) that the Network Adapter is connected to the Internal network from step 1d.
      6. Also review the memory settings and adjust if needed for your machine. Don’t change the number of virtual CPUs as this invalidated the “authorized install”…
    6. Close the virtual machine Settings dialog.
    7. Start the Ext 2010-4a machine first as it is the domain controller (and just about everything else except for Exchange)
    8. After a short while you will be asked to restart the virtual machines “to apply changes”.

     

    What I found in the VHDs…

    • The password is pass@word1
    • The screen resolution is set at 1024 x 768
    • RAM is set to 5 GB for the “a” machine and 1 GB for the “b” machine
       
       
    • VHDs:

    VHD: Ext 2010-4a

    Computer name: demo2010a
    Full computer name: demo2010a.contoso.com
    Computer description: <blank>
    Domain: contoso.com

    Windows Server 2008 R2 Standard

    Password:  pass@word1

    Primary roles:
      SharePoint Server   14.0.4514.1009 (and some 14.0.4536.1000)
      FAST server
      Active Directory
      DNS

    Required IP address: 192.168.150.1

    VHD: Ext 2010-4b

    Computer name: demo2010b
    Full computer name: demo2010b.contoso.com
    Computer description: Exchange Server 2010
    Domain: contoso.com

    Windows Server 2008 R2 Standard

    Password:  pass@word1

    Primary roles:
      Exchange Server

    Required IP address: 192.168.150.2

     

    • Software installed:

    VHD: Ext 2010-4a

    Microsoft Office Communicator (and Office Communicator Server)
     
    Microsoft FAST Search Server for SharePoint 2010
     
    Microsoft Office
      Microsoft Access 2010 (Beta)
      Microsoft Excel 2010 (Beta)
      Microsoft InfoPath Designer 2010 (Beta)
      Microsoft InfoPath Filler 2010 (Beta)
      Microsoft Office 2010 Tools
      Microsoft OneNote 2010 (Beta)
      Microsoft Outlook 2010 (Beta)
      Microsoft PowerPoint 2010 (Beta)
      Microsoft Project 2010 (Beta)
      Microsoft Publisher 2010 (Beta)
      Microsoft SharePoint Designer 2010 (Beta)
      Microsoft SharePoint Workspace 2010 (Beta)
      Microsoft Visio 2010 (Beta)
      Microsoft Word 2010 (Beta)
     
    Microsoft Office 2010 Developer Resources
      Microsoft Visio 2010 SDK
     
    Microsoft SharePoint 2010 Products
      SharePoint 2010 Central Administration
      SharePoint 2010 Management Shell
      SharePoint 2010 Products Configuration Wizard
     
    Microsoft Silverlight 3 SDK
     
    Microsoft SQL Server 2005
      Microsoft Visio 2010 SDK
     
    Microsoft SQL Server 2008
      Analysis Services
      Configuration Tools
      Documentation and Tutorials
      Import and Export Data (32-bit)
      Import and Export Data (64-bit)
      Integration Services
      Performance Tools
      SQL Server Business Intelligence Development Studio
      SQL Server Management Studio
     
    Microsoft Sync Framework
      Microsoft Sync Framework Documentation
     
    Microsoft Visual Studio 2008
      Microsoft Visual Studio 2008 Documentation
      Microsoft Visual Studio 2008
      Visual Studio Tools
     
    Microsoft Visual Studio 2010
      Microsoft Test and Lab Manager
      Microsoft Visual Studio 2010 - ENU
      Microsoft Visual Studio 2010 Documentation
      Microsoft Windows SDK Tools
      Team Foundation Server Tools
      Visual Studio Tools
     
    SharePoint 2010 All Up Demo
     
    Windows PowerShell 1.0
      (empty)
     
    Windows PowerShell V2 (CTP3)
      Getting Started
      Quick Reference
      Release Notes
      User Guide
      Windows PowerShell ISE (CTP3)
      Windows PowerShell ISE (X86)(CTP3)
      Windows PowerShell V2 (CTP3)
      Windows PowerShell V2 (X86)(CTP3)

    1/31/2010

    SharePoint: Using JavaScript in a Feature CustomAction

     

    You can add to most of SharePoint’s menus by creating a Feature to define a CustomAction. When using CustomAction you need to supply a <UrlAction> element with the URL of the page to redirect to. When you replace the URL with JavaScript some weird things happen:

     

    If you have:
        <UrlAction Url="javascript:alert('hello')"/>
    SharePoint renders it as:
        onMenuClick="window.location = 'javascript:alert(\'hello\')';"
    This works just fine as Alert returns null.

    If you have JavaScript that sets a value (=) then the JavaScript returns the result and the <A> tries to redirect to that result:  (This example sets the URL to an <IFRAME> to a page in LAYOUTS)
        <UrlAction Url="javascript:document.getElementById('getthetime').src
                                           = 'http://yoursite/_layouts/CurrentTime.aspx'"/>
    SharePoint again renders it as "window.location=" and clicking the link redirects to a blank page with the SRC value displayed.

     

    The trick it to make sure your JavaScript code returns NULL, so wrap your code in VOID()
          <UrlAction Url="javascript:void(document.getElementById('getthetime').src
                                           = 'http://yoursite/_layouts/CurrentTime.aspx')"/>
    The JavaScript now runs and there is no page redirect.

     

    In general:

           <UrlAction Url="javascript:void(your javascript code)"/>

     

     

    Here’s an example feature:

    Assuming that you have a page in LAYOUTS named CurrentTime.aspx you want to load into an <IFRAME> with an ID of “getthetime)…

    feature.xml file:

    <?xml version="1.0" encoding="utf-8"?>
    <Feature  Id="9fa44e31-b703-4094-ad7c-2f3d9eac6f64"
              Title="MenuWithJS"
              Description="Demo of using JavaScript in a Custom Action"
              Version="1.0.0.0"
              Hidden="FALSE"
              Scope="Web"
              xmlns="http://schemas.microsoft.com/sharepoint/">
      <ElementManifests>
        <ElementManifest Location="elements.xml"/>    
      </ElementManifests>
    </Feature>

     

    elements.xml file: (this example adds the new menu choice to the Site Actions menu)

    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <!-- Add the action to the Site Actions Menu Dropdown -->
      <CustomAction Id="JSdemo"
        GroupId="SiteActions"
        Location="Microsoft.SharePoint.StandardMenu"
        Sequence="1000"
        Title="JavaScript Test">
        <UrlAction Url="javascript:void(document.getElementById('getthetime').src = 'http://maxsp2007/sites/training/_layouts/CurrentTime.aspx')"/>
      </CustomAction>
    </Elements>

     

     

    Note: only tested in Internet Explorer…

    1/30/2010

    SharePoint: SafeControl Generator

     

    Is your new web part not showing up in the SharePoint Web Part Gallery, New Web Parts page (NewDwp.aspx)?  It seems the number one problem for new (and experienced) SharePoint web part developers is getting the <SafeControl> element of the web.config file right. (especially for VB developers… see here). So here is a little console application that will read the namespace and class information from your assembly and give back a properly formatted <SafeControl> element.

     

    Here is a typical SafeControl entry:

       1: <SafeControl 
       2:   Assembly="VBWebPart, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e7bc14c6318d16e3" 
       3:   Namespace="MaxTrain.Demo" 
       4:   TypeName="VBWebPart" 
       5:   Safe="True" />

     

    Notes:

    2: Assembly: If the assembly is signed, then this is the four part name. This can be determined with the code below, or if you have deployed the assembly to the GAC, from the data displayed in the GAC (and a dozen other tools)

    3: Namespace: For C# the namespace you supplied in your code:     namespace MyNamespace {}
                                 For VB the name space in Project Properties plus the namespace you supplied in code

    4: TypeName: Either the name of your class, or “*” for all classes in your assembly

    5: Safe:  always True if you want the web part to work!

     

    To create your own SafeControl element creator:

    Create a new C# console application and name it something like SafeControlGenerator (no additional references needed). Copy and paste the following, build and test!

     

    Usage:

       C:\>  SafeControlGenerator.exe pathtoyourassembly

    I.e.

       C:\>  SafeControlGenerator.exe C:\Webparts\ClassLibrary1\bin\Debug\MyWebPart.dll

     

    using System;
    using System.Reflection;
     
    namespace SafeControlGenerator
    {
        class Program
        {
            static void Main(string[] args)
            {
                if (args.Length != 1)
                {
                    Console.WriteLine("Format:  SafeControlGenerator  pathToDll");
                    return;
                }
     
                string assemblyPath = args[0];
                Assembly a = Assembly.LoadFrom(assemblyPath);
     
                string fullname = a.FullName;
                if (fullname.Contains("PublicKeyToken=null")) 
                    fullname = a.GetName().Name;
                
                //Console.WriteLine("Fullname:");
                //Console.WriteLine(fullname);
                //Console.WriteLine();
     
                foreach (Type t in a.GetExportedTypes())
                {
                    //Console.WriteLine(t.Namespace + " " + t.Name);
                    Console.WriteLine("<SafeControl Assembly=\"{0}\" Namespace=\"{1}\" TypeName=\"{2}\" Safe=\"True\" />",
                                      fullname, t.Namespace, t.Name);
                    Console.WriteLine();
                }
     
            }
        }
    }

     

    .

    SharePoint: New VB web part not showing up in Web Part Gallery: New Web Parts (NewDwp.aspx)

     

    This issue described here is actually more of a Visual Basic issue than SharePoint, but it often pops up in SharePoint web part deployment.

    The issue: You create a web part in C# with a “namespace Max.Demo”, build it, deploy the DLL, add it to safe controls and go to Site Actions, Site Settings, Web Part Gallery, New Web Parts. It shows up in the list just fine with a name like: assemblyname.namespacename.classname.

    You try the exact same steps above using Visual Studio, and the web part does not show up in New Web Parts.

    The problem is with the namespace and how you entered it into <SafeControls>, actually it’s because you did not know the real namespace name.

    In C# when you add “namespace Max.Demo” to a class then that is the namespace name generated. In VB when you add “namespace Max.Demo” you are creating a namespace name that is built from two parts, what you typed added to what is specified in the project’s properties screen as the “Root namespace”.

     

    So in VB if your properties look like this:

        image

    and your code looks like this:

      Namespace Max.Demo
        Public Class VBWebPart
        Inherits WebPart

    VB creates a namespace named:   MyWebPartProject.Max.Demo

     

    So for VB projects:

    • Only set your namespace in Project Properties
    • Or delete the namespace in Project Properties (leave it blank) and set the namespace in code
    • Or remember that the namespace in Project Properties is combined with what you set in code

     

    If you want to see just how everything got named then create a little project with this code:

     

    Imports System.Reflection
     
    Module Module1
     
        Sub Main()
            Dim a As Assembly = Assembly.LoadFrom("C:\yourprojectpath\vbwebpart.dll")
            Console.WriteLine("Fullname:" & a.FullName)
            Console.WriteLine()
     
            For Each t As Type In a.GetExportedTypes
                Console.WriteLine(t.Namespace + " " + t.Name)
            Next
            Console.ReadLine()
        End Sub
     
    End Module

     

    .

    1/21/2010

    SharePoint: List all SPBasePermissions for a User

     

    This is a sample of code to list every possible permission a user has for a particular object. The object in the code is an SPWeb, but could be a list, folder or item. As I wanted to iterate though the SPBasePermissions enumberation and display the permission names I used the code sample from here.

    For a list of the SharePoint permissions see here: http://techtrainingnotes.blogspot.com/2010/01/sharepoint-permission-levels.html

     

    There’s got to be a better way to do this… but it works.

     

    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Administration;
     
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                //username = SPContext.Current.Web.CurrentUser.LoginName
                string username = @"maxsp2007\stellas";
               
                using (SPSite site = new SPSite("http://MAXsp2007/sites/training"))
                {
                    SPWeb web = site.OpenWeb("ateamsite") ; //.RootWeb;
     
                    foreach (string enumName in Enum.GetNames(typeof(SPBasePermissions)))
                    {
                        if (web.DoesUserHavePermissions(username,
                            (SPBasePermissions)Enum.Parse(typeof(SPBasePermissions), enumName)))
                        {
                            Console.WriteLine(enumName);
                        }
                    }
     
                    Console.ReadLine();
                }
            }
        }
    }

     

    The result:

    image

    1/17/2010

    SharePoint: 2010 Namespace and Assembly Changes

     

    SharePoint Server 2010 has almost twice the number of assemblies and twice the number of classes than MOSS 2007. The lists below are a summary of what’s changed.

     

    For a list of 2010 assemblies and namespaces see here: http://techtrainingnotes.blogspot.com/2010/01/sharepoint-2010-assemblies-and.html)

    For a list of 2007 assemblies and namespaces see here: http://techtrainingnotes.blogspot.com/2010/01/sharepoint-2007-assemblies-and.html

     

    Assembly Comparison

     

    MOSS 2007 SharePoint Server 2010
      Microsoft.BusinessData
      Microsoft.Office.DocumentManagement
    Microsoft.Office.Excel.Server.Udf Microsoft.Office.Excel.Server.Udf
    Microsoft.Office.Excel.Server.WebServices Microsoft.Office.Excel.Server.WebServices
    Microsoft.Office.Policy Microsoft.Office.Policy
      Microsoft.Office.SecureStoreService.Server.Security
    Microsoft.Office.Server Microsoft.Office.Server
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search
      Microsoft.Office.Server.UserProfiles
      Microsoft.Office.SharePoint.ClientExtensions
      Microsoft.Office.Word.Server
      Microsoft.Office.Workflow.Actions
    Microsoft.Office.Workflow.Tasks Microsoft.Office.Workflow.Tasks
    Microsoft.SharePoint Microsoft.SharePoint
      Microsoft.SharePoint.Client
      Microsoft.SharePoint.Client.Runtime
    Microsoft.SharePoint.Portal Microsoft.SharePoint.Portal
    Microsoft.SharePoint.Portal.SingleSignon  
    Microsoft.SharePoint.Portal.SingleSignon.Security  
    Microsoft.SharePoint.Publishing Microsoft.SharePoint.Publishing
    Microsoft.SharePoint.Search Microsoft.SharePoint.Search
      Microsoft.SharePoint.Search.Extended.Administration
      Microsoft.SharePoint.Search.Extended.Administration.Common
      Microsoft.SharePoint.Search.Extended.Administration.ResourceStorage
      Microsoft.SharePoint.Search.Extended.Query
    Microsoft.SharePoint.Security Microsoft.SharePoint.Security
      Microsoft.SharePoint.Taxonomy
    Microsoft.SharePoint.WorkflowActions Microsoft.SharePoint.WorkflowActions
      Microsoft.Web.CommandUI

     

     

    Moved Namespaces?

    I need to spend some more time here, but it looks like a number of namespaces have been moved from one assembly to another.

    As an example the following namespaces have been moved from the Microsoft.Office.Server.dll assembley to to  Microsoft.Office.Server.UserProfiles.dll:

    Microsoft.Office.Server.Audience
    Microsoft.Office.Server.UserProfiles
    Microsoft.Office.Server.WebControls.FieldTypes
    Microsoft.Office.Server.WebControls.UserProfileHelper

     

     

    New Namespaces…

    These are some of the new namespaces I have found:

    Assembly Namespace
    Microsoft.BusinessData Microsoft.BusinessData.Infrastructure
    Microsoft.BusinessData Microsoft.BusinessData.Infrastructure.Collections
    Microsoft.BusinessData Microsoft.BusinessData.Infrastructure.SecureStore
    Microsoft.BusinessData Microsoft.BusinessData.Infrastructure.Throttle
    Microsoft.BusinessData Microsoft.BusinessData.MetadataModel
    Microsoft.BusinessData Microsoft.BusinessData.MetadataModel.Collections
    Microsoft.BusinessData Microsoft.BusinessData.Offlining
    Microsoft.BusinessData Microsoft.BusinessData.Runtime
    Microsoft.BusinessData Microsoft.BusinessData.SystemSpecific
    Microsoft.BusinessData Microsoft.BusinessData.SystemSpecific.Wcf
    Microsoft.Office.DocumentManagement Microsoft.Office.DocumentManagement
    Microsoft.Office.DocumentManagement Microsoft.Office.DocumentManagement.DocSite
    Microsoft.Office.DocumentManagement Microsoft.Office.DocumentManagement.DocumentSets
    Microsoft.Office.DocumentManagement Microsoft.Office.DocumentManagement.Internal
    Microsoft.Office.DocumentManagement Microsoft.Office.DocumentManagement.MetadataNavigation
    Microsoft.Office.DocumentManagement Microsoft.Office.Server.WebControls
    Microsoft.Office.Policy Microsoft.Office.DocumentManagement
    Microsoft.Office.Policy Microsoft.Office.RecordsManagement.Controls
    Microsoft.Office.Policy Microsoft.Office.RecordsManagement.OfficialFileWSProxy
    Microsoft.Office.Policy Microsoft.Office.RecordsManagement.RecordsRepository.Internal
    Microsoft.Office.SecureStoreService.Server.Security Microsoft.Office.SecureStoreService.Server.Security
    Microsoft.Office.Server Microsoft.Office.Server.Diagnostics.ULSEventTemplates
    Microsoft.Office.Server Microsoft.Office.Server.Internal
    Microsoft.Office.Server Microsoft.Office.Server.Monitoring
    Microsoft.Office.Server Microsoft.Office.Server.ObjectCache
    Microsoft.Office.Server.Search ATL._ATL_SAFE_ALLOCA_IMPL
    Microsoft.Office.Server.Search ATL.<AtlImplementationDetails>
    Microsoft.Office.Server.Search BihConsumerInterop
    Microsoft.Office.Server.Search Define_the_symbol__ATL_MIXED
    Microsoft.Office.Server.Search FastSerialization
    Microsoft.Office.Server.Search Inconsistent_definition_of_symbol__ATL_MIXED
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Administration.Health
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Administration.NotesWebServiceWrapper
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Administration.TopologyExport
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Cmdlet
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Extended.Administration.Common
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Extended.Administration.Facade
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Extended.Administration.Internal.UI
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Extended.Query.Internal.UI
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Internal.Protocols.PeopleSoapProxy
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Internal.UI.WebControls
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.MobileControls
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Monitoring
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Query.Common
    Microsoft.Office.Server.Search Microsoft.Office.Server.Search.Query.Gateway
    Microsoft.Office.Server.Search Microsoft.Search.Server
    Microsoft.Office.Server.Search Microsoft.Search.Server.comadmin
    Microsoft.Office.Server.Search Microsoft.Search.Upgrade
    Microsoft.Office.Server.Search Microsoft.SharePoint.Portal.Search
    Microsoft.Office.Server.Search Microsoft.SharePoint.Portal.Search.Admin.WebControls
    Microsoft.Office.Server.Search Microsoft.SharePoint.Portal.WebControls
    Microsoft.Office.Server.Search System.Collections.Generic
    Microsoft.Office.Server.Search System.Diagnostics
    Microsoft.Office.Server.Search System.Diagnostics.Events
    Microsoft.Office.Server.Search Utilities
    Microsoft.Office.Server.Search vc_attributes
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.ActivityFeed
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.CommandLine
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.Infrastructure
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.Security
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.SocialData
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.Upgrade
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.UserProfiles
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.UserProfiles.Cache
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.UserProfiles.PowerShell
    Microsoft.Office.Server.UserProfiles Microsoft.Office.Server.WebControls
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions.Deployment
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions.Publishing
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions.SecureStoreAdministration
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions.SecureStoreSetCredentialsPages
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions.TenantSecureStoreAdministration
    Microsoft.Office.SharePoint.ClientExtensions Microsoft.Office.SharePoint.ClientExtensions.WebControls
    Microsoft.Office.Word.Server Microsoft.Office.Word.Server
    Microsoft.Office.Word.Server Microsoft.Office.Word.Server.AdminUI
    Microsoft.Office.Word.Server Microsoft.Office.Word.Server.Conversions
    Microsoft.Office.Word.Server Microsoft.Office.Word.Server.Powershell
    Microsoft.Office.Word.Server Microsoft.Office.Word.Server.Service
    Microsoft.Office.Word.Server Microsoft.Office.Word.Server.Service.Messages
    Microsoft.Office.Workflow.Actions Microsoft.Office.Workflow
    Microsoft.Office.Workflow.Actions Microsoft.Office.Workflow.Actions
    Microsoft.Office.Workflow.Actions Microsoft.SharePoint.WorkflowUtil
    Microsoft.SharePoint Microsoft.BusinessData
    Microsoft.SharePoint Microsoft.SharePoint.Administration.AccessControl
    Microsoft.SharePoint Microsoft.SharePoint.Administration.Claims
    Microsoft.SharePoint Microsoft.SharePoint.Administration.Health
    Microsoft.SharePoint Microsoft.SharePoint.ApplicationPages.Calendar
    Microsoft.SharePoint Microsoft.SharePoint.ApplicationPages.Calendar.Exchange
    Microsoft.SharePoint Microsoft.SharePoint.ApplicationPages.PickerQuery
    Microsoft.SharePoint Microsoft.SharePoint.Applications.GroupBoard
    Microsoft.SharePoint Microsoft.SharePoint.Applications.GroupBoard.MobileControls
    Microsoft.SharePoint Microsoft.SharePoint.Applications.GroupBoard.Utilities
    Microsoft.SharePoint Microsoft.SharePoint.Applications.GroupBoard.WebControls
    Microsoft.SharePoint Microsoft.SharePoint.Applications.GroupBoard.WebPartPages
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Administration
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Infrastructure
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Infrastructure.Collections
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.MetadataModel
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.MetadataModel.Collections
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.MetadataModel.Constants
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.MetadataModel.Dynamic
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.MetadataModel.Static
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.MetadataModel.Static.DataAccess
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Offlining
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Parser
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Runtime
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SharedService
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SharedService.Structs.ExtensionMethods
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SystemSpecific
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SystemSpecific.Db
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SystemSpecific.DotNetAssembly
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SystemSpecific.Wcf
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.SystemSpecific.WebService
    Microsoft.SharePoint Microsoft.SharePoint.BusinessData.Upgrade
    Microsoft.SharePoint Microsoft.SharePoint.Calculation
    Microsoft.SharePoint Microsoft.SharePoint.Client
    Microsoft.SharePoint Microsoft.SharePoint.CoordinatedStreamBuffer
    Microsoft.SharePoint Microsoft.SharePoint.Diagnostics.ULSEventTemplates
    Microsoft.SharePoint Microsoft.SharePoint.IdentityModel
    Microsoft.SharePoint Microsoft.SharePoint.JSGrid
    Microsoft.SharePoint Microsoft.SharePoint.JsonUtilities
    Microsoft.SharePoint Microsoft.SharePoint.MobileMessage
    Microsoft.SharePoint Microsoft.SharePoint.RBSWrapper
    Microsoft.SharePoint Microsoft.SharePoint.UserCode
    Microsoft.SharePoint Microsoft.SharePoint.Utilities.Cab
    Microsoft.SharePoint Microsoft.SharePoint.Utilities.SimpleParsers
    Microsoft.SharePoint Microsoft.SharePoint.Utilities.SqlTrace
    Microsoft.SharePoint Microsoft.SharePoint.Utilities.ThemingParser
    Microsoft.SharePoint Microsoft.SharePoint.Utilities.Win32
    Microsoft.SharePoint Microsoft.Xslt
    Microsoft.SharePoint.Client Microsoft.SharePoint.Client
    Microsoft.SharePoint.Client Microsoft.SharePoint.Client.Utilities
    Microsoft.SharePoint.Client Microsoft.SharePoint.Client.WebParts
    Microsoft.SharePoint.Client Microsoft.SharePoint.Client.Workflow
    Microsoft.SharePoint.Client.Runtime Microsoft.SharePoint.Client
    Microsoft.SharePoint.Client.Runtime Microsoft.SharePoint.Client.Application
    Microsoft.SharePoint.Portal Microsoft.Office.Server.ApplicationRegistry.SharedService
    Microsoft.SharePoint.Portal Microsoft.Office.Server.ApplicationRegistry.Upgrade
    Microsoft.SharePoint.Portal Microsoft.SharePoint.Cmdlet
    Microsoft.SharePoint.Portal Microsoft.SharePoint.Portal.ClaimProviders
    Microsoft.SharePoint.Portal Microsoft.SharePoint.Portal.Internal
    Microsoft.SharePoint.Portal Microsoft.SharePoint.Portal.MobileControls
    Microsoft.SharePoint.Publishing Microsoft.Office.Server.Serialization
    Microsoft.SharePoint.Publishing Microsoft.Office.Workflow.Templates
    Microsoft.SharePoint.Publishing Microsoft.SharePoint.Publishing.Cmdlet
    Microsoft.SharePoint.Search ATL
    Microsoft.SharePoint.Search ATL._ATL_SAFE_ALLOCA_IMPL
    Microsoft.SharePoint.Search ATL.<AtlImplementationDetails>
    Microsoft.SharePoint.Search BihConsumerInterop
    Microsoft.SharePoint.Search Define_the_symbol__ATL_MIXED
    Microsoft.SharePoint.Search Inconsistent_definition_of_symbol__ATL_MIXED
    Microsoft.SharePoint.Search Microsoft.Search.Upgrade
    Microsoft.SharePoint.Search Microsoft.SharePoint.Search.Internal.Protocols
    Microsoft.SharePoint.Search Microsoft.SharePoint.Search.Internal.Protocols.PeopleSoapProxy
    Microsoft.SharePoint.Search Microsoft.SharePoint.Search.Upgrade
    Microsoft.SharePoint.Search vc_attributes
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Commandlets
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Commandlets.Properties
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Commandlets.Schema
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Common
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Content
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Deployment
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Exceptions
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Keywords
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Linguistics
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Logging
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.ResourceStorage
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Schema
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Service
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Service.DTO
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Store
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Utils.Interceptor
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.Utils.Proxy
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.WCF
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.WCFClient
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.WCFClient.Deployment
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.WCFClient.Linguistics
    Microsoft.SharePoint.Search.Extended.Administration Microsoft.SharePoint.Search.Extended.Administration.WCFClient.Store
    Microsoft.SharePoint.Search.Extended.Administration.Common Microsoft.SharePoint.Search.Extended.Administration
    Microsoft.SharePoint.Search.Extended.Administration.Common Microsoft.SharePoint.Search.Extended.Administration.Common
    Microsoft.SharePoint.Search.Extended.Administration.ResourceStorage Microsoft.SharePoint.Search.Extended.Administration.ResourceStorage
    Microsoft.SharePoint.Search.Extended.Administration.ResourceStorage Microsoft.SharePoint.Search.Extended.Administration.ResourceStorage.WebServerSpecifics
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.Content.Util
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.Http
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.Navigation
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.Query
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.Result
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.View
    Microsoft.SharePoint.Search.Extended.Query Microsoft.SharePoint.Search.Extended.Query.View.Presentation
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.Cmdlet
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.ContentTypeSync
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.ContentTypeSync.Internal
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.Generic
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.Internal
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.OM.CodeBehind
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.Upgrade
    Microsoft.SharePoint.Taxonomy Microsoft.SharePoint.Taxonomy.WebServices
    Microsoft.SharePoint.WorkflowActions Microsoft.SharePoint.WorkflowActions.WithKey
    Microsoft.Web.CommandUI Microsoft.Web.CommandUI

    Note to spammers!

    Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.