Kirk's profileKirk's SharePoint Space....PhotosBlogLists Tools Help

Blog


    July 22

    WSS/MOSS on Vista

    It appears several have done this so I decided to make the jump.  Might I add…I LOVE THIS.  I took the plunge with MOSS since I tend to do most of my stuff in there.  Here is what you need:

     

    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/05/21/how-to-install-windows-sharepoint-services-3-0-sp1-on-vista-x64-x86.aspx

                    This tells you about everything you need to know…

                    Pay attention to the IIS part so you have everything configured

                    One thing that bit me right away was that ASP.Net was defaulted to run as v1.1 so when Central Admin spun it was running under 1.1 at first

                    You can do the DBA install by running psconfig BEFORE you run the config like we usually recommend

                    Make sure to create local users on your machine.  If you are like me, I tried through the standard “User Accounts” interface and that doesn’t work.  Click the Advanced Tab and then the Advanced button to do it that way

     

    I have not configured the SSP as of yet, nor will I until needed.  This rocks!

     

    Here is my script to config the main site:

    psconfig -cmd configdb -create -server oma-khofer -database MOSS_Config -admincontentdatabase MOSS_Admin_Content_01 -user oma-khofer\SPFarm -password pass@word1

     

    #After this is done, launch the wizard…I know there is a command to do that via psconfig, but can’t remember

     

    Also, if you have any problems, tear it down, it is easy…

     

    #PoSH script of course

    $sspname=”SSP1”

    $databaseserver=”oma-khofer”

     

    #Delete SSP

    stsadm -o deletessp -title $sspname -deletedatabases -force

     

    #loop through and delete all your web apps you created

    stsadm -o unextendvs -url http://oma-khofer:84 -deletecontent -deleteiissites

     

    #Delete CA

    stsadm -o deleteadminvs

     

    #Disconnect

    psconfig -cmd configdb -disconnect

     

    $databasename="MOSS_Config"

    sqlcmd -S $databaseserver -Q "ALTER DATABASE [$databasename] SET SINGLE_USER WITH ROLLBACK IMMEDIATE"

    sqlcmd -S $databaseserver -Q "ALTER DATABASE [$databasename] SET SINGLE_USER"

    sqlcmd -S $databaseserver -Q "DROP DATABASE [$databasename]"

     

    $databasename="MOSS_Admin_Content_01"

    sqlcmd -S $databaseserver -Q "ALTER DATABASE [$databasename] SET SINGLE_USER WITH ROLLBACK IMMEDIATE"

    sqlcmd -S $databaseserver -Q "ALTER DATABASE [$databasename] SET SINGLE_USER"

    sqlcmd -S $databaseserver -Q "DROP DATABASE [$databasename]"

    May 29

    Text Generator

    Often I want to generate text for web sites or just fill in the blanks...here is the coolest thing...Lorem Ipsum (http://www.lipsum.com/) and they have a simple XML service to push stuff back...

     

    http://www.lipsum.com/feed/xml?amount=<int>&what=<paras,words,bytes>&start=<yes,no>

        type: bytes,words,paras

        Start: yes,no (Whether to start with "Lorem ipsum dolor")

     

    PowerShell Example: 

    [xml]$w = (new-object net.webclient).DownloadString("http://www.lipsum.com/feed/xml?amount=10&what=paras&start=yes")

    #text output is in the following

    $w.feed.lipsum

    May 15

    File Upload with HashTable and Multie Value Columns

    Was trying to upload some documents the other day using an XML file with the metadata.  I needed to split a bunch of data out and submit it to SharePoint as a list column with Multiple Values.  This, and lookup columns, you really have to understand how the data is sored in SQL first before trying to just do thls.  What I did was:
     
    • Upload a couple of items through the UI and set the values.
    • Open up SQL and run a query to find the detail:

    select nvarchar10,nvarchar11,ntext2,* from alluserdata WHERE tp_LeafName = 'Test File.txt' order by tp_version desc

    • The columns you want to see with the values you can fine in the SPList.SchemaXml...file the Field element with the field it stores the data in
    • From here, I realized the multiple value fields are completely surrounded and split with ;#.  For example, if you have values A,B, then it would be ;#A;#B;#.

    That is all, upload these files with the SPFolder.Files.Add() method and create yourself a HashTable with the metadata and you are off and running...of course this is real easy through PowerShell:

    $site = new-object microsoft.sharepoint.spsite(http://server)

    $web = $site.rootweb

    #$list = $web.Lists["ListName"]

    #$list.Schema.Xml

    $folder = $web.getfolder("/ListName")

     

    $x=@{}

    #Plain Text Field

    $x.add("Plain","Blah blah")

    #Field with Choice and Checkboxes…

    $x.add("MultiValue",";#A;#B;#")

    $bytes=[byte[]]get-content export.csv -encoding byte

    $file = $folder.files.add("Test File.txt",$bytes,$x,$true)

    May 12

    AJAX and Publishing Sites...DO NOT WORK

    I posted this on forums after a suggestion from a person working with me from Microsoft.  I haven't even received a bite yet.  Please post a comment if you have also had issues with AJAX and publishing sites.  I have yet to see MS post anything that says this does not work.
     
    To test:
    • Create an AJAX Web Part that works in a standard BLANK site
      • Of course you have to do things like add the ASP:ScriptControl and other things to your default.master or whatever...but do it
    • Enable Publishing features (these are at the Site Collection level and the Site level)
    • I bet the AJAX will work right away...yup, but ONLY with the basic master page
    • Change the master page to something other than the one you carried over with the BLANK site...guess what...

    If you have any feedback, post it on forums...

    ListInstance with Scope at Site ERROR

    Found this out the hard way today, and found little posts that explained exactly what this does.  If you have a ListTemplate in a feature to define your list (which is Hidden) and then have a separate feature with a ListInstance inside, the ListInstance/@RootWebOnly attribute is only available when the Feature/@Scope='Web'.  If you set the Feature/@Scope='Site' and have the ListInstance/@RoowWebOnly='TRUE', you will get the lovely "Object reference not set to an instance of an object".
     
    Hope this helps someone...
    May 10

    Starting New Blog

    I have been working for Inetium since last year and have had my blog there for now.  You can view my posts at http://blogs.inetium.com/blogs/khofer.  I think for now I will post here so I can mix work and play.  You will see a lot of posts about SharePoint and other MS products...
     
    Posts that I have active now if you want to read them:
     
         Get rid of the annoying characters when uploading files with RegEx
        This works best on the same list but probably would work as long as it is within the same Site Collection
        This one I got a lot of hits because the MS one with VBScript is huge.  This one is very simple