<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Adventures in SPWonderland. - SharePoint</title>
    <link>http://blogs.flexnetconsult.co.uk/colinbyrne/</link>
    <description>Taking apart and putting back together</description>
    <language>en-us</language>
    <copyright>Colin Byrne</copyright>
    <lastBuildDate>Tue, 18 Mar 2008 20:29:36 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>webparts@flexnetconsult.co.uk</managingEditor>
    <webMaster>webparts@flexnetconsult.co.uk</webMaster>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=4c590c4f-8331-4496-8391-e985830e6700</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,4c590c4f-8331-4496-8391-e985830e6700.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,4c590c4f-8331-4496-8391-e985830e6700.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=4c590c4f-8331-4496-8391-e985830e6700</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
While preparing for the <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/11/PresentingSharePointSilverlightAtTheSharePointUKUserGroupBasingstokeMarch27th.aspx" target="_blank">presentation</a> on
Silverlight and SharePoint next week I've just discovered that the current Beta 1
of SilverLight 2 is unable to call SharePoint's native webservices. 
</p>
        <p>
The technical reason is that the WSDL SharePoint generates includes an asd:any declaration
which is translated by the proxy generator as requiring the XmlElement class but Silverlight
does not support this class. So you're not able to call GetList or GetListItems in
Lists.asmx for instance.
</p>
        <p>
I've <a href="http://silverlight.net/forums/t/11964.aspx" target="_blank">posted</a> on
the Silverlight forums about this but the reply I got from Yavor Georgiev (Program
Manager - Connected Services) was not clear as to whether this is a planned feature
for SL 2. 
</p>
        <p>
There are a few ways around this which I'll go into in the presentation but none are
very pleasant prospects. 
</p>
        <p>
There's probably still time to get this feature in v2. The best thing is to let MS
know this is an important issue by adding support on the <a href="http://silverlight.net/forums/t/11964.aspx" target="_blank">thread</a>.
Also worth keeping an eye on the <a href="http://blogs.msdn.com/silverlightws/" target="_blank">Silverlight
Web Services blog</a>.
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=4c590c4f-8331-4496-8391-e985830e6700" />
      </body>
      <title>Silverlight 2: Unable to call SharePoint's Web Services</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,4c590c4f-8331-4496-8391-e985830e6700.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/18/Silverlight2UnableToCallSharePointsWebServices.aspx</link>
      <pubDate>Tue, 18 Mar 2008 20:29:36 GMT</pubDate>
      <description>&lt;p&gt;
While preparing for the &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/11/PresentingSharePointSilverlightAtTheSharePointUKUserGroupBasingstokeMarch27th.aspx" target="_blank"&gt;presentation&lt;/a&gt; on
Silverlight and SharePoint next week I've just discovered that the current Beta 1
of SilverLight 2 is unable to call SharePoint's native webservices. 
&lt;/p&gt;
&lt;p&gt;
The technical reason is that the WSDL SharePoint generates includes an asd:any declaration
which is translated by the proxy generator as requiring the XmlElement class but Silverlight
does not support this class. So you're not able to call GetList or GetListItems in
Lists.asmx for instance.
&lt;/p&gt;
&lt;p&gt;
I've &lt;a href="http://silverlight.net/forums/t/11964.aspx" target="_blank"&gt;posted&lt;/a&gt; on
the Silverlight forums about this but the reply I got from Yavor Georgiev (Program
Manager - Connected Services) was not clear as to whether this is a planned feature
for SL 2. 
&lt;/p&gt;
&lt;p&gt;
There are a few ways around this which I'll go into in the presentation but none are
very pleasant prospects. 
&lt;/p&gt;
&lt;p&gt;
There's probably still time to get this feature in v2. The best thing is to let MS
know this is an important issue by adding support on the &lt;a href="http://silverlight.net/forums/t/11964.aspx" target="_blank"&gt;thread&lt;/a&gt;.
Also worth keeping an eye on the &lt;a href="http://blogs.msdn.com/silverlightws/" target="_blank"&gt;Silverlight
Web Services blog&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=4c590c4f-8331-4496-8391-e985830e6700" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,4c590c4f-8331-4496-8391-e985830e6700.aspx</comments>
      <category>SharePoint</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=abcb9261-2d42-40f7-bf58-5556c31e59cb</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=abcb9261-2d42-40f7-bf58-5556c31e59cb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm really stoked to be presenting at the UK SharePoint user group meeting in Basingstoke
on the 27 March about Silverlight and SharePoint.
</p>
        <p>
This presentation will explain what Silverlight is, what the benefits are over standard
web development and how Silverlight can be hosted in and integrate with SharePoint.<br />
With few slides and plenty of demos I'll walkthrough the creation of a Silverlight
2.0 video browser application that uses data from SharePoint and then deploy it to
SharePoint. I'll also show how a commercial Silverlight 2.0 product for SharePoint
is put together.
</p>
        <p>
The other presentations are 
</p>
        <p>
Architecting a Highly Available MOSS Farm - by Lewis Baldwin, ICS,  Head of Infrastructure
and Support 
</p>
        <p>
Governance: Protecting your SharePoint Investment by Symon Garfield, ICS,  SharePoint
Practice Lead
</p>
        <p>
The good folks at ICS solutions are hosting us at their offices in Basingstoke (<a title="http://www.icssolutions.co.uk/pages/howtofindus.aspx" href="http://www.icssolutions.co.uk/pages/howtofindus.aspx">http://www.icssolutions.co.uk/pages/howtofindus.aspx</a>).
</p>
        <p>
Just post a reply with your full name on this thread <a href="http://suguk.org/forums/thread/8918.aspx">http://suguk.org/forums/thread/8918.aspx</a> (registration
required)
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=abcb9261-2d42-40f7-bf58-5556c31e59cb" />
      </body>
      <title>Presenting SharePoint + Silverlight at the SharePoint UK UserGroup Basingstoke March 27th</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/11/PresentingSharePointSilverlightAtTheSharePointUKUserGroupBasingstokeMarch27th.aspx</link>
      <pubDate>Tue, 11 Mar 2008 13:06:22 GMT</pubDate>
      <description>&lt;p&gt;
I'm really stoked to be presenting at the UK SharePoint user group meeting in Basingstoke
on the 27 March about Silverlight and SharePoint.
&lt;/p&gt;
&lt;p&gt;
This presentation will explain what Silverlight is, what the benefits are over standard
web development and how Silverlight can be hosted in and integrate with SharePoint.&lt;br&gt;
With few slides and plenty of demos I'll walkthrough the creation of a Silverlight
2.0 video browser application that uses data from SharePoint and then deploy it to
SharePoint. I'll also show how a commercial Silverlight 2.0 product for SharePoint
is put together.
&lt;/p&gt;
&lt;p&gt;
The other presentations are 
&lt;/p&gt;
&lt;p&gt;
Architecting a Highly Available MOSS Farm - by Lewis Baldwin, ICS,&amp;nbsp; Head of Infrastructure
and Support 
&lt;p&gt;
Governance: Protecting your SharePoint Investment by Symon Garfield, ICS,&amp;nbsp; SharePoint
Practice Lead
&lt;/p&gt;
&lt;p&gt;
The good folks at ICS solutions are hosting us at their offices in Basingstoke (&lt;a title="http://www.icssolutions.co.uk/pages/howtofindus.aspx" href="http://www.icssolutions.co.uk/pages/howtofindus.aspx"&gt;http://www.icssolutions.co.uk/pages/howtofindus.aspx&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
Just post a reply with your full name on this thread &lt;a href="http://suguk.org/forums/thread/8918.aspx"&gt;http://suguk.org/forums/thread/8918.aspx&lt;/a&gt; (registration
required)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=abcb9261-2d42-40f7-bf58-5556c31e59cb" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,abcb9261-2d42-40f7-bf58-5556c31e59cb.aspx</comments>
      <category>SharePoint</category>
      <category>Silverlight</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=5c6f6021-c6b1-468a-a60a-53250cc86b0b</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,5c6f6021-c6b1-468a-a60a-53250cc86b0b.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,5c6f6021-c6b1-468a-a60a-53250cc86b0b.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=5c6f6021-c6b1-468a-a60a-53250cc86b0b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I forgot to post this before but Microsoft has created a virtual lab based on my blog
postings. If you're interested in Powershell and SharePoint its definitely worth checking
out
</p>
        <p>
          <a title="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032346304&amp;EventCategory=3&amp;culture=en-US&amp;CountryCode=US" href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032346304&amp;EventCategory=3&amp;culture=en-US&amp;CountryCode=US">http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032346304&amp;EventCategory=3&amp;culture=en-US&amp;CountryCode=US</a>
        </p>
        <p>
As noted on Ben Pierce's blog Powershell is now a CER common engineering requirement
for all products released in 2009 and beyond, that should mean as Office 14 is due
for release in 2009 PowerShell should be a mandatory feature in SharePoint. 
</p>
        <p>
Thats good news and a big change as when I'd asked the question about PowerShell support
in SharePoint to Mike Fitzmaurice back in February last year the answer was they had
no plan to do so.
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=5c6f6021-c6b1-468a-a60a-53250cc86b0b" />
      </body>
      <title>Sharepoint and Powershell Virtual lab</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,5c6f6021-c6b1-468a-a60a-53250cc86b0b.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/02/25/SharepointAndPowershellVirtualLab.aspx</link>
      <pubDate>Mon, 25 Feb 2008 12:12:27 GMT</pubDate>
      <description>&lt;p&gt;
I forgot to post this before but Microsoft has created a virtual lab based on my blog
postings. If you're interested in Powershell and SharePoint its definitely worth checking
out
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032346304&amp;amp;EventCategory=3&amp;amp;culture=en-US&amp;amp;CountryCode=US" href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032346304&amp;amp;EventCategory=3&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032346304&amp;amp;EventCategory=3&amp;amp;culture=en-US&amp;amp;CountryCode=US&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
As noted on Ben Pierce's blog Powershell is now a CER common engineering requirement
for all products released in 2009 and beyond, that should mean as Office 14 is due
for release in 2009 PowerShell should be a mandatory feature in SharePoint. 
&lt;/p&gt;
&lt;p&gt;
Thats good news and a big change as when I'd asked the question about PowerShell support
in SharePoint to Mike Fitzmaurice back in February last year the answer was they had
no plan to do so.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=5c6f6021-c6b1-468a-a60a-53250cc86b0b" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,5c6f6021-c6b1-468a-a60a-53250cc86b0b.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=0b8ca1c7-6c61-4ae0-b1ba-186e878ec453</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b8ca1c7-6c61-4ae0-b1ba-186e878ec453.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b8ca1c7-6c61-4ae0-b1ba-186e878ec453.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=0b8ca1c7-6c61-4ae0-b1ba-186e878ec453</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Microsoft has recently pledged to release the documentation of a lot of its up-to-now
internal server protocols. 
</p>
        <p>
          <em>'Microsoft is providing access through open connections to its high-volume products—Windows
Vista (including the .NET Framework), Windows Server 2008, SQL Server 2008, Office
2007, Exchange Server 2007, and Office SharePoint Server 2007—so that software developers,
business partners and competitors can better interact with these Microsoft products
or invent new solutions for customers.'</em>
        </p>
        <p>
Obviously the ones getting the most attention are the server SMB interfaces but also
of interest in a real geeky way are ones for the <a href="http://msdn2.microsoft.com/en-us/library/cc216195.aspx">Windows
Search Service</a> and <a href="http://msdn2.microsoft.com/en-us/library/cc214876.aspx">WebDAV</a>.
</p>
        <p>
What's tweaked my curiosity is that SharePoint 2007 is mentioned on this list. What
interfaces are they talking about? Client side protocols like the FrontPage RPC's? 
Server side ones? Dunno but it could be interesting.
</p>
        <p>
Personally given the time I spent a long time ago extracting data from a corrupt Microsoft
MDB in 2k pages I'd like to see the Jet DB format released, just for old times sake.
</p>
        <p>
Kudo's to Microsoft to releasing this information with a much dignity as anyone with
their arm twisted up their back by the EU could.
</p>
        <p>
 
</p>
        <p>
UPDATE:
</p>
        <p>
thanks to Sean Watson for explaining that the SharePoint related Open Protocols are
three WebDAV and two FrontPage ones
</p>
        <p>
MS-WDV  <a href="http://msdn2.microsoft.com/en-us/library/cc214876.aspx" target="_blank">Web
Distributed Authoring and Versioning (WebDAV) Protocol: Client Extensions</a></p>
        <p>
MS-WDVME  <a href="http://msdn2.microsoft.com/en-us/library/cc250108.aspx" target="_blank">Web
Distributed Authoring and Versioning (WebDAV) Protocol: Microsoft Extensions</a></p>
        <p>
MS-WDVRV <a href="http://msdn2.microsoft.com/en-us/library/cc214979.aspx" target="_blank">World
Wide Distributed Authoring and Versioning (WebDAV) MS-Author-Via Protocol Specification</a></p>
        <p>
MC-FPSEWM <a href="http://msdn2.microsoft.com/en-us/library/cc217914.aspx" target="_blank">FrontPage
Server Extensions: Website Management Specification</a></p>
        <p>
MS-FPSE <a href="http://msdn2.microsoft.com/en-us/library/cc205092.aspx" target="_blank">FrontPage
Server Extensions Remote Protocol Specification</a></p>
        <p>
for more details about the Microsoft Communications Protocol Program MCPP and the
legal status of these documents see <a title="http://www.microsoft.com/about/legal/intellectualproperty/protocols/mcpp.mspx" href="http://www.microsoft.com/about/legal/intellectualproperty/protocols/mcpp.mspx">http://www.microsoft.com/about/legal/intellectualproperty/protocols/mcpp.mspx</a> 
</p>
        <p>
The gist of it seems to be that open source projects are free to use this information
but commercial products would possibly be subject to licencing and patent requirements
depending on what they implemented.
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b8ca1c7-6c61-4ae0-b1ba-186e878ec453" />
      </body>
      <title>SharePoint 2007 and Open Protocols</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b8ca1c7-6c61-4ae0-b1ba-186e878ec453.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2008/02/24/SharePoint2007AndOpenProtocols.aspx</link>
      <pubDate>Sun, 24 Feb 2008 20:33:48 GMT</pubDate>
      <description>&lt;p&gt;
Microsoft has recently pledged to release the documentation of a lot of its up-to-now
internal server protocols. 
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;'Microsoft is providing access through open connections to its high-volume products—Windows
Vista (including the .NET Framework), Windows Server 2008, SQL Server 2008, Office
2007, Exchange Server 2007, and Office SharePoint Server 2007—so that software developers,
business partners and competitors can better interact with these Microsoft products
or invent new solutions for customers.'&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
Obviously the ones getting the most attention are the server SMB interfaces but also
of interest in a real geeky way are ones for the &lt;a href="http://msdn2.microsoft.com/en-us/library/cc216195.aspx"&gt;Windows
Search Service&lt;/a&gt; and &lt;a href="http://msdn2.microsoft.com/en-us/library/cc214876.aspx"&gt;WebDAV&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
What's tweaked my curiosity is that SharePoint 2007 is mentioned on this list. What
interfaces are they talking about? Client side protocols like the FrontPage RPC's?&amp;nbsp;
Server side ones? Dunno but it could be interesting.
&lt;/p&gt;
&lt;p&gt;
Personally given the time I spent a long time ago extracting data from a corrupt Microsoft
MDB in 2k pages I'd like to see the Jet DB format released, just for old times sake.
&lt;/p&gt;
&lt;p&gt;
Kudo's to Microsoft to releasing this information with a much dignity as anyone with
their arm twisted up their back by the EU could.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
UPDATE:
&lt;/p&gt;
&lt;p&gt;
thanks to Sean Watson for explaining that the SharePoint related Open Protocols are
three WebDAV and two FrontPage ones
&lt;/p&gt;
&lt;p&gt;
MS-WDV&amp;nbsp; &lt;a href="http://msdn2.microsoft.com/en-us/library/cc214876.aspx" target="_blank"&gt;Web
Distributed Authoring and Versioning (WebDAV) Protocol: Client Extensions&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
MS-WDVME&amp;nbsp; &lt;a href="http://msdn2.microsoft.com/en-us/library/cc250108.aspx" target="_blank"&gt;Web
Distributed Authoring and Versioning (WebDAV) Protocol: Microsoft Extensions&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
MS-WDVRV &lt;a href="http://msdn2.microsoft.com/en-us/library/cc214979.aspx" target="_blank"&gt;World
Wide Distributed Authoring and Versioning (WebDAV) MS-Author-Via Protocol Specification&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
MC-FPSEWM &lt;a href="http://msdn2.microsoft.com/en-us/library/cc217914.aspx" target="_blank"&gt;FrontPage
Server Extensions: Website Management Specification&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
MS-FPSE &lt;a href="http://msdn2.microsoft.com/en-us/library/cc205092.aspx" target="_blank"&gt;FrontPage
Server Extensions Remote Protocol Specification&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
for more details about the Microsoft Communications Protocol Program MCPP and the
legal status of these documents see &lt;a title="http://www.microsoft.com/about/legal/intellectualproperty/protocols/mcpp.mspx" href="http://www.microsoft.com/about/legal/intellectualproperty/protocols/mcpp.mspx"&gt;http://www.microsoft.com/about/legal/intellectualproperty/protocols/mcpp.mspx&lt;/a&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The gist of it seems to be that open source projects are free to use this information
but commercial products would possibly be subject to licencing and patent requirements
depending on what they implemented.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b8ca1c7-6c61-4ae0-b1ba-186e878ec453" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b8ca1c7-6c61-4ae0-b1ba-186e878ec453.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=5180cfd7-2294-416f-b231-79e9037f4443</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,5180cfd7-2294-416f-b231-79e9037f4443.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,5180cfd7-2294-416f-b231-79e9037f4443.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=5180cfd7-2294-416f-b231-79e9037f4443</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m presenting at the EVO (Exchange, Vista, Office) Community day next Thursday the
21st June.
</p>
        <p>
          <br />
I’ll be doing a session that shows how you can use Powershell to read information
from Exchange and getting it into SharePoint 2007. 
<br />
Its really hard to know how to pitch a presentation like this as the mix of experiences
is probably going to be wide, from people seeing this stuff for the first time to
old hands. Anyway I’m looking forward to it. 
</p>
        <p>
The talk will cover some Powershell basics, calling the new Exchange Web Services
from PowerShell and why we might still need to use WebDAV(hint Public Folders) and
of course how we write to SharePoint. 
<br />
I'll start posting some of the code samples over the next week.
</p>
        <p>
There’s lots of other sessions including ones from <a href="http://suguk.org/blogs/combined_knowledge/default.aspx">Steve
Smith</a> on SharePoint and <a href="http://richardsiddaway.spaces.live.com/">Richard
Siddaway</a> on PowerShell, should be a good one.
</p>
        <p>
Heres the details of the Event:<br />
The Next EVO Community Day - June 21st: Microsoft Campus Thames Valley Park Reading<br /></p>
        <p>
Event Agenda<br />
09:30 Start<br />
09:30 - 10:00 Keynote<br />
10:00 - 10:25 Introductions to groups (Including LiveMeeting, Longhorn, Virtualisation)<br />
10:25 - 10:55 Vista<br />
10:55 - 11:10 Break<br />
11:10 - 12:40 Office, SharePoint, Groove<br />
12:40 - 13:25 Lunch<br />
13:25 - 14:55 Break-out sessions<br />
14:55 - 15:10 Break<br />
15:10 - 15:40 OCS + UM<br />
15:40 - 16:40 Exchange and PowerShell<br />
16:40 - 16:55 Break<br />
16:55 - 17:30 Q&amp;A
</p>
        <p>
Further agenda information can be found here:  <a href="http://www.ukusergroups.co.uk/Agenda.html">http://www.ukusergroups.co.uk/Agenda.html</a></p>
        <p>
To sign up and more information: <a href="http://www.ukusergroups.co.uk/">http://www.ukusergroups.co.uk/</a></p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=5180cfd7-2294-416f-b231-79e9037f4443" />
      </body>
      <title>EVO Community Day - June 21st: Microsoft Campus Thames Valley Park Reading</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,5180cfd7-2294-416f-b231-79e9037f4443.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/06/15/EVOCommunityDayJune21stMicrosoftCampusThamesValleyParkReading.aspx</link>
      <pubDate>Fri, 15 Jun 2007 09:57:30 GMT</pubDate>
      <description>&lt;p&gt;
I’m presenting at the EVO (Exchange, Vista, Office) Community day next Thursday the
21st June.
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
I’ll be doing a session that shows how you can use Powershell to read information
from Exchange and getting it into SharePoint 2007. 
&lt;br&gt;
Its really hard to know how to pitch a presentation like this as the mix of experiences
is probably going to be wide, from people seeing this stuff for the first time to
old hands. Anyway I’m looking forward to it. 
&lt;/p&gt;
&lt;p&gt;
The talk will cover some Powershell basics, calling the new Exchange Web Services
from PowerShell and why we might still need to use WebDAV(hint Public Folders) and
of course how we write to SharePoint. 
&lt;br&gt;
I'll start posting some of the code samples over the next week.
&lt;/p&gt;
&lt;p&gt;
There’s lots of other sessions including ones from &lt;a href="http://suguk.org/blogs/combined_knowledge/default.aspx"&gt;Steve
Smith&lt;/a&gt; on SharePoint and &lt;a href="http://richardsiddaway.spaces.live.com/"&gt;Richard
Siddaway&lt;/a&gt;&amp;nbsp;on PowerShell, should be a good one.
&lt;/p&gt;
&lt;p&gt;
Heres the details of the Event:&lt;br&gt;
The Next EVO Community Day - June 21st: Microsoft Campus Thames Valley Park Reading&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Event Agenda&lt;br&gt;
09:30 Start&lt;br&gt;
09:30 - 10:00 Keynote&lt;br&gt;
10:00 - 10:25 Introductions to groups (Including LiveMeeting, Longhorn, Virtualisation)&lt;br&gt;
10:25 - 10:55 Vista&lt;br&gt;
10:55 - 11:10 Break&lt;br&gt;
11:10 - 12:40 Office, SharePoint, Groove&lt;br&gt;
12:40 - 13:25 Lunch&lt;br&gt;
13:25 - 14:55 Break-out sessions&lt;br&gt;
14:55 - 15:10 Break&lt;br&gt;
15:10 - 15:40 OCS + UM&lt;br&gt;
15:40 - 16:40 Exchange and PowerShell&lt;br&gt;
16:40 - 16:55 Break&lt;br&gt;
16:55 - 17:30 Q&amp;amp;A
&lt;/p&gt;
&lt;p&gt;
Further agenda information can be found here:&amp;nbsp; &lt;a href="http://www.ukusergroups.co.uk/Agenda.html"&gt;http://www.ukusergroups.co.uk/Agenda.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
To sign up and more information: &lt;a href="http://www.ukusergroups.co.uk/"&gt;http://www.ukusergroups.co.uk/&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=5180cfd7-2294-416f-b231-79e9037f4443" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,5180cfd7-2294-416f-b231-79e9037f4443.aspx</comments>
      <category>Office 2007</category>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=fa33d522-a91f-43db-98fb-e51acd91b373</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,fa33d522-a91f-43db-98fb-e51acd91b373.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,fa33d522-a91f-43db-98fb-e51acd91b373.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=fa33d522-a91f-43db-98fb-e51acd91b373</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
I’m presenting at the next <a href="http://www.culminisconnections.com/sites/get-psuguk/default.aspx">UK
PowerShell User Group</a> meeting on March 22nd doing an updated talk around using
PowerShell with SharePoint featuring an intro to PowerShell,  Demos and roundup
with SharePoint/PowerShell gotchas and 'tips and tricks'. 
</p>
        <p>
The talk should be be of interest of anyone who might like to talk to a managed
API with Powershell.<br /></p>
        <p>
I’m doing the first talk and <a href="http://richardsiddaway.spaces.live.com/">Richard
Siddaway</a> is doing the second session with a talk on using ActiveDirectory with
PowerShell. 
<br />
If you need an intro to using PowerShell or want or ask more advanced questions this
will be a good place to be.
</p>
        <p>
          <strong>Location:</strong>
          <br />
Memphis Room 
<br />
Microsoft Building 3 
<br />
Thames Valley Park 
<br />
Reading 
</p>
        <p>
Registration 18:00 
<br />
Start           18:30
</p>
        <p>
You need to register for attendance so follow the instructions in this link: <a href="http://www.culminisconnections.com/sites/get-psuguk/Lists/Events/DispForm.aspx?ID=2">http://www.culminisconnections.com/sites/get-psuguk/Lists/Events/DispForm.aspx?ID=2</a></p>
        <p>
Hope to see you there.<br /></p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=fa33d522-a91f-43db-98fb-e51acd91b373" />
      </body>
      <title>Presenting at the UK PowerShell User Group 22 March Meeting</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,fa33d522-a91f-43db-98fb-e51acd91b373.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/03/14/PresentingAtTheUKPowerShellUserGroup22MarchMeeting.aspx</link>
      <pubDate>Wed, 14 Mar 2007 14:29:09 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
I’m presenting at the next &lt;a href="http://www.culminisconnections.com/sites/get-psuguk/default.aspx"&gt;UK
PowerShell User Group&lt;/a&gt; meeting on March 22nd doing an updated talk around using
PowerShell with SharePoint featuring an intro to PowerShell,&amp;nbsp; Demos and roundup
with SharePoint/PowerShell gotchas and 'tips and tricks'. 
&lt;/p&gt;
&lt;p&gt;
The&amp;nbsp;talk should be be of interest of anyone who might like to talk to a managed
API with Powershell.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
I’m doing the first talk and &lt;a href="http://richardsiddaway.spaces.live.com/"&gt;Richard
Siddaway&lt;/a&gt; is doing the second session with a talk on using ActiveDirectory with
PowerShell. 
&lt;br&gt;
If you need an intro to using PowerShell or want or ask more advanced questions this
will be a good place to be.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Location:&lt;/strong&gt;
&lt;br&gt;
Memphis Room 
&lt;br&gt;
Microsoft Building 3 
&lt;br&gt;
Thames Valley Park 
&lt;br&gt;
Reading 
&lt;/p&gt;
&lt;p&gt;
Registration 18:00 
&lt;br&gt;
Start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18:30
&lt;/p&gt;
&lt;p&gt;
You need to register for attendance so follow the instructions in this link: &lt;a href="http://www.culminisconnections.com/sites/get-psuguk/Lists/Events/DispForm.aspx?ID=2"&gt;http://www.culminisconnections.com/sites/get-psuguk/Lists/Events/DispForm.aspx?ID=2&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Hope to see you there.&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=fa33d522-a91f-43db-98fb-e51acd91b373" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,fa33d522-a91f-43db-98fb-e51acd91b373.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=d9d08514-f985-42ce-8ad9-df9c51536529</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,d9d08514-f985-42ce-8ad9-df9c51536529.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,d9d08514-f985-42ce-8ad9-df9c51536529.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=d9d08514-f985-42ce-8ad9-df9c51536529</wfw:commentRss>
      <title>SharePoint European Conference highlights</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,d9d08514-f985-42ce-8ad9-df9c51536529.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/02/23/SharePointEuropeanConferenceHighlights.aspx</link>
      <pubDate>Fri, 23 Feb 2007 17:59:42 GMT</pubDate>
      <description>&lt;p&gt;
I've posted a short piece about the SharePoint European conference on the SUGUK blog,
reproduced here
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span&gt;&lt;?XML:NAMESPACE PREFIX = O /&gt;SharePoint European Conference&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;This is the first SharePoint specific conference I’ve been to and I was impressed
by the amount of interest shown by the European’s, with over 2000 attendees from 50
countries and with the UK providing around 160 delegates it was very busy, it seems
that even MS was taken by surprise at the amount of interest.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;The organisation was of a high standard as you’d expect from a conference hotel,
lots of staff and lots of food the only omission as Eric Shupps has already mentioned
being the lack of free WIFI access and the really slow speed of the paid for one,
they were plainly not geared up for a WIFI swarm drain of techies popping open their
laptops and trying to surf the web. 
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Most of the sessions were of a high standard with speakers either from Microsoft
or their partners, the only real dud I attended was the business intelligence one
which fell completely flat, poor content and speakers meant I ended up walking out
something which I never normally do.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Kudo’s to Steve Heaney of Nintex who did 30 minutes of workflow coding in Visual
Studio 205 and had it compile and run without errors, I think he was more surprised
at this than anyone.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Here’s my take on a couple of sessions that opened my eyes to new features of
the Office 2007 suite.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span&gt;OpenXML&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;This session by &lt;/span&gt;&lt;span&gt;&lt;font face=Calibri&gt;Peter&lt;span&gt; &lt;/span&gt;Koen&lt;/font&gt;&lt;/span&gt;&lt;span&gt; described
the OpenXML format of the new Office 2007 programs Word, Excel and PowerPoint. It
showed how easy it is to modify existing document using the Packaging API in .Net
3.0 and pointed out how powerful this could be in conjunction with List Events and
Workflow. The power of this API is that you do not need to automate any of the Office
programs you just deal with the file itself, this is very important in server side
code as most SharePoint code tends to be.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;
&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;
&lt;/span&gt;&lt;span&gt;A couple of examples, lets say you have a Document library called Draft
and one called Confidential, what you would like is for all documents that are placed
into these document libraries to have a watermark applied that says either DRAFT or
CONFIDENTIAL applied to them. With list events and some fairly simple code this should
be pretty easy to do.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Or lets say you have 100’s of documents in various document libraries that you
send out to clients on a regular basis and each one has your logo in it along with
your company name and details in the footer of each one, lets say you undergo a re-branding
exercise or an office move, you are now faced with opening each one of those documents
and changing the logo and footer by hand or perhaps automating Word with VBA. With
the OpenXML format you can crack open the Docx file and with a few lines of code manipulate
the parts of the document you need to, it would also be an order of magnitude faster
than calling Word. 
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;The one current hassle is you have to deal with the Word XML directly, there
is no API available that maps say a Word object model onto the XML needed but apparently
that is on the development timeline.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;&lt;a href="http://openxmldeveloper.org/default.aspx"&gt;http://openxmldeveloper.org/default.aspx&lt;/a&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;
&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;
&lt;/span&gt;&lt;b&gt;&lt;span&gt;Groove&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;This was a really good session by Mark Ryan of Microsoft,
clearly someone who has been there and got the T-shirt.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Groove is a program I’ve ignored up to now but this session makes clear its
not something that can be ignored for much longer, it just too useful a program. 
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Groove supports offline distributed and replicating workspaces containing lists,
discussions, files and custom data form. It basically allows you to do offline collaboration
in the same way as SharePoint allows online collaboration. 
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;The integration with SharePoint is limited at the moment as it currently only
supports offline documents from document libraries with no support for lists, but
if the Groove team gives the SharePoint team some ‘love’ this should improve in the
next version. 
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;As Groove is new to the Office stable it does not have the .Net/Visual Studio
integration that it possibly should have and although you can embed InfoPath forms
to create data entry forms Mark recommends to stick with Groove forms for now.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;
&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;
&lt;/span&gt;&lt;span&gt;One scenario mentioned was for offline workgroup collaboration on a design
project involving images but perhaps the most interesting scenario is crisis management. 
&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;Picture this: you have a physical disaster at your main office, lets say a flood,
all company VPN and mail communication through the head Office is down, with Groove
you could have a nominated person who holds a predefined workspace containing the
company contact list along with the disaster recovery plans and checklists, that user
can quickly invite other needed parties into the workspace and as long as people have
an internet connection they can stay informed and up to date on all activities as
the company works through the steps to get back to normal. Even if you don’t use Groove
on a day to day basis in a case like this it would be worth its weight in gold.&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;
&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;
&lt;/span&gt;&lt;span&gt;Definitely check Groove out, http://office.microsoft.com/en-gb/groove/default.aspx&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span&gt;
&lt;O:P&gt;
&lt;font face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/O:P&gt;
&lt;/span&gt;&lt;span&gt;Looking forward to the next one, don’t know when it will be but one thing’s
for sure they are going to need much bigger venue.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=d9d08514-f985-42ce-8ad9-df9c51536529" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,d9d08514-f985-42ce-8ad9-df9c51536529.aspx</comments>
      <category>Office 2007</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=e78c937e-225f-4bff-99de-addf76b4f2dc</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,e78c937e-225f-4bff-99de-addf76b4f2dc.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,e78c937e-225f-4bff-99de-addf76b4f2dc.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=e78c937e-225f-4bff-99de-addf76b4f2dc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The UK SharePoint User Group meetings are coming thick and fast, the next one
is being held on 7th March in Ullesthorpe, Leicestershire.
</p>
        <p>
This should not be missed as it features 3 speakers, Andrew Woodward, Bill English
and Todd Bleeker.
</p>
        <p>
I've seen both Bill and Todd speak and its an experience ;-)
</p>
        <p>
Put your name on this thread to signup for the meeting <a href="http://suguk.org/forums/2300/ShowThread.aspx#2300">http://suguk.org/forums/2300/ShowThread.aspx#2300</a></p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=e78c937e-225f-4bff-99de-addf76b4f2dc" />
      </body>
      <title>UK SharePoint User Group Meeting March 7th</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,e78c937e-225f-4bff-99de-addf76b4f2dc.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/02/23/UKSharePointUserGroupMeetingMarch7th.aspx</link>
      <pubDate>Fri, 23 Feb 2007 17:51:31 GMT</pubDate>
      <description>&lt;p&gt;
The UK SharePoint User Group meetings&amp;nbsp;are coming thick and fast, the next one
is being held on 7th March in Ullesthorpe, Leicestershire.
&lt;/p&gt;
&lt;p&gt;
This should not be missed as it features 3 speakers, Andrew Woodward, Bill English
and Todd Bleeker.
&lt;/p&gt;
&lt;p&gt;
I've seen both Bill and Todd speak and its an experience ;-)
&lt;/p&gt;
&lt;p&gt;
Put your name on this thread to signup for the meeting &lt;a href="http://suguk.org/forums/2300/ShowThread.aspx#2300"&gt;http://suguk.org/forums/2300/ShowThread.aspx#2300&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=e78c937e-225f-4bff-99de-addf76b4f2dc" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,e78c937e-225f-4bff-99de-addf76b4f2dc.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=cbad89bd-f36a-40dd-9750-ec69665b2504</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=cbad89bd-f36a-40dd-9750-ec69665b2504</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
 
</p>
        <p>
Following on from the work in my previous post where I set the users Picture property
in their profile the next step is to add a Contact Web Part to our imported publishing
pages. I’m using the default layout page to add the contact Web Part to, this page
has the Web Part Zones underneath the content fields but you could use another layout
that has a Web Part zones to the right of the content fields and of course you can
use SharePoint Designer to create your own layout formats and embed the Contact control
without using code. 
</p>
        <p>
This is how our publishing pages will look once we have added the Web Part to each
page
</p>
        <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture4.gif" atomicselection="true">
          <img height="539" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture_thumb2.gif" width="818" />
        </a>
        <p>
        </p>
        <p>
An interesting feature of a Publishing page is that it has a contact property
where you can assign user details to each page, you can either lookup the user from
the picker in which case the page will pull the users details from the profile database
or you can type in the details yourself.
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact3.gif" atomicselection="true">
            <img height="559" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact_thumb1.gif" width="819" />
          </a>
        </p>
        <p>
 
</p>
        <p>
The nice thing about the Contact Web Part is that once you have added it to a publishing
page it will automatically pull the picture and the users description (if set in the
Web Part) that has been assigned to the page from the profile database. 
</p>
        <p>
One bad thing about the part is you only get the choice to put the users name left
or right not top or bottom.
</p>
        <p>
So on to the code, I need a function that will take a site URL and then set the default
Publishing Page’s contact property and then add the Web Part to the page. 
</p>
        <p>
  
</p>
        <p>
 
</p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:78a7f32e-0503-478d-8d7b-5209d97a76b5" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
          <pre style="background-color:White;">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="color: #000000; ">#
Function: Add</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ContactWebPart
# Description: Adds the Contact User Web Part to a publishing page # Parameters: SiteURL </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; "> Server
relative URL of the Area # UserName </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; "> UserName
to show </span>
              <span style="color: #0000FF; ">as</span>
              <span style="color: #000000; "> the
contact </span>
              <span style="color: #0000FF; ">in</span>
              <span style="color: #000000; "> domain\user
format # # Requirements: Needs to have the System.Web assembly loaded # function Add</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ContactWebPart($SiteURL,
$UserName) { $comment </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">Contact
WebPart Added</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $site </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #0000FF; ">new</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #0000FF; ">object</span>
              <span style="color: #000000; "> Microsoft.sharePoint.SPSite($SiteURL)
$web</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$site.OpenWeb()
$user</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; "> $web.Users.get_item($UserName)
$pubweb </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; "> [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$defaultpage</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$pubweb.GetPublishingPages()[$pubweb.DefaultPage]
$defaultpage.CheckOut() # Set Contact </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">Setting
Contact on </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; "> $pubweb.url </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> to </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; "> $user.Name
$defaultpage.set_Contact($user) $defaultpage.Update() $webpartmanager</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$web.GetLimitedWebPartManager($defaultpage.Url,
[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $webpart</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #0000FF; ">new</span>
              <span style="color: #000000; ">-</span>
              <span style="color: #0000FF; ">object</span>
              <span style="color: #000000; "> Microsoft.SharePoint.Portal.WebControls.ContactFieldControl
$webpart.ChromeType</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">[System.Web.UI.WebControls.WebParts.PartChromeType]::TitleOnly;
$webpart.Title</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">Page
Contact</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $webpart.PicturePosition</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">[Microsoft.SharePoint.Portal.WebControls.PictureDirection]::Left
$webpart.IsDisplayJobTitle</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$</span>
              <span style="color: #0000FF; ">true</span>
              <span style="color: #000000; "> $webpart.IsDisplayPicture</span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; ">$</span>
              <span style="color: #0000FF; ">true</span>
              <span style="color: #000000; "> $webpartmanager.AddWebPart($webpart, </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">LeftColumnZone</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">, </span>
              <span style="color: #000000; ">0</span>
              <span style="color: #000000; ">); </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Checking
in page</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $defaultpage.CheckIn($comment)
# Publish </span>
              <span style="color: #0000FF; ">if</span>
              <span style="color: #000000; ">($defaultpage.listItem.ParentList.EnableMinorVersions </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">eq
$</span>
              <span style="color: #0000FF; ">true</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">and
$publishingPage.ListItem.File.MinorVersion </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ne </span>
              <span style="color: #000000; ">0</span>
              <span style="color: #000000; ">)
{ </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Publishing</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $defaultpage.listItem.File.Publish($comment)
} # If moderation </span>
              <span style="color: #0000FF; ">is</span>
              <span style="color: #000000; "> being
used handle the approval </span>
              <span style="color: #0000FF; ">if</span>
              <span style="color: #000000; "> ($defaultpage.listItem.ParentList.EnableModeration)
{ $modInformation </span>
              <span style="color: #000000; ">=</span>
              <span style="color: #000000; "> $defaultpage.listItem.ModerationInformation </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Moderation
on, Current Status: </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; ">
              </span>
              <span style="color: #000000; ">+</span>
              <span style="color: #000000; "> $modInformation.Status
# Check </span>
              <span style="color: #0000FF; ">for</span>
              <span style="color: #000000; "> pending
approval </span>
              <span style="color: #0000FF; ">if</span>
              <span style="color: #000000; ">($modInformation.Status </span>
              <span style="color: #000000; ">-</span>
              <span style="color: #000000; ">ne
[Microsoft.SharePoint.SPModerationStatusType]::Approved) { </span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> Approving</span>
              <span style="color: #000000; ">"</span>
              <span style="color: #000000; "> $defaultpage.ListItem.File.Approve($comment)
} } # Clean up $pubweb.Close() $web.Close() $site.Close() } </span>
            </div>
          </pre>
        </div>
        <p>
 
</p>
        <p>
In this code we find the SPUser object for the given username and set the Contact
property of the PublishingPage to it. We then add the web Part using the new SPLimitedWebPartManager
class. Most of the code is concerned with checking the page out and back in and assumes
the page is not already checked out.
</p>
        <p>
An interesting line is 
</p>
        <p>
$defaultpage=$pubweb.GetPublishingPages()[$pubweb.DefaultPage] 
</p>
        <p>
I'm indexing into the collection return by GetPublishingPages because Powershell doesn't
support generics in the current version.
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=cbad89bd-f36a-40dd-9750-ec69665b2504" />
      </body>
      <title>SharePoint/PowerShell 8: The one with the Contact Web Part</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/02/10/SharePointPowerShell8TheOneWithTheContactWebPart.aspx</link>
      <pubDate>Sat, 10 Feb 2007 20:17:59 GMT</pubDate>
      <description>&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Following on from the work in my previous post where I set the users Picture property
in their profile the next step is to add a Contact Web Part to our imported publishing
pages. I’m using the default layout page to add the contact Web Part to, this page
has the Web Part Zones underneath the content fields but you could use another layout
that has a Web Part zones to the right of the content fields and of course you can
use SharePoint Designer to create your own layout formats and embed the Contact control
without using code. 
&lt;p&gt;
This is how our publishing pages will look once we have added the Web Part to each
page
&lt;/p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture4.gif" atomicselection="true"&gt;&lt;img height="539" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageWithPicture_thumb2.gif" width="818"&gt;&lt;/a&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
An interesting feature&amp;nbsp;of a Publishing page is that it has a contact property
where you can assign user details to each page, you can either lookup the user from
the picker in which case the page will pull the users details from the profile database
or you can type in the details yourself.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact3.gif" atomicselection="true"&gt;&lt;img height="559" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell8TheonewiththeContac_106E6/ContentPageSetContact_thumb1.gif" width="819"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The nice thing about the Contact Web Part is that once you have added it to a publishing
page it will automatically pull the picture and the users description (if set in the
Web Part) that has been assigned to the page from the profile database. 
&lt;/p&gt;
&lt;p&gt;
One bad thing about the part is you only get the choice to put the users name left
or right not top or bottom.
&lt;/p&gt;
&lt;p&gt;
So on to the code, I need a function that will take a site URL and then set the default
Publishing Page’s contact property and then add the Web Part to the page. 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:78a7f32e-0503-478d-8d7b-5209d97a76b5" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000; "&gt;#
Function: Add&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ContactWebPart
# Description: Adds the Contact User Web Part to a publishing page # Parameters: SiteURL &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt; Server
relative URL of the Area # UserName &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt; UserName
to show &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;as&lt;/span&gt;&lt;span style="color: #000000; "&gt; the
contact &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;in&lt;/span&gt;&lt;span style="color: #000000; "&gt; domain\user
format # # Requirements: Needs to have the System.Web assembly loaded # function Add&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ContactWebPart($SiteURL,
$UserName) { $comment &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Contact
WebPart Added&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $site &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;object&lt;/span&gt;&lt;span style="color: #000000; "&gt; Microsoft.sharePoint.SPSite($SiteURL)
$web&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$site.OpenWeb()
$user&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; $web.Users.get_item($UserName)
$pubweb &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$defaultpage&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$pubweb.GetPublishingPages()[$pubweb.DefaultPage]
$defaultpage.CheckOut() # Set Contact &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Setting
Contact on &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; $pubweb.url &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; to &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; $user.Name
$defaultpage.set_Contact($user) $defaultpage.Update() $webpartmanager&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$web.GetLimitedWebPartManager($defaultpage.Url,
[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $webpart&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;object&lt;/span&gt;&lt;span style="color: #000000; "&gt; Microsoft.SharePoint.Portal.WebControls.ContactFieldControl
$webpart.ChromeType&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;[System.Web.UI.WebControls.WebParts.PartChromeType]::TitleOnly;
$webpart.Title&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;Page
Contact&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $webpart.PicturePosition&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;[Microsoft.SharePoint.Portal.WebControls.PictureDirection]::Left
$webpart.IsDisplayJobTitle&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt; $webpart.IsDisplayPicture&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;$&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt; $webpartmanager.AddWebPart($webpart, &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;LeftColumnZone&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt;, &lt;/span&gt;&lt;span style="color: #000000; "&gt;0&lt;/span&gt;&lt;span style="color: #000000; "&gt;); &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Checking
in page&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.CheckIn($comment)
# Publish &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;($defaultpage.listItem.ParentList.EnableMinorVersions &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;eq
$&lt;/span&gt;&lt;span style="color: #0000FF; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;and
$publishingPage.ListItem.File.MinorVersion &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ne &lt;/span&gt;&lt;span style="color: #000000; "&gt;0&lt;/span&gt;&lt;span style="color: #000000; "&gt;)
{ &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Publishing&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.listItem.File.Publish($comment)
} # If moderation &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;is&lt;/span&gt;&lt;span style="color: #000000; "&gt; being
used handle the approval &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt; ($defaultpage.listItem.ParentList.EnableModeration)
{ $modInformation &lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.listItem.ModerationInformation &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Moderation
on, Current Status: &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; &lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt; $modInformation.Status
# Check &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;for&lt;/span&gt;&lt;span style="color: #000000; "&gt; pending
approval &lt;/span&gt;&lt;span style="color: #0000FF; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;($modInformation.Status &lt;/span&gt;&lt;span style="color: #000000; "&gt;-&lt;/span&gt;&lt;span style="color: #000000; "&gt;ne
[Microsoft.SharePoint.SPModerationStatusType]::Approved) { &lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; Approving&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000; "&gt; $defaultpage.ListItem.File.Approve($comment)
} } # Clean up $pubweb.Close() $web.Close() $site.Close() } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
In this code we find the SPUser object for the given username and set the Contact
property of the PublishingPage to it. We then add the web Part using the new SPLimitedWebPartManager
class. Most of the code is concerned with checking the page out and back in and assumes
the page is not already checked out.
&lt;/p&gt;
&lt;p&gt;
An interesting line is 
&lt;/p&gt;
&lt;p&gt;
$defaultpage=$pubweb.GetPublishingPages()[$pubweb.DefaultPage] 
&lt;p&gt;
I'm indexing into the collection return by GetPublishingPages because Powershell doesn't
support generics in the current version.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=cbad89bd-f36a-40dd-9750-ec69665b2504" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,cbad89bd-f36a-40dd-9750-ec69665b2504.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=bb87ad40-0b52-421e-a00e-6ac779fcceca</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,bb87ad40-0b52-421e-a00e-6ac779fcceca.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,bb87ad40-0b52-421e-a00e-6ac779fcceca.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=bb87ad40-0b52-421e-a00e-6ac779fcceca</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Don't forget the SharePoint user group meeting taking place tomorrow Feb 8th
at Reading.
</p>
        <p>
'Mr SharePoint community' Lawrence Lui is over from Redmond to take us through the
Fab 40 Application Templates and lead a discussion on Office 14. 
</p>
        <p>
Sign ups and more detail here: <a href="http://suguk.org/forums/1/1901/ShowThread.aspx">http://suguk.org/forums/1/1901/ShowThread.aspx</a></p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=bb87ad40-0b52-421e-a00e-6ac779fcceca" />
      </body>
      <title>UK SharePoint user group meeting</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,bb87ad40-0b52-421e-a00e-6ac779fcceca.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/02/07/UKSharePointUserGroupMeeting.aspx</link>
      <pubDate>Wed, 07 Feb 2007 13:08:50 GMT</pubDate>
      <description>&lt;p&gt;
Don't forget the SharePoint user group meeting taking place&amp;nbsp;tomorrow Feb 8th
at Reading.
&lt;/p&gt;
&lt;p&gt;
'Mr SharePoint community' Lawrence Lui is over from Redmond to take us through the
Fab 40 Application Templates and lead a discussion on Office 14. 
&lt;/p&gt;
&lt;p&gt;
Sign ups and more detail&amp;nbsp;here: &lt;a href="http://suguk.org/forums/1/1901/ShowThread.aspx"&gt;http://suguk.org/forums/1/1901/ShowThread.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=bb87ad40-0b52-421e-a00e-6ac779fcceca" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,bb87ad40-0b52-421e-a00e-6ac779fcceca.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=a332015d-c5dc-4433-a0f3-247fd37b0b04</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=a332015d-c5dc-4433-a0f3-247fd37b0b04</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Now we have the portal setup I want to add a Contact WebPart to each page but before
I can do that I have to add a picture for each user I have imported, in order to keep
this post a little shorter I’m only going to concentrate on using the UserProfile
API’s to set our picture for each user.<br />
(The Contact WebPart is MOSS WebPart that shows a users name and description and optionally
their picture)<br />
The field that we are going to set programmatically is accessed on the Users edit
profile page as Picture: 
</p>
        <p>
        </p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile%5B7%5D.gif" atomicselection="true">
            <img height="301" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile_thumb%5B5%5D.gif" width="700" />
          </a>
        </p>
        <p>
Once set this will display the picture on the user profile like this
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite%5B4%5D.gif" atomicselection="true">
            <img height="504" src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite_thumb%5B2%5D.gif" width="660" />
          </a>
        </p>
        <p>
          <br />
To do this I need to revisit our User.csv import file and add an extra field that
gives the name of the JPG file that holds the users picture.<br />
I’m going to assume that the previous blog post <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx">Upload
a directory of files in 4 lines</a> has already uploaded the users picture to the
SiteCollectionImages picture library, in real life you’d probably use a separate picture
library. 
</p>
        <p>
          <br />
Ideally a profile import has occurred after we have added the users to Active Directory
and populated the SharePoint profile database. 
<br /></p>
        <p>
Now to set the Users Picture property we know to know the Property Name of the Picture
Field.<br />
To make this easy to find out here’s the first function for our toolbox Get-SPUserProfileConfigManager. 
<br />
This function returns a UserProfileConfigManager (<a href="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)">http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)</a>,
note this is the new class that resides in the Microsoft.Office.Server namespace not
the v2 obsolete one that lives in Microsoft.sharePoint.Portal.UserProfiles.<br />
Also ignore the sample currently given in the MSDN documentation above, it won’t work
as it uses the old classes where you pass a PortalContext to the constructor whereas
the new version of the classes take a ServerContext object.
</p>
        <p>
 
</p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:f03c9c5a-cb1a-407f-b4a6-7b3d8391bdb7" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000"> #
Function: Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileConfigManager
# Description: </span>
              <span style="COLOR: #0000ff">return</span>
              <span style="COLOR: #000000"> a
UserProfileConfigManager </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> which </span>
              <span style="COLOR: #0000ff">is</span>
              <span style="COLOR: #000000"> used </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> management
of MOSS User Profiles # Parameters: PortalURL URL </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> the
Portal Site Collection # # function Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileConfigManager([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL)
{ # Need to </span>
              <span style="COLOR: #0000ff">get</span>
              <span style="COLOR: #000000"> a
PortalContext </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> # </span>
              <span style="COLOR: #0000ff">as</span>
              <span style="COLOR: #000000"> we </span>
              <span style="COLOR: #0000ff">do</span>
              <span style="COLOR: #000000"> not
have a HttpContext we need to source one the hard way $site</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.SharePoint.SPSite($PortalURL)
$servercontext</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileConfigManager </span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)
}</span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
        </p>
        <p>
 
</p>
        <p>
Once we get the UserProfileConfigManager we can call GetProperties and list the internal
and display names for each profile property 
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:df4400ea-56bc-45b0-8597-9d03eebc6046" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: white">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">$cm</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #0000ff">get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">userprofileconfigmanager </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">http://sps:2828</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000"> $cm.getproperties() </span>
              <span style="COLOR: #000000">|</span>
              <span style="COLOR: #000000"> select
name, displayname Name DisplayName </span>
              <span style="COLOR: #000000">----</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">-----------</span>
              <span style="COLOR: #000000"> UserProfile_GUID
Id SID SID ADGuid Active Directory Id AccountName Account name FirstName First name
LastName Last name PreferredName Name WorkPhone Work phone Office Office Department
Department Title Title Manager Manager AboutMe About me PersonalSpace Personal site
PictureURL Picture UserName User name QuickLinks Quick links WebSite Web site PublicSiteRedirect
Public site redirect SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Dotted</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">line
Dotted</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">line
Manager SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Peers
Peers SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Responsibility
Responsibilities SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Skills
Skills SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">PastProjects
Past projects SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Interests
Interests SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">School
Schools SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SipAddress
SIP Address SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Birthday
Birthday SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">MySiteUpgrade
My Site Upgrade SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">DontSuggestList
Don</span>
              <span style="COLOR: #000000">'</span>
              <span style="COLOR: #000000">t Suggest
List </span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">ProxyAddresses
Proxy addresses SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">HireDate
Hire date SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">LastColleagueAdded
Last Colleague Added SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">OWAUrl
Outlook Web Access URL SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">ResourceSID
Resource Forest SID SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">ResourceAccountName
Resource Forest Account Name SPS</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">MasterAccountName
Master Account Name Assistant Assistant WorkEmail Work e</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">mail
CellPhone Mobile phone Fax Fax HomePhone Home phone </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
So from this list I see that I need to set the PictureURL property, to get
a UserProfile we first need a UserProfileManager object: 
</p>
        <p>
        </p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:7c115796-d7b7-4db2-ba54-61b544e8f4f8" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">#
Function: Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPProfileManager
# Description: Return a UserProfileManager </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> which </span>
              <span style="COLOR: #0000ff">is</span>
              <span style="COLOR: #000000"> used </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> accessing
MOSS User Profiles # Parameters: PortalURL URL </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> the
Portal Site Collection # function Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPProfileManager([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL)
{ # Need to </span>
              <span style="COLOR: #0000ff">get</span>
              <span style="COLOR: #000000"> a
PortalContext </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> # </span>
              <span style="COLOR: #0000ff">as</span>
              <span style="COLOR: #000000"> we </span>
              <span style="COLOR: #0000ff">do</span>
              <span style="COLOR: #000000"> not
have a HttpContext we need to source one the hard way $site</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.SharePoint.SPSite($PortalURL)
$servercontext</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileManager </span>
              <span style="COLOR: #0000ff">new</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
} </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
And then a helper function Get-SPUserProfile to obtain the UserProfile object itself:
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:739dfb37-41ea-48a3-a4c5-22392daee3d5" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">#
Function: Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPUserProfile
# Description: Return a UserProfile </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000">, </span>
              <span style="COLOR: #0000ff">this</span>
              <span style="COLOR: #000000"> will
be created </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000"> it
does not exist # Parameters: PortalURL URL </span>
              <span style="COLOR: #0000ff">for</span>
              <span style="COLOR: #000000"> the
Portal Site Collection # DomainUser UserName </span>
              <span style="COLOR: #0000ff">in</span>
              <span style="COLOR: #000000"> Domain\user
format function Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPUserProfile([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL,
[</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">] $DomainUser)
{ $upm</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000"> Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPProfileManager([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$PortalURL) </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000"> ($upm.UserExists($DomainUser) </span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">eq
$</span>
              <span style="COLOR: #0000ff">false</span>
              <span style="COLOR: #000000">) {
$upm.CreateUserProfile($DomainUser) } $upm.GetUserProfile($DomainUser) } </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
        </p>
        <p>
Note that this function will create the UserProfile if it does not already exist. 
</p>
        <p>
Now we just need a function that makes it easy to set a single UserProfile property,
if you have multiple properties to set it would be best to do them all at once and
then call commit. 
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f7de37-2adb-4300-829c-38f405485c2e" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver; WORD-WRAP: break-word">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">#
Function: Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileProperty
# Description: Sets a property on a User Profile # Parameters: UserName [optional]
UserName </span>
              <span style="COLOR: #0000ff">in</span>
              <span style="COLOR: #000000"> Domain\user
format # PropertyName Property to </span>
              <span style="COLOR: #0000ff">set</span>
              <span style="COLOR: #000000"> #
PropertyValue Property Value to </span>
              <span style="COLOR: #0000ff">set</span>
              <span style="COLOR: #000000"> #
$UserProfile UserProfile </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000">, </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">using</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">this</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">in</span>
              <span style="COLOR: #000000"> a
loop </span>
              <span style="COLOR: #0000ff">this</span>
              <span style="COLOR: #000000"> should
be </span>
              <span style="COLOR: #0000ff">set</span>
              <span style="COLOR: #000000"> # function
Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileProperty([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]$UserName,
[</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">] $PropertyName,
[</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">] $PropertyValue,
[Microsoft.Office.Server.UserProfiles.UserProfile] $UserProfile) { # If we are not
passed a UserProfile </span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> then
create it # </span>
              <span style="COLOR: #0000ff">if</span>
              <span style="COLOR: #000000"> ($UserProfile </span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">eq
$</span>
              <span style="COLOR: #0000ff">null</span>
              <span style="COLOR: #000000">) { $UserProfile </span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000"> Get</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">SPUserProfile($UserName)
} $UserProfile[$PropertyName].Value</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000"> $PropertyValue
$UserProfile.Commit() } </span>
            </div>
          </pre>
        </div>
        <p>
Note this function can either be called with a pre-created userProfile object or a
UserName. 
</p>
        <p>
Heres the updated Users.CSV with the Picture Field added at the end   
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:f7247e94-13f2-494c-825d-cb127082faeb" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">LoginName,
DisplayName, FirstName, LastName, Email, Picture brianb, Brian Ballack, Brian, Ballack,
brianb@contoso.com, cowner10.jpg walterf, Walter French, Walter, French, walterf@contoso.com,
cowner12.jpg </span>
            </div>
          </pre>
        </div>
        <p>
Now a function to tie this all together, it imports the CSV files, locates the user
profile by login name and updates the user’s Picture URL: 
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f8305b-c24e-46fc-96f9-efcdf8b8d407" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">function
Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserPictures([</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]
$PortalURL, [</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]
$UserFile, [</span>
              <span style="COLOR: #0000ff">string</span>
              <span style="COLOR: #000000">]
$Domain ) { Import</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">Csv
$UserFile </span>
              <span style="COLOR: #000000">|</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #0000ff">foreach</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #0000ff">object</span>
              <span style="COLOR: #000000"> {
$name</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">$Domain </span>
              <span style="COLOR: #000000">+</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">\"
+ $_.LoginName; </span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000"> $fullURL</span>
              <span style="COLOR: #000000">=</span>
              <span style="COLOR: #000000">$PortalURL </span>
              <span style="COLOR: #000000">+</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">/</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">+</span>
              <span style="COLOR: #000000"> $_.Picture;
Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserProfileProperty
$PortalURL $name </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">PictureURL</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000"> $fullURL
} } </span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
 And you can make use of all of the above code by running this command:
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:15f42277-8809-43c7-8718-b1baf3e0fc66" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
          <pre style="BACKGROUND-COLOR: silver">
            <div>
              <!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
              <span style="COLOR: #000000">Set</span>
              <span style="COLOR: #000000">-</span>
              <span style="COLOR: #000000">UserPictures </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">http://sps:2828</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">users.csv</span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">
              </span>
              <span style="COLOR: #000000">"</span>
              <span style="COLOR: #000000">contoso</span>
              <span style="COLOR: #000000">"</span>
            </div>
          </pre>
        </div>
        <p>
        </p>
        <p>
Ok now we're all set to add the Contact WebPart to each publishing page in the next
post. 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a332015d-c5dc-4433-a0f3-247fd37b0b04" />
      </body>
      <title>SharePoint/PowerShell 7: Put the User in the Picture</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/01/28/SharePointPowerShell7PutTheUserInThePicture.aspx</link>
      <pubDate>Sun, 28 Jan 2007 18:24:37 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Now we have the portal setup I want to add a Contact WebPart to each page but before
I can do that I have to add a picture for each user I have imported, in order to keep
this post a little shorter I’m only going to concentrate on using the UserProfile
API’s to set our picture for each user.&lt;br&gt;
(The Contact WebPart is MOSS WebPart that shows a users name and description and optionally
their picture)&lt;br&gt;
The field that we are going to set programmatically is accessed on the Users edit
profile page as Picture: 
&lt;p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile%5B7%5D.gif" atomicselection="true"&gt;&lt;img height=301 src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BrianB_Profile_thumb%5B5%5D.gif" width=700&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Once set this will display the picture on the user profile like this
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite%5B4%5D.gif" atomicselection="true"&gt;&lt;img height=504 src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/WindowsLiveWriter/SharePointPowerShell7PuttheUserinthePict_EDA6/BriansPersonalSite_thumb%5B2%5D.gif" width=660&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
To do this I need to revisit our User.csv import file and add an extra field that
gives the name of the JPG file that holds the users picture.&lt;br&gt;
I’m going to assume that the previous blog post &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx"&gt;Upload
a directory of files in 4 lines&lt;/a&gt; has already uploaded the users picture to the
SiteCollectionImages picture library, in real life you’d probably use a separate picture
library. 
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
Ideally a profile import has occurred after we have added the users to Active Directory
and populated the SharePoint profile database. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Now to set the Users Picture property we know to know the Property Name of the Picture
Field.&lt;br&gt;
To make this easy to find out here’s the first function for our toolbox Get-SPUserProfileConfigManager. 
&lt;br&gt;
This function returns a UserProfileConfigManager (&lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)"&gt;http://msdn2.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofileconfigmanager.aspx)&lt;/a&gt;,
note this is the new class that resides in the Microsoft.Office.Server namespace not
the v2 obsolete one that lives in Microsoft.sharePoint.Portal.UserProfiles.&lt;br&gt;
Also ignore the sample currently given in the MSDN documentation above, it won’t work
as it uses the old classes where you pass a PortalContext to the constructor whereas
the new version of the classes take a ServerContext object.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:f03c9c5a-cb1a-407f-b4a6-7b3d8391bdb7 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt; #
Function: Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileConfigManager
# Description: &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
UserProfileConfigManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; which &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;is&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; used &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; management
of MOSS User Profiles # Parameters: PortalURL URL &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; the
Portal Site Collection # # function Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileConfigManager([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL)
{ # Need to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
PortalContext &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; # &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;as&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; we &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;do&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; not
have a HttpContext we need to source one the hard way $site&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.SharePoint.SPSite($PortalURL)
$servercontext&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileConfigManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)
}&lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Once we get the UserProfileConfigManager we can call GetProperties and list the internal
and display names for each profile property 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:df4400ea-56bc-45b0-8597-9d03eebc6046 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;$cm&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;userprofileconfigmanager &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;http://sps:2828&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $cm.getproperties() &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;|&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; select
name, displayname Name DisplayName &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;----&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-----------&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; UserProfile_GUID
Id SID SID ADGuid Active Directory Id AccountName Account name FirstName First name
LastName Last name PreferredName Name WorkPhone Work phone Office Office Department
Department Title Title Manager Manager AboutMe About me PersonalSpace Personal site
PictureURL Picture UserName User name QuickLinks Quick links WebSite Web site PublicSiteRedirect
Public site redirect SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Dotted&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;line
Dotted&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;line
Manager SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Peers
Peers SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Responsibility
Responsibilities SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Skills
Skills SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;PastProjects
Past projects SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Interests
Interests SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;School
Schools SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SipAddress
SIP Address SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Birthday
Birthday SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;MySiteUpgrade
My Site Upgrade SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;DontSuggestList
Don&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;'&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;t Suggest
List &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;ProxyAddresses
Proxy addresses SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;HireDate
Hire date SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;LastColleagueAdded
Last Colleague Added SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;OWAUrl
Outlook Web Access URL SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;ResourceSID
Resource Forest SID SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;ResourceAccountName
Resource Forest Account Name SPS&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;MasterAccountName
Master Account Name Assistant Assistant WorkEmail Work e&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;mail
CellPhone Mobile phone Fax Fax HomePhone Home phone &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
So from this list I&amp;nbsp;see that I&amp;nbsp;need to set the PictureURL property, to get
a UserProfile we first need a UserProfileManager object: 
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:7c115796-d7b7-4db2-ba54-61b544e8f4f8 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;#
Function: Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPProfileManager
# Description: Return a UserProfileManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; which &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;is&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; used &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; accessing
MOSS User Profiles # Parameters: PortalURL URL &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; the
Portal Site Collection # function Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPProfileManager([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL)
{ # Need to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
PortalContext &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; # &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;as&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; we &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;do&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; not
have a HttpContext we need to source one the hard way $site&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.SharePoint.SPSite($PortalURL)
$servercontext&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up # Return the UserProfileManager &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
} &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
And then a helper function Get-SPUserProfile to obtain the UserProfile object itself:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:739dfb37-41ea-48a3-a4c5-22392daee3d5 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;#
Function: Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPUserProfile
# Description: Return a UserProfile &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;this&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; will
be created &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; it
does not exist # Parameters: PortalURL URL &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;for&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; the
Portal Site Collection # DomainUser UserName &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Domain\user
format function Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPUserProfile([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL,
[&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;] $DomainUser)
{ $upm&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPProfileManager([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$PortalURL) &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ($upm.UserExists($DomainUser) &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;eq
$&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;false&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;) {
$upm.CreateUserProfile($DomainUser) } $upm.GetUserProfile($DomainUser) } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Note that this function will create the UserProfile if it does not already exist. 
&lt;/p&gt;
&lt;p&gt;
Now we just need a function that makes it easy to set a single UserProfile property,
if you have multiple properties to set it would be best to do them all at once and
then call commit. 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f7de37-2adb-4300-829c-38f405485c2e contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver; WORD-WRAP: break-word"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;#
Function: Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileProperty
# Description: Sets a property on a User Profile # Parameters: UserName [optional]
UserName &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Domain\user
format # PropertyName Property to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; #
PropertyValue Property Value to &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; #
$UserProfile UserProfile &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;, &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;using&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;this&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; a
loop &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;this&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; should
be &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; # function
Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileProperty([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]$UserName,
[&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;] $PropertyName,
[&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;] $PropertyValue,
[Microsoft.Office.Server.UserProfiles.UserProfile] $UserProfile) { # If we are not
passed a UserProfile &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; then
create it # &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ($UserProfile &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;eq
$&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;null&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;) { $UserProfile &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;SPUserProfile($UserName)
} $UserProfile[$PropertyName].Value&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $PropertyValue
$UserProfile.Commit() } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Note this function can either be called with a pre-created userProfile object or a
UserName. 
&lt;p&gt;
Heres the updated Users.CSV with the Picture Field added at the end&amp;nbsp;&amp;nbsp; 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:f7247e94-13f2-494c-825d-cb127082faeb contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;LoginName,
DisplayName, FirstName, LastName, Email, Picture brianb, Brian Ballack, Brian, Ballack,
brianb@contoso.com, cowner10.jpg walterf, Walter French, Walter, French, walterf@contoso.com,
cowner12.jpg &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Now a function to tie this all together, it imports the CSV files, locates the user
profile by login name and updates the user’s Picture URL: 
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:08f8305b-c24e-46fc-96f9-efcdf8b8d407 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;function
Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserPictures([&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]
$PortalURL, [&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]
$UserFile, [&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;]
$Domain ) { Import&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Csv
$UserFile &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;|&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;foreach&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; {
$name&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;$Domain &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;+&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;\"
+ $_.LoginName; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $fullURL&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;$PortalURL &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;+&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;/&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;+&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $_.Picture;
Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserProfileProperty
$PortalURL $name &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;PictureURL&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; $fullURL
} } &lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;And you can make use of all of the above code by running this command:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:15f42277-8809-43c7-8718-b1baf3e0fc66 contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: silver"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;Set&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;-&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;UserPictures &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;http://sps:2828&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;users.csv&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;contoso&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Ok now we're all set to add the Contact WebPart to each publishing page in the next
post. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a332015d-c5dc-4433-a0f3-247fd37b0b04" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=15354d79-3b26-4d8e-b856-5e42628de0ab</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,15354d79-3b26-4d8e-b856-5e42628de0ab.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,15354d79-3b26-4d8e-b856-5e42628de0ab.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=15354d79-3b26-4d8e-b856-5e42628de0ab</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just finished finalising the flights and hotels to attend the <a href="http://www.sharepoint-conference.eu/">SharePoint
2007 European Conference</a> in Berlin today when I realised I knew zip about the
German language, yes I know the usual German words picked up from films, schnell,
bitte etc. but I'd never spoken one single german phrase for real.
</p>
        <p>
Whatever country I go to I try to speak a little of the local language, if nothing
else it gives the waiters a laugh, so I needed a quick and easy starters course
in German, a little Googling and I found this gem <a href="http://german-podcast.blogspot.com/2007/01/welcome-to-german-podcast.html">German
Podcasts</a> by <span class="value">Stephan Wiesner</span><br /></p>
        <p>
This is fantastic, its a series of podcasts where Stephan takes you through a story
teaching you German as he goes about a Hans a German progammer who flies into an airport,
goes through customs and talks about a conference he's been at!
</p>
        <p>
The story is nicely pitched at the complete beginner and Stephan has produced mp3's,
pdfs to accompany and even a video.
</p>
        <p>
The content is also posted at <a href="http://www.archive.org/search.php?query=%22german-podcast%22">http://www.archive.org</a> which
lets you listen on the webpage itself via a Flash plugin.
</p>
        <p>
I wonder can he do a podcast that teaches me how to say: 'What?? you're NOT using
PowerShell to script SharePoint?'
</p>
        <p>
 
</p>
        <p>
 
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=15354d79-3b26-4d8e-b856-5e42628de0ab" />
      </body>
      <title>Spreken zie SharePoint?</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,15354d79-3b26-4d8e-b856-5e42628de0ab.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2007/01/11/SprekenZieSharePoint.aspx</link>
      <pubDate>Thu, 11 Jan 2007 18:12:07 GMT</pubDate>
      <description>&lt;p&gt;
I just finished finalising the flights and hotels to attend the &lt;a href="http://www.sharepoint-conference.eu/"&gt;SharePoint
2007 European Conference&lt;/a&gt; in Berlin today when I realised I knew zip about the
German language, yes&amp;nbsp;I know the usual German words picked up from films, schnell,
bitte&amp;nbsp;etc. but I'd never spoken one single german phrase for real.
&lt;/p&gt;
&lt;p&gt;
Whatever country I go to I try to speak a little of the local language, if nothing
else it gives the waiters a laugh,&amp;nbsp;so I needed a quick and easy starters course
in German, a little Googling and I found this gem &lt;a href="http://german-podcast.blogspot.com/2007/01/welcome-to-german-podcast.html"&gt;German
Podcasts&lt;/a&gt;&amp;nbsp;by &lt;span class=value&gt;Stephan Wiesner&lt;/span&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
This is fantastic, its a series of podcasts where Stephan takes you through a story
teaching you German as he goes about a Hans a German progammer who flies into an airport,
goes through customs&amp;nbsp;and talks about a conference he's been at!
&lt;/p&gt;
&lt;p&gt;
The story is nicely pitched at the complete beginner and Stephan has produced mp3's,
pdfs to accompany and even a video.
&lt;/p&gt;
&lt;p&gt;
The content is also posted at&amp;nbsp;&lt;a href="http://www.archive.org/search.php?query=%22german-podcast%22"&gt;http://www.archive.org&lt;/a&gt; which
lets you listen on the webpage itself via a Flash plugin.
&lt;/p&gt;
&lt;p&gt;
I wonder can he do a podcast that teaches me how to say: 'What?? you're&amp;nbsp;NOT using
PowerShell to script SharePoint?'
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=15354d79-3b26-4d8e-b856-5e42628de0ab" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,15354d79-3b26-4d8e-b856-5e42628de0ab.aspx</comments>
      <category>SharePoint</category>
      <category>Conference</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=bc62e425-3328-47f3-a7b8-b828e3aa0755</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,bc62e425-3328-47f3-a7b8-b828e3aa0755.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,bc62e425-3328-47f3-a7b8-b828e3aa0755.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=bc62e425-3328-47f3-a7b8-b828e3aa0755</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>MOSS Personal Sites - Sizing up</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,bc62e425-3328-47f3-a7b8-b828e3aa0755.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/12/17/MOSSPersonalSitesSizingUp.aspx</link>
      <pubDate>Sun, 17 Dec 2006 16:58:38 GMT</pubDate>
      <description>&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;As a follow on from my &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0afe1aa7-010d-4cbb-bbfc-2cc275b08951.aspx"&gt;previous
post&lt;/a&gt; we can do some neat calculations on the amount of data stored in MOSS personal
sites using Powershell.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;Using the measure-object CmdLet against the StorageUsedMB property
we can&amp;nbsp;calculate the number of personal sites (+1 one as it includes the root
site), average size of of each site, smallest, largest and total storage size of all
sites.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;Again assuming &lt;/font&gt;&lt;a href="http://sps:20488/"&gt;http://sps:20488&lt;/a&gt;&lt;font color=#000000&gt; is
where your personal sites are hosted&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;PoSH
C:\demo&amp;gt; $output=stsadm -o enumsites -url &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://sps:20488"&lt;/span&gt;
&lt;br&gt;
PoSH C:\demo&amp;gt; $xml=[XML]$output&lt;br&gt;
PoSH C:\demo&amp;gt; $xml.sites.site &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; measure-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; storageusedmb
-min -max -sum -average &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; format-table&lt;br&gt;
&lt;br&gt;
Count Average Sum Maximum Minimum Property 
&lt;br&gt;
----- ------- --- ------- ------- -------- 
&lt;br&gt;
5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.62&amp;nbsp;&amp;nbsp; 3.1 0.7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StorageUs...&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;To get a list of the sites in question with the largest at the
top use -descending on the sort CmdLet:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;PoSH
C:\demo&amp;gt; $xml.sites.site &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; sort
storageusedmb -descending &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; select
url, owner, storageusedMB &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; format-table&lt;br&gt;
&lt;br&gt;
Url&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Owner&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
StorageUsedMB 
&lt;br&gt;
---&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
-----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
------------- 
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/person...
CONTOSO\mike&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
0.7 &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/person...
CONTOSO\jeff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
0.7 &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/person...
CONTOSO\administrator&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.7 &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
CONTOSO\administrator&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.6 &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/person...
CONTOSO\brianb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4 &lt;/span&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;And if you just want the top 2 offenders us the -first option
on the select-object CmdLet&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;PoSH
C:\demo&amp;gt; $xml.sites.site &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; sort
storageusedmb -descending &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; select
url, owner, storageusedMB -first 2 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; format-table&lt;br&gt;
&lt;br&gt;
Url Owner StorageUsedMB 
&lt;br&gt;
--- ----- ------------- 
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/person...
CONTOSO\mike 0.7 &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/person...
CONTOSO\jeff 0.7 &lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;p&gt;&lt; P&gt;
Obviously in real life those figures would be a lot larger!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=bc62e425-3328-47f3-a7b8-b828e3aa0755" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,bc62e425-3328-47f3-a7b8-b828e3aa0755.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=0afe1aa7-010d-4cbb-bbfc-2cc275b08951</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0afe1aa7-010d-4cbb-bbfc-2cc275b08951.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0afe1aa7-010d-4cbb-bbfc-2cc275b08951.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=0afe1aa7-010d-4cbb-bbfc-2cc275b08951</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt">
          <font color="#000000">A point came up at the UK SharePoint User Group Chrismas drink,
about Personal sites and whether they were top level sites i.e they exist as records
in the Sites table and are the top level container for all its subwebs, I hadn’t checked
this in v3 so a quick check with PowerShell and stsadm confirms that this is still
the case as in V2</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt">
          <font color="#000000">Assuming </font>
          <a href="http://sps:20488/">http://sps:20488</a>
          <font color="#000000"> is
where your personal sites are hosted calling stsadm -o enumsites and processing the
returned XML in PowerShell gives us</font>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">PoSH
C:\demo&gt; $output=stsadm -o enumsites -url <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://sps:20488"</span><br />
PoSH C:\demo&gt; $xml=[XML]$output<br />
PoSH C:\demo&gt; $xml.sites.site<br /><br />
Url : http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488</span><br />
Owner : CONTOSO\administrator<br />
ContentDatabase : WSS_Content_11fba01f-f0c4-4a05-a3c3-868499fd31ce<br />
StorageUsedMB : 0.6<br />
StorageWarningMB : 0<br />
StorageMaxMB : 0<br /><br />
Url : http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488/personal/administrator</span><br />
Owner : CONTOSO\administrator<br />
ContentDatabase : WSS_Content_11fba01f-f0c4-4a05-a3c3-868499fd31ce<br />
StorageUsedMB : 0.7<br />
StorageWarningMB : 80<br />
StorageMaxMB : 100<br />
Etc…</span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt">
            <font face="Verdana" size="2">Tiding up the output a little</font>
            <font face="Calibri" size="3">
            </font>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">PoSH
C:\demo&gt; $xml.sites.site | select url, owner<br /><br />
Url Owner 
<br />
--- ----- 
<br />
http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488                           CONTOSO\administrator </span><br />
http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488/personal/administrator    CONTOSO\administrator </span><br />
http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488/personal/brianb          
CONTOSO\brianb </span><br />
http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488/personal/jeff             CONTOSO\jeff </span><br />
http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sps:20488/personal/mike            
CONTOSO\mike</span><br />
….<br /></span>
          </p>
        </span>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span> 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"> 
</span>
        </p>
        <p>
          <br />
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0afe1aa7-010d-4cbb-bbfc-2cc275b08951" />
      </body>
      <title>MOSS Personal Sites – Still Top Level </title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0afe1aa7-010d-4cbb-bbfc-2cc275b08951.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/12/17/MOSSPersonalSitesStillTopLevel.aspx</link>
      <pubDate>Sun, 17 Dec 2006 16:40:58 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;A point came up at the UK SharePoint User Group Chrismas drink,
about Personal sites and whether they were top level sites i.e they exist as records
in the Sites table and are the top level container for all its subwebs, I hadn’t checked
this in v3 so a quick check with PowerShell and stsadm confirms that this is still
the case as in V2&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font color=#000000&gt;Assuming &lt;/font&gt;&lt;a href="http://sps:20488/"&gt;http://sps:20488&lt;/a&gt;&lt;font color=#000000&gt; is
where your personal sites are hosted calling stsadm -o enumsites and processing the
returned XML in PowerShell gives us&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;PoSH
C:\demo&amp;gt; $output=stsadm -o enumsites -url &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://sps:20488"&lt;/span&gt;
&lt;br&gt;
PoSH C:\demo&amp;gt; $xml=[XML]$output&lt;br&gt;
PoSH C:\demo&amp;gt; $xml.sites.site&lt;br&gt;
&lt;br&gt;
Url : http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488&lt;/span&gt;
&lt;br&gt;
Owner : CONTOSO\administrator&lt;br&gt;
ContentDatabase : WSS_Content_11fba01f-f0c4-4a05-a3c3-868499fd31ce&lt;br&gt;
StorageUsedMB : 0.6&lt;br&gt;
StorageWarningMB : 0&lt;br&gt;
StorageMaxMB : 0&lt;br&gt;
&lt;br&gt;
Url : http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/personal/administrator&lt;/span&gt;
&lt;br&gt;
Owner : CONTOSO\administrator&lt;br&gt;
ContentDatabase : WSS_Content_11fba01f-f0c4-4a05-a3c3-868499fd31ce&lt;br&gt;
StorageUsedMB : 0.7&lt;br&gt;
StorageWarningMB : 80&lt;br&gt;
StorageMaxMB : 100&lt;br&gt;
Etc…&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;
&lt;font face=Verdana size=2&gt;Tiding up the output a little&lt;/font&gt;&lt;font face=Calibri size=3&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;PoSH
C:\demo&amp;gt; $xml.sites.site | select url, owner&lt;br&gt;
&lt;br&gt;
Url Owner 
&lt;br&gt;
--- ----- 
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CONTOSO\administrator &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/personal/administrator&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CONTOSO\administrator &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/personal/brianb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
CONTOSO\brianb &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/personal/jeff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CONTOSO\jeff &lt;/span&gt;
&lt;br&gt;
http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sps:20488/personal/mike&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
CONTOSO\mike&lt;/span&gt;
&lt;br&gt;
….&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&gt;&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0afe1aa7-010d-4cbb-bbfc-2cc275b08951" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0afe1aa7-010d-4cbb-bbfc-2cc275b08951.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=31fe0d50-0d39-4768-b657-fc32bc761ea0</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,31fe0d50-0d39-4768-b657-fc32bc761ea0.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,31fe0d50-0d39-4768-b657-fc32bc761ea0.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=31fe0d50-0d39-4768-b657-fc32bc761ea0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Yes...Fitz is blogging again. At last Mike Fitzmaurice one of the primary links
between the SharePoint team and the outside world is <a href="http://blogs.msdn.com/mikefitz/archive/2006/08/21/okay-okay-i-ll-start-blogging-again.aspx">blogging</a> again.
</p>
        <p>
No...Maurice Prather one of the few hardcore SharePoint bloggers around has posted
that he is <a href="http://www.bluedoglimited.com/SharePointThoughts/default.aspx">leaving
the SharePoint team</a>. That's a real loss, overall compared to say the PowerShell
team the state of blogging from the SharePoint team has been really poor over the
last year, but as blogs come second best to shipping a product out the door perhaps
that's understandable, hopefully things will improve once the RTM celebrations have
finished.  
</p>
        <p>
          <a href="http://blogs.msdn.com/mikefitz/archive/2006/08/21/okay-okay-i-ll-start-blogging-again.aspx">
          </a> 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=31fe0d50-0d39-4768-b657-fc32bc761ea0" />
      </body>
      <title>Fitz is blogging but Maurice is leaving</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,31fe0d50-0d39-4768-b657-fc32bc761ea0.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/11/19/FitzIsBloggingButMauriceIsLeaving.aspx</link>
      <pubDate>Sun, 19 Nov 2006 15:34:24 GMT</pubDate>
      <description>&lt;p&gt;
Yes...Fitz is blogging again. At last Mike Fitzmaurice&amp;nbsp;one of the primary links
between the SharePoint team and the outside world is &lt;a href="http://blogs.msdn.com/mikefitz/archive/2006/08/21/okay-okay-i-ll-start-blogging-again.aspx"&gt;blogging&lt;/a&gt; again.
&lt;/p&gt;
&lt;p&gt;
No...Maurice Prather one of the few hardcore SharePoint bloggers around has posted
that he is &lt;a href="http://www.bluedoglimited.com/SharePointThoughts/default.aspx"&gt;leaving
the SharePoint team&lt;/a&gt;. That's a real loss, overall compared to say the PowerShell
team the state of blogging from the SharePoint team has been really poor over the
last year, but as blogs come second best to shipping a product out the door perhaps
that's understandable, hopefully things will improve once the RTM celebrations have
finished.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.msdn.com/mikefitz/archive/2006/08/21/okay-okay-i-ll-start-blogging-again.aspx"&gt;&lt;/a&gt;&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=31fe0d50-0d39-4768-b657-fc32bc761ea0" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,31fe0d50-0d39-4768-b657-fc32bc761ea0.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=7ad355ec-75f5-4edd-bf9f-f396085a85e5</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,7ad355ec-75f5-4edd-bf9f-f396085a85e5.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,7ad355ec-75f5-4edd-bf9f-f396085a85e5.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=7ad355ec-75f5-4edd-bf9f-f396085a85e5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ok now we have the users in AD we can add them to the portal. Again we can use import-csv
to add them from the users CSV file
</p>
        <p>
heres the routine 
</p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#
Function:         Add-UsersToSP<br />
# Description:        Add each user <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> the
import CSV file to the given role 
<br />
# Parameters:        SiteCollectionURL     URL <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span> the
root of the Site Collection    <br />
#            UserFile
        Location of the CSV file containing
the users<br />
#            Domain            Users
domain<br />
#            Role             Name
of the SharePoint Role e.g Reader, Contribute<br />
#<br />
function Add-UsersToSP([<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$SiteCollectionURL,[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$UserFile,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$Domain,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$Role)<br />
{<br />
Import-Csv $UserFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> {$spsite=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> Microsoft.SharePoint.SPSite($SiteCollectionURL)
} {$spsite.RootWeb.Roles[$Role].AddUser($Domain <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"\"
+ $_.LoginName, $_.Email, $_.DisplayName, "</span>") } 
<br />
}</span>
          </p>
          <p>
          </p>
        </span>In this script we get a SPSite object, get its rootweb and index into the
roles collection to return the role we want. We then use the AddUser method to add
the user.
<p>
And we call it like this Add-UsersToSP "<a href="http://sps:2828/">http://sps:2828</a>"
"users.csv" "contoso" "contribute"
</p><p>
Now there is something a little different going on in this script. In the foreach-object
loop there are 2 scriptblocks (the curly braces). This is because you can have up
to 3 scriptblocks in the foreach clause: Begin, Process and End
</p><p>
The Begin scriptblock will be called once at the start of the iteration, Process is
called for each object in the collection and End will be called at yes the end of
the iteration allowing you to clean up your objects. I don't have an end in this case
but you could call dispose on the SPSite object.
</p><p>
In v3 the Roles collection is deprecated and you should start using the new SPRoleDefinition
and SPRoleAssignment classes. These new classes have full support for the new
security features but for now I'm keeping things as simple as I can. 
</p><p>
Now is a good time to point out how easy it is to explore the SharePoint OM interactively,
in this case the Roles collection.
</p><p>
First of all from the command line do this
</p><p>
PS C:\demo&gt; $spsite=new-object microsoft.sharepoint.spsite("<a href="http://sps:2828">http://sps:2828</a>")<br />
PS C:\demo&gt; $spsite.rootweb.roles
</p><p>
this produces a listing like this
</p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Name
: Full Control<br />
Users : {}<br />
Groups : {SUGUK Intranet Owners}<br />
Type : Administrator<br />
Description : Has full control.<br />
Xml : &lt;Role ID=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1073741829"</span> Name=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Full
Control"</span> Description=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Has
ful<br />
l control."</span> Type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"5"</span> /&gt;<br />
ID : 1073741829<br />
PermissionMask : FullMask<br />
ParentWeb : SUGUK Intranet<br /><br />
Name : Design<br />
Users : {}<br />
Groups : {Designers}<br />
Type : WebDesigner<br />
Description : Can view, add, update, delete, approve, and customize.<br />
Xml : &lt;Role ID=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1073741828"</span> Name=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Design"</span> Description=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Can
view, add<br />
, update, delete, approve, and customize."</span> Type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"4"</span> /&gt;<br />
ID : 1073741828<br />
PermissionMask : 1012866047<br />
ParentWeb : SUGUK Intranet<br /></span></p><p>
.....
</p><p>
You can use the select CmdLet to produce a simple table listing
</p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">PS C:\demo&gt;
$spsite.rootweb.roles | select name, users</font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">Name                                   
Users                                  
<br />
----                                   
-----                                  
<br />
Full Control                           
{}                                     
<br />
Design                                 
{}                                     
<br />
Manage Hierarchy                   {}                                     
<br />
Approve                                {}                                     
<br />
Contribute                             {Brian
Ballack, Walter French}         
<br />
Read                                   
{}                                     
<br />
Restricted Read                      {}                                     
<br />
Limited Access                       {NT
AUTHORITY\authenticated users, S...<br />
View Only                              {}   </font></span></p><p>
 
</p><p>
If we want to see the full object of say the RootWeb you can do this
</p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">PS C:\demo&gt;
$spsite.rootweb | get-member</font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">or
just its properties </font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">PS C:\demo&gt;
$spsite.rootweb | get-member -membertype property</font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">or
just its methods</font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">PS C:\demo&gt;
$spsite.rootweb | get-member -membertype methods </font></span></font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">I
find myself using this lot before coding C# against an object as I can try out
the API and mess around with it before running up VS2005 </font></span></font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2">The
next step will be to create a host of portal areas as defined in a CSV file.</font></span></font></span></p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"></span></font></span> 
</p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"></span></font></span> 
</p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"></span></font></span> 
</p><p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font face="Verdana" color="#003300" size="2"></font></span> 
</p><p>
 
</p><img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=7ad355ec-75f5-4edd-bf9f-f396085a85e5" /></body>
      <title>SharePoint/PowerShell 3: Now add the users to SharePoint</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,7ad355ec-75f5-4edd-bf9f-f396085a85e5.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/11/01/SharePointPowerShell3NowAddTheUsersToSharePoint.aspx</link>
      <pubDate>Wed, 01 Nov 2006 20:05:34 GMT</pubDate>
      <description>&lt;p&gt;
Ok now we have the users in AD we can add them to the portal. Again we can use import-csv
to add them from the users CSV file
&lt;/p&gt;
&lt;p&gt;
heres the routine 
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;#
Function: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Add-UsersToSP&lt;br&gt;
# Description:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Add each user &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; the
import CSV file to the given role 
&lt;br&gt;
# Parameters:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SiteCollectionURL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;URL &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;for&lt;/span&gt; the
root of the Site Collection&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserFile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Location of the CSV file containing
the users&lt;br&gt;
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Domain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Users
domain&lt;br&gt;
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Role &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name
of the SharePoint Role e.g Reader, Contribute&lt;br&gt;
#&lt;br&gt;
function Add-UsersToSP([&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$SiteCollectionURL,[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$UserFile,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$Domain,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$Role)&lt;br&gt;
{&lt;br&gt;
Import-Csv $UserFile &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; {$spsite=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; Microsoft.SharePoint.SPSite($SiteCollectionURL)
} {$spsite.RootWeb.Roles[$Role].AddUser($Domain &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"\"
+ $_.LoginName, $_.Email, $_.DisplayName, "&lt;/span&gt;") } 
&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/span&gt;In this script we get a SPSite object, get its rootweb and index into the roles
collection to return the role we want. We then use the AddUser method to add the user.&gt;
&lt;p&gt;
And we call it like this Add-UsersToSP "&lt;a href="http://sps:2828/"&gt;http://sps:2828&lt;/a&gt;"
"users.csv" "contoso" "contribute"
&lt;/p&gt;
&lt;p&gt;
Now there is something a little different going on in this script. In the foreach-object
loop there are 2 scriptblocks (the curly braces). This is because you can have up
to 3 scriptblocks in the foreach clause: Begin,&amp;nbsp;Process and End
&lt;/p&gt;
&lt;p&gt;
The Begin scriptblock will be called once at the start of the iteration, Process is
called for each object in the collection and End will be called at yes the end of
the iteration allowing you to clean up your objects. I don't have an end in this case
but you could call dispose on the SPSite object.
&lt;/p&gt;
&lt;p&gt;
In v3 the Roles collection is deprecated and you should start using the new SPRoleDefinition
and&amp;nbsp;SPRoleAssignment classes. These new classes have full support for the new
security features but for now I'm keeping things as simple as I can.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Now is a good time to point out how easy it is to explore the SharePoint OM interactively,
in this case the Roles collection.
&lt;/p&gt;
&lt;p&gt;
First of all from the command line do this
&lt;/p&gt;
&lt;p&gt;
PS&amp;nbsp;C:\demo&amp;gt; $spsite=new-object microsoft.sharepoint.spsite("&lt;a href="http://sps:2828"&gt;http://sps:2828&lt;/a&gt;")&lt;br&gt;
PS&amp;nbsp;C:\demo&amp;gt; $spsite.rootweb.roles
&lt;/p&gt;
&lt;p&gt;
this produces a listing like this
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Name
: Full Control&lt;br&gt;
Users : {}&lt;br&gt;
Groups : {SUGUK Intranet Owners}&lt;br&gt;
Type : Administrator&lt;br&gt;
Description : Has full control.&lt;br&gt;
Xml : &amp;lt;Role ID=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"1073741829"&lt;/span&gt; Name=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Full
Control"&lt;/span&gt; Description=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Has
ful&lt;br&gt;
l control."&lt;/span&gt; Type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"5"&lt;/span&gt; /&amp;gt;&lt;br&gt;
ID : 1073741829&lt;br&gt;
PermissionMask : FullMask&lt;br&gt;
ParentWeb : SUGUK Intranet&lt;br&gt;
&lt;br&gt;
Name : Design&lt;br&gt;
Users : {}&lt;br&gt;
Groups : {Designers}&lt;br&gt;
Type : WebDesigner&lt;br&gt;
Description : Can view, add, update, delete, approve, and customize.&lt;br&gt;
Xml : &amp;lt;Role ID=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"1073741828"&lt;/span&gt; Name=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Design"&lt;/span&gt; Description=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Can
view, add&lt;br&gt;
, update, delete, approve, and customize."&lt;/span&gt; Type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"4"&lt;/span&gt; /&amp;gt;&lt;br&gt;
ID : 1073741828&lt;br&gt;
PermissionMask : 1012866047&lt;br&gt;
ParentWeb : SUGUK Intranet&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
.....
&lt;/p&gt;
&lt;p&gt;
You can use the select CmdLet to produce a simple table listing
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;PS&amp;nbsp;C:\demo&amp;gt;
$spsite.rootweb.roles | select name, users&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Users&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
-----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Full Control&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Design&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Manage Hierarchy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Approve&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Contribute&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{Brian
Ballack, Walter French}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Read&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Restricted Read&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
Limited Access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{NT
AUTHORITY\authenticated users, S...&lt;br&gt;
View Only&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{}&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
If we want to see the full object of say the RootWeb you can do this
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;PS&amp;nbsp;C:\demo&amp;gt;
$spsite.rootweb | get-member&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;or
just its properties &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;PS&amp;nbsp;C:\demo&amp;gt;
$spsite.rootweb | get-member -membertype property&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;or
just its methods&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;PS&amp;nbsp;C:\demo&amp;gt;
$spsite.rootweb | get-member -membertype methods &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;I
find myself using this&amp;nbsp;lot before coding C# against an object as I can try out
the API and mess around with it before running up VS2005 &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;The
next step will be to create a host of portal areas as defined in a CSV file.&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=7ad355ec-75f5-4edd-bf9f-f396085a85e5" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,7ad355ec-75f5-4edd-bf9f-f396085a85e5.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=00544739-c0e8-42f2-aa30-2105b873ddfe</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,00544739-c0e8-42f2-aa30-2105b873ddfe.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,00544739-c0e8-42f2-aa30-2105b873ddfe.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=00544739-c0e8-42f2-aa30-2105b873ddfe</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Step 2 in our series is to add some users to Active Directory.
</p>
        <p>
First we need a simple routine to add users to Active Directory
</p>
        <p>
Update 3-11-2006 : The original add-aduser would only work in versions of PowerShell
pre RC2. RC2 included some breaking changes to how the DirectoryEntry object handled.
I;ve added an RC2 compatible routine.
</p>
        <p>
          <font color="#ff0000">Pre RC2 version</font>
        </p>
        <p>
          <hr />
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">function
add-aduser([<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$LoginName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$DisplayName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$FirstName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$LastName)<br />
{<br /><br />
    $cn=$LoginName<br />
    $sam=$LoginName<br />
    $pw=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"P@ssword1"</span><br /><br /><br />
    $ad= <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> System.DirectoryServices.DirectoryEntry 
<br />
    $u <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $ad.get_Children().Find(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CN=Users"</span>) 
<br />
    $NewUser <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $u.get_Children().add(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CN=$cn"</span>,'User') 
<br /><br />
    <br />
    $NewUser.InvokeSet(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"sAMAccountName"</span>,$sam)<br />
    $NewUser.InvokeSet(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"displayName"</span>,$DisplayName)<br />
    $NewUser.InvokeSet(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"FirstName"</span>,$FirstName)<br />
    $NewUser.InvokeSet(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"LastName"</span>,$LastName)<br />
    <br />
    $NewUser.CommitChanges() 
<br /><br />
    $ad=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> System.DirectoryServices.DirectoryEntry 
<br />
    $u <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $ad.get_Children().Find(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CN=Users"</span>) 
<br /><br />
    $NewUser= $u.get_Children().Find(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CN=$cn"</span>);<br />
    $NewUser.Invoke(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SetPassword"</span>,$pw) 
<br />
    $NewUser.InvokeSet(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"AccountDisabled"</span>,$<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>) 
<br /><br />
    # set that the password never expires<br />
    $NewUser.userAccountControl[0] <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $NewUser.userAccountControl[0]
-bor (65536) 
<br /><br />
    $NewUser.CommitChanges() 
<br /><br />
}<br /><br /></span>
        </p>
        <p>
 
</p>
        <p>
          <font color="#ff0000">RC2 Version</font>
        </p>
        <p>
          <hr />
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">function
add-aduser([<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$LoginName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$DisplayName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$FirstName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$LastName)</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">{<br /><br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   $cn=$LoginName<br />
   $sam=$LoginName<br />
   $pw=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"P@ssword1"</span><br /><br />
   # Get an ADSI <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span> the <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">default</span> domain<br />
   $ad= [ADSI]<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">""</span><br /><br />
   # Get the Users OU <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">default</span><br />
   $ou <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $ad.psbase.Children.Find(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CN=Users"</span>)<br /><br />
   # Add the user<br />
   $NewUser <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $ou.psbase.Children.Add(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CN=$cn"</span>,'User') <br /><br />
   # Set the basic properties<br />
   $NewUser.Put(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"sAMAccountName"</span>,$sam)<br />
   $NewUser.Put(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"displayName"</span>,$DisplayName)<br />
   $NewUser.Put(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"givenname"</span>,$FirstName)<br />
   $NewUser.Put(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"sn"</span>,$LastName)<br /><br />
   # Commit changes <br />
   $NewUser.SetInfo() <br /><br />
   <br />
   # Set our password <br />
   $NewUser.psbase.Invoke(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SetPassword"</span>,$pw) <br /><br />
   # And enable the account<br />
   $NewUser.psbase.InvokeSet(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"AccountDisabled"</span>,$<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>) <br /><br />
   # set that the password never expires<br />
   $NewUser.userAccountControl[0] <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $NewUser.userAccountControl[0]
-bor (65536) <br /><br />
   # Commit changes<br />
   $NewUser.SetInfo() </span></span>
        </p>
        <p>
          <br />
}<br /></p>
        <p>
          <hr />
          <br />
        </p>
        <p>
This gets us a function we can call to add test users. Note we're hardcoding
the OU to users, to make this more production you'd want to parameterize the OU, passwords
and set the AccountControl flags to Change Password on next login, there's a lot of
other resources out there to help with that.
</p>
        <p>
So If we put that in a script file loaded from our Profile we can call it like this
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">add-aduser <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"joeb"</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"joe
blogs"</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"joe"</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"blogs"</span><br /></span>
        </p>
        <p>
That's nice but with PowerShell we can do better. We really want to data drive this
and the built-in import-csv function will parse a CSV and create a collection of objects
that match the CSV schema. 
</p>
        <p>
Take a simple User's CSV file like this
</p>
        <font size="2">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">LoginName,
DisplayName, FirstName, LastName, Email<br /><br />
brianb, Brian Ballack, Brian, Ballack, brianb<br />
walterf, Walter French, Walter, French, walterf</span>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <br />
 
</span>
          </p>
        </font>
        <p>
Now if we run an import-xml command on the CSV file this is the output
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/PowerShell-Import-CSV.gif" border="0" />
        </p>
        <p>
Each line has been parsed and an object created. To see this more clearly we can use
the get-member command to reflect over the object and see what the object looks like.
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/PowerShell-Import-CSV2.gif" border="0" />
        </p>
        <p>
(Note: it will be PSCustomObject not MshCustomObject in post RC0 builds , I'm running
Exchange 2007 on this VPC which requires PowerShell RC0)
</p>
        <p>
As you can see the CSV columns have been added as a NoteProperty property (this is
part of the extensible type system).
</p>
        <p>
So now we can create a really simple function to import a CSV file of users, pipe
the output to a foreach loop and add each user to Active Directory.
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#
Function:         Import-Users<br />
# Description:        Create users <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> active
directory <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span> listed <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> the
import CSV file<br />
# Parameters:        UserFile         Location
of the CSV file containing the users<br />
#<br />
function Import-Users([<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$UserFile)<br />
{<br />
    Import-Csv $UserFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> {
add-aduser $_.LoginName $_.DisplayName $_.FirstName $_.LastName } 
<br />
}</span>
        </p>
        <p>
Note that when you receiving a collection of objects in the pipeline in a scriptblock
you have to loop over each object. The $_ is a special variable that gives you the
current object in the loop which you can use to access properties and methods.
</p>
        <p>
To call we just do 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Import-Users
Users.CSV</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span>With
this power 500 users are as easy as 1 user. 
</p>
        <p>
We're not limited to just using CSV files, I've just picked that format as I'm always
amazed at the amount of data I get given in Excel spreadsheets and word documents
and CSV is the easiest intermediate format to work with. There is also an import-xml
command which we will use later to import an XML file containing portal content.
As Powershell can call any .Net library the System.Data set of classes could also
be used to pull information from databases. 
</p>
        <p>
The next entry will be adding our users to SharePoint.
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=00544739-c0e8-42f2-aa30-2105b873ddfe" />
      </body>
      <title>SharePoint/PowerShell 2: Add some Users to Active Directory, maybe 1, maybe 500</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,00544739-c0e8-42f2-aa30-2105b873ddfe.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/10/31/SharePointPowerShell2AddSomeUsersToActiveDirectoryMaybe1Maybe500.aspx</link>
      <pubDate>Tue, 31 Oct 2006 09:13:15 GMT</pubDate>
      <description>&lt;p&gt;
Step 2 in our series is to add some users to Active Directory.
&lt;/p&gt;
&lt;p&gt;
First we need a simple routine to add users to Active Directory
&lt;/p&gt;
&lt;p&gt;
Update 3-11-2006 : The original add-aduser would only work in versions of PowerShell
pre RC2. RC2 included some breaking changes to how the DirectoryEntry object handled.
I;ve added an RC2 compatible routine.
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#ff0000&gt;Pre RC2 version&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;function
add-aduser([&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$LoginName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$DisplayName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$FirstName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$LastName)&lt;br&gt;
{&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$cn=$LoginName&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$sam=$LoginName&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$pw=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"P@ssword1"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ad= &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; System.DirectoryServices.DirectoryEntry 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$u &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $ad.get_Children().Find(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CN=Users"&lt;/span&gt;) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $u.get_Children().add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CN=$cn"&lt;/span&gt;,'User') 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.InvokeSet(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"sAMAccountName"&lt;/span&gt;,$sam)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.InvokeSet(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"displayName"&lt;/span&gt;,$DisplayName)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.InvokeSet(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"FirstName"&lt;/span&gt;,$FirstName)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.InvokeSet(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"LastName"&lt;/span&gt;,$LastName)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.CommitChanges() 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$ad=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; System.DirectoryServices.DirectoryEntry 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$u &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $ad.get_Children().Find(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CN=Users"&lt;/span&gt;) 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser= $u.get_Children().Find(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CN=$cn"&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.Invoke(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SetPassword"&lt;/span&gt;,$pw) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.InvokeSet(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"AccountDisabled"&lt;/span&gt;,$&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;) 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# set that the password never expires&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.userAccountControl[0] &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $NewUser.userAccountControl[0]
-bor (65536) 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.CommitChanges() 
&lt;br&gt;
&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#ff0000&gt;RC2 Version&lt;/font&gt; 
&lt;p&gt;
&lt;hr&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;function
add-aduser([&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$LoginName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$DisplayName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$FirstName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$LastName)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;{&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$cn=$LoginName&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$sam=$LoginName&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$pw=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"P@ssword1"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Get an ADSI &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;for&lt;/span&gt; the &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;default&lt;/span&gt; domain&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$ad= [ADSI]&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;""&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Get the Users OU &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;default&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$ou &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $ad.psbase.Children.Find(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CN=Users"&lt;/span&gt;)&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Add the user&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $ou.psbase.Children.Add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CN=$cn"&lt;/span&gt;,'User')&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Set the basic properties&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.Put(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"sAMAccountName"&lt;/span&gt;,$sam)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.Put(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"displayName"&lt;/span&gt;,$DisplayName)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.Put(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"givenname"&lt;/span&gt;,$FirstName)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.Put(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"sn"&lt;/span&gt;,$LastName)&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Commit changes&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.SetInfo()&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Set our password&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.psbase.Invoke(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SetPassword"&lt;/span&gt;,$pw)&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# And enable the account&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.psbase.InvokeSet(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"AccountDisabled"&lt;/span&gt;,$&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;)&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# set that the password never expires&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.userAccountControl[0] &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $NewUser.userAccountControl[0]
-bor (65536)&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;# Commit changes&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;$NewUser.SetInfo() &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;br&gt;
&lt;/p&gt;
&gt; 
&lt;p&gt;
This gets us&amp;nbsp;a function we can call to add test users. Note we're hardcoding
the OU to users, to make this more production you'd want to parameterize the OU, passwords
and set the AccountControl flags to Change Password on next login, there's a lot of
other resources out there to help with that.
&lt;/p&gt;
&lt;p&gt;
So If we put that in a script file loaded from our Profile we can call it like this
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;add-aduser &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"joeb"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"joe
blogs"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"joe"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"blogs"&lt;/span&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
That's nice but with PowerShell we can do better. We really want to data drive this
and the built-in import-csv function will parse a CSV and create a collection of objects
that match the CSV schema. 
&lt;/p&gt;
&lt;p&gt;
Take a simple User's CSV file like this
&lt;/p&gt;
&lt;font size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;LoginName,
DisplayName, FirstName, LastName, Email&lt;br&gt;
&lt;br&gt;
brianb, Brian Ballack, Brian, Ballack, brianb&lt;br&gt;
walterf, Walter French, Walter, French, walterf&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&gt;&lt;/font&gt; 
&lt;p&gt;
Now if we run an import-xml command on the CSV file this is the output
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/PowerShell-Import-CSV.gif" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Each line has been parsed and an object created. To see this more clearly we can use
the get-member command to reflect over the object and see what the object looks like.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/PowerShell-Import-CSV2.gif" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
(Note: it will be PSCustomObject not MshCustomObject in post RC0 builds , I'm running
Exchange 2007 on this VPC which requires PowerShell RC0)
&lt;/p&gt;
&lt;p&gt;
As you can see the CSV columns have been added as a NoteProperty property (this is
part of the extensible type system).
&lt;/p&gt;
&lt;p&gt;
So now we can create a really simple function to import a CSV file of users, pipe
the output to a foreach loop and add each user to Active Directory.
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;#
Function: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Import-Users&lt;br&gt;
# Description:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Create users &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; active
directory &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; listed &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; the
import CSV file&lt;br&gt;
# Parameters:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserFile &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Location
of the CSV file containing the users&lt;br&gt;
#&lt;br&gt;
function Import-Users([&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$UserFile)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Import-Csv $UserFile &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; {
add-aduser $_.LoginName $_.DisplayName $_.FirstName $_.LastName } 
&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Note that when you receiving a collection of objects in the pipeline in a scriptblock
you have to loop over each object. The $_ is a special variable that gives you the
current object in the loop which you can use to access properties and methods.
&lt;/p&gt;
&lt;p&gt;
To call we just do 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Import-Users
Users.CSV&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;With
this power 500 users are as easy as 1 user. 
&lt;/p&gt;
&lt;p&gt;
We're not limited to just using CSV files, I've just picked that format as I'm always
amazed at the amount of data I get given in Excel&amp;nbsp;spreadsheets and word documents
and CSV is the easiest intermediate format to work with. There is also an import-xml
command which we will use later to import&amp;nbsp;an XML file containing portal content.
As Powershell can call any .Net library the System.Data set of classes could also
be used to pull information from databases. 
&lt;/p&gt;
&lt;p&gt;
The next entry will be adding our users to SharePoint.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=00544739-c0e8-42f2-aa30-2105b873ddfe" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,00544739-c0e8-42f2-aa30-2105b873ddfe.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi,
</p>
        <p>
Just like to thank all those who attended the Presentation last Thursday on controlling
SharePoint with PowerShell and Extending the Administration Object model.
</p>
        <p>
I know it was pretty fast paced and technical so I plan to follow it up with a series
of blogs entries recapping the steps and scripts in greater detail. 
</p>
        <p>
Some of the topics covered were:
</p>
        <p>
   Powershell Basics
</p>
        <p>
   Exchange produces PowerShell samples from the new UI console
</p>
        <p>
   Creating a new SharePoint WebApplication and applying a portal template
</p>
        <p>
   Adding users defined in a CSV file to Active Directory
</p>
        <p>
   Adding those users defined in a CSV file to SharePoint roles
</p>
        <p>
   Adding in webs as defined in a CSV file
</p>
        <p>
   Adding content in an XML file to a Publishing Web
</p>
        <p>
   Uploading a directory of files in 4 lines of Script.
</p>
        <p>
   Creating a custom STSAdm command
</p>
        <p>
   Creating an application to sync User Profile properties back to
Active Directory
</p>
        <p>
I've attached the PowerShell scripts and PowerPoint Slides.
</p>
        <p>
I'm not able to post the sample code of the AD Sync application as parts of the code
is proprietary but I will post a sample application that does a scheduled backup using
exactly the same template.
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Presentation-SPPowerShell.zip">Presentation-SPPowerShell.zip
(46.78 KB)</a>
        </p>
Colin Byrne 
<p></p><p>
Flexnet Consultants
</p><img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f" /></body>
      <title>Presention Slides and PowerShell code from UK SharePoint User Group Thursday 26'th October</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/10/30/PresentionSlidesAndPowerShellCodeFromUKSharePointUserGroupThursday26thOctober.aspx</link>
      <pubDate>Mon, 30 Oct 2006 10:53:00 GMT</pubDate>
      <description>&lt;p&gt;
Hi,
&lt;/p&gt;
&lt;p&gt;
Just like to thank all those who attended the Presentation last Thursday on controlling
SharePoint with PowerShell and Extending the Administration Object model.
&lt;/p&gt;
&lt;p&gt;
I know it was pretty fast paced and technical so I plan to follow it up with a series
of blogs entries recapping the steps and scripts in greater detail. 
&lt;/p&gt;
&lt;p&gt;
Some of the topics covered were:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Powershell Basics
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Exchange produces PowerShell samples from the new UI console
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Creating a new SharePoint WebApplication and applying a portal template
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Adding users defined in a CSV file to Active Directory
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Adding those users defined in a CSV file to SharePoint roles
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Adding in webs as defined in a CSV file
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Adding content in an XML file to a Publishing Web
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Uploading a directory of files in 4 lines of Script.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Creating a custom STSAdm command
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Creating an application to sync User Profile properties back to
Active Directory
&lt;/p&gt;
&lt;p&gt;
I've attached the PowerShell scripts and PowerPoint Slides.
&lt;/p&gt;
&lt;p&gt;
I'm not able to post the sample code of the AD Sync application as parts of the code
is proprietary but I will post a sample application that does a scheduled backup using
exactly the same template.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Presentation-SPPowerShell.zip"&gt;Presentation-SPPowerShell.zip
(46.78 KB)&lt;/a&gt; 
&lt;/p&gt;
Colin Byrne 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Flexnet Consultants
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,1a36fc6f-0262-47e1-bb5f-59e96b6d2c0f.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=a326572f-8f78-4c80-86d5-1fe52cbd6fe5</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=a326572f-8f78-4c80-86d5-1fe52cbd6fe5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A quickie. 
</p>
        <p>
Heres 4 lines of code to upload a whole directory of files, in this case pictures,
to a SharePoint document or image library. 
</p>
        <p>
The directory pictures contains the images.
</p>
        <p>
The destination is the image library SiteCollectionImages for the portal running on
port 2828
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">$wc <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> System.Net.WebClient<br />
$wc.Credentials <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> [System.Net.CredentialCache]::DefaultCredentials<br />
function getdestname($filename){ <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://sps:2828/sitecollectionimages/"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> $(split-path
-leaf $filename)}<br />
dir <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"pictures"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">%</span> {
$uploadname=getdestname $_; $wc.UploadFile($uploadname,<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"PUT"</span>,
$_.FullName) } </span>
        </p>
        <p>
Have I mentioned PowerShell just rocks?
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a326572f-8f78-4c80-86d5-1fe52cbd6fe5" />
      </body>
      <title>SharePoint/Powershell Quickie: Upload a directory of files in 4 lines</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/10/30/SharePointPowershellQuickieUploadADirectoryOfFilesIn4Lines.aspx</link>
      <pubDate>Mon, 30 Oct 2006 10:03:35 GMT</pubDate>
      <description>&lt;p&gt;
A quickie. 
&lt;/p&gt;
&lt;p&gt;
Heres 4 lines of code to upload a whole directory of files, in this case pictures,
to a SharePoint document or image library. 
&lt;/p&gt;
&lt;p&gt;
The directory pictures contains the images.
&lt;/p&gt;
&lt;p&gt;
The destination is the image library SiteCollectionImages for the portal running on
port 2828
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;$wc &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; System.Net.WebClient&lt;br&gt;
$wc.Credentials &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; [System.Net.CredentialCache]::DefaultCredentials&lt;br&gt;
function getdestname($filename){ &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://sps:2828/sitecollectionimages/"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; $(split-path
-leaf $filename)}&lt;br&gt;
dir &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"pictures"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;%&lt;/span&gt; {
$uploadname=getdestname $_; $wc.UploadFile($uploadname,&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"PUT"&lt;/span&gt;,
$_.FullName) } &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Have I mentioned PowerShell just rocks?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a326572f-8f78-4c80-86d5-1fe52cbd6fe5" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a326572f-8f78-4c80-86d5-1fe52cbd6fe5.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=f48e17ef-2db6-48ce-a612-628e19b4c6b6</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,f48e17ef-2db6-48ce-a612-628e19b4c6b6.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,f48e17ef-2db6-48ce-a612-628e19b4c6b6.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=f48e17ef-2db6-48ce-a612-628e19b4c6b6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In this PowerShell and SharePoint series I'd thought I'd spin through, in order of
use, the commands used to create the demo Portal site in the SUGUK user group presentation. 
</p>
        <p>
First step: Creating a Web Application using the API.
</p>
        <p>
The new SPWebApplicationBuilder object makes this easy. This object creates a Web
Application using a default port and the default settings, you can override any settings
you like in your script but for simplicity I'm just changing the default timezone. 
</p>
        <p>
SPWebApplicationBuilder also creates an AppPool to go along with the new IIS Website
which has Network Service as the user. In Beta 2TR that account doesn't have the correct
permissions so you need to change it to a local administrator. I tend to dev on a
Virtual machine DC so I'd use the domain admin. 
</p>
        <p>
So we have three routines 
</p>
        <p>
   new-SpWebApplication - Create the IIS Website and SharePoint settings
</p>
        <p>
   set-apidentity   - set the Application Pool credentials
</p>
        <p>
   get-defaulttimezoneid   - returns the Greenwich Meantime
TimeZone ID (adjust this one to suit)
</p>
        <p>
We also then need to create the set of webs that will live inside the Web Application,
this is done by calling the Add Method on the Sites method of the Web Application
passing it various parameters the most important of which is the template ID, in this
case SPSPORTAL to give us the default SharePoint Intranet portal look.
</p>
        <p>
The Powershell commands to tie all this together are
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">$webapp=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-SPWebApplication<br /><br />
set-apIdentity "<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"><a href="http://sps:yourportnumber">http://sps:yourportnumber</a>"</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"contoso\administrator"</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"password"</span><br /><br />
#Create Portal Site Collection<br /><br />
$webapp.Sites.Add(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"/"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SUGUK
Intranet"</span>,<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SUGUK
Intranet"</span>,1033, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SPSPORTAL"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"contoso\administrator"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"administrator"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"administrator@contoso.com"</span>)<br /></span>
        </p>
        <p>
Here's new-SPWebApplication
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#
Function:         <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-SPWebApplication    <br />
# Description:        Create and <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> a <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SPWebApplication <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span><br />
#             Use the <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">default</span> values
which will create the web site at a random port 
<br />
# Parameters:        none<br />
#<br />
function <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-SPWebApplication()<br />
{<br /><br />
    # Get our local SPFarm <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span><br />
    $spfarm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> [Microsoft.SharePoint.Administration.SPfarm]::Local<br /><br />
    # Use the <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SPWebApplicationBuilder<br />
    $appbuilder= <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> Microsoft.SharePoint.Administration.SPWebApplicationBuilder
$spfarm<br /><br />
    # Create Web Application with the <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">default</span> settings<br />
    <br />
    $webapplication <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $appbuilder.Create()<br /><br />
    # Set the timezone to Greenwich Mean Time 
<br />
    $timezone=get-defaulttimezoneid<br />
    $webapplication.DefaultTimeZone <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> $timezone.ID<br />
    $webapplication.Update()<br /><br />
    # Actually queue the application <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span> creation<br />
    $webapplication.Provision()<br /><br />
    # <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> the
SPWebApplication <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span><br />
    $webapplication<br /><br />
}</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span> 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#
Return the Default TimeZone <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">as</span> used <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span> the
majority of our sites<br />
#<br />
function get-defaulttimezoneid<br />
{<br />
    [Microsoft.SharePoint.SPregionalSettings]::Globaltimezones <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> where-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> {
$_.Description -like <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"*greenwich*"</span> } 
<br />
}</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <br />
 
</span>
        </p>
        <p>
Now to change the Credentials for the AppPool is also really simple in V3. The SPWebApplication
object exposes a ApplicationPool property which you can use to set its credentials
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#
Function:         set-apidentity    <br />
# Description:        Set the credentials <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span> the
application pool <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span> the
given Web Application<br />
# Parameters:        Url        Site
Collection URL<br />
#            UserName
    UserName<br />
#            Password
    Password<br />
function set-apidentity([<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$SiteCollectionURL,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$UserName,
[<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>]$Password)<br />
{<br /><br />
        <br />
    $webapp=get-spwebapplication $SiteCollectionURL<br />
    <br />
    <br />
    $webapp.ApplicationPool.CurrentIdentityType= [Microsoft.SharePoint.Administration.IdentityType]::SpecificUser<br />
    $webapp.ApplicationPool.UserName= $Username<br />
    $webapp.ApplicationPool.Password= $Password<br />
    <br />
    # Save the settings<br />
    $webapp.ApplicationPool.Update()<br /><br />
    # Roll the settings <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">out</span> via
a Admin Job<br />
    $webapp.ApplicationPool.Provision()<br /><br /><br />
}</span>
        </p>
        <p>
 
</p>
        <p>
To me this is way easier than using the UI.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=f48e17ef-2db6-48ce-a612-628e19b4c6b6" />
      </body>
      <title>SharePoint/PowerShell 1: Make me a portal</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,f48e17ef-2db6-48ce-a612-628e19b4c6b6.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/10/30/SharePointPowerShell1MakeMeAPortal.aspx</link>
      <pubDate>Mon, 30 Oct 2006 09:46:17 GMT</pubDate>
      <description>&lt;p&gt;
In this PowerShell and SharePoint series I'd thought I'd spin through, in order of
use, the commands used to create the demo Portal site in the SUGUK user group presentation. 
&lt;/p&gt;
&lt;p&gt;
First step: Creating a Web Application using the API.
&lt;/p&gt;
&lt;p&gt;
The new SPWebApplicationBuilder object makes this easy. This object creates a Web
Application using a default port and the default settings, you can override any settings
you like in your script but for simplicity I'm just changing the default timezone. 
&lt;/p&gt;
&lt;p&gt;
SPWebApplicationBuilder also creates an AppPool to go along with the new IIS Website
which has Network Service as the user. In Beta 2TR that account doesn't have the correct
permissions so you need to change it to a local administrator. I tend to dev on a
Virtual machine DC so I'd use the domain admin. 
&lt;/p&gt;
&lt;p&gt;
So we have three routines 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;new-SpWebApplication - Create the IIS Website and SharePoint settings
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;set-apidentity&amp;nbsp;&amp;nbsp;&amp;nbsp;- set the Application Pool credentials
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;get-defaulttimezoneid&amp;nbsp;&amp;nbsp;&amp;nbsp;- returns the Greenwich Meantime
TimeZone ID (adjust this one to suit)
&lt;/p&gt;
&lt;p&gt;
We also then need to create the set of webs that will live inside the Web Application,
this is done by calling the Add Method on the Sites method of the Web Application
passing it various parameters the most important of which is the template ID, in this
case SPSPORTAL to give us the default SharePoint Intranet portal look.
&lt;/p&gt;
&lt;p&gt;
The Powershell commands to tie all this together are
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;$webapp=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-SPWebApplication&lt;br&gt;
&lt;br&gt;
set-apIdentity "&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;&lt;a href="http://sps:yourportnumber"&gt;http://sps:yourportnumber&lt;/a&gt;"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"contoso\administrator"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"password"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
#Create Portal Site Collection&lt;br&gt;
&lt;br&gt;
$webapp.Sites.Add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"/"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SUGUK
Intranet"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SUGUK
Intranet"&lt;/span&gt;,1033, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SPSPORTAL"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"contoso\administrator"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"administrator"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"administrator@contoso.com"&lt;/span&gt;)&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Here's new-SPWebApplication
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;#
Function: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-SPWebApplication&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
# Description:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Create and &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; a &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SPWebApplication &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt;
&lt;br&gt;
# &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Use the &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;default&lt;/span&gt; values
which will create the web site at a random port 
&lt;br&gt;
# Parameters:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;none&lt;br&gt;
#&lt;br&gt;
function &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-SPWebApplication()&lt;br&gt;
{&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Get our local SPFarm &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$spfarm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; [Microsoft.SharePoint.Administration.SPfarm]::Local&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Use the &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SPWebApplicationBuilder&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$appbuilder= &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; Microsoft.SharePoint.Administration.SPWebApplicationBuilder
$spfarm&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Create Web Application with the &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;default&lt;/span&gt; settings&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapplication &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $appbuilder.Create()&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Set the timezone to Greenwich Mean Time 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$timezone=get-defaulttimezoneid&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapplication.DefaultTimeZone &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; $timezone.ID&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapplication.Update()&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Actually queue the application &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;for&lt;/span&gt; creation&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapplication.Provision()&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; the
SPWebApplication &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapplication&lt;br&gt;
&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;#
Return the Default TimeZone &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; used &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;for&lt;/span&gt; the
majority of our sites&lt;br&gt;
#&lt;br&gt;
function get-defaulttimezoneid&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Microsoft.SharePoint.SPregionalSettings]::Globaltimezones &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; where-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; {
$_.Description -like &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"*greenwich*"&lt;/span&gt; } 
&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&gt; 
&lt;p&gt;
Now to change the Credentials for the AppPool is also really simple in V3. The SPWebApplication
object exposes a ApplicationPool property which you can use to set its credentials
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;#
Function: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set-apidentity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
# Description:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Set the credentials &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;for&lt;/span&gt; the
application pool &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;for&lt;/span&gt; the
given Web Application&lt;br&gt;
# Parameters:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Url&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Site
Collection URL&lt;br&gt;
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserName
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UserName&lt;br&gt;
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Password
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Password&lt;br&gt;
function set-apidentity([&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$SiteCollectionURL,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$UserName,
[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;]$Password)&lt;br&gt;
{&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapp=get-spwebapplication $SiteCollectionURL&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapp.ApplicationPool.CurrentIdentityType= [Microsoft.SharePoint.Administration.IdentityType]::SpecificUser&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapp.ApplicationPool.UserName= $Username&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapp.ApplicationPool.Password= $Password&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Save the settings&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapp.ApplicationPool.Update()&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Roll the settings &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;out&lt;/span&gt; via
a Admin Job&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$webapp.ApplicationPool.Provision()&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
To me this is way easier than using the UI.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=f48e17ef-2db6-48ce-a612-628e19b4c6b6" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,f48e17ef-2db6-48ce-a612-628e19b4c6b6.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=1665700b-e0de-4b8a-bb1c-014d6fbcf2db</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,1665700b-e0de-4b8a-bb1c-014d6fbcf2db.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,1665700b-e0de-4b8a-bb1c-014d6fbcf2db.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=1665700b-e0de-4b8a-bb1c-014d6fbcf2db</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi, 
</p>
        <p>
I'm about to start off a new series of entries about using Powershell to control SharePoint. 
There's a big gap in the ability to script SharePoint between stsadm commands and
custom .net programs and PowerShell fills it nicely. 
</p>
        <p>
All my entries from now on will focus on SharePoint version 3. 
</p>
        <p>
PowerShell is 'DOS for the .NET generation' (c) :-) and its a fantastic way to
both interactively control SharePoint via its Object Model from a command line and
to create scripts that can be run in a batch. Its currently at version RC2 and is
available from here <a href="http://support.microsoft.com/kb/925228"><font color="#669966">http://support.microsoft.com/kb/925228</font></a><br />
It installs as a windows update package rather than a separate install as it used
to in earlier betas, thats a sign of its being a core element of Windows going forward. 
</p>
        <p>
Ok lets do some Powershell SharePoint basics. 
</p>
        <p>
First although Powershell can call any .net class the assembly must be loaded first. 
<br />
By default Powershell loads a small list of assemblies, this command will get the
list of loaded assemblies: 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[System.AppDomain]::CurrentDomain.GetAssemblies()</span>
        </p>
        <p>
        </p>
        <p>
The syntax for calling a .NET class's static method is for the brackets go around
the Class name and the double colon between the class and the static method 
</p>
        <p>
The output from that is a little hard to read lets just list the files involved 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[AppDomain]::CurrentDomain.GetAssemblies() <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> {
split-path $_.Location -leaf } <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> sort 
<br /><br /></span>
        </p>
        <p>
Here's the list of files the above command gives on my machine 
</p>
        <p>
Microsoft.PowerShell.Commands.Management.dll<br />
Microsoft.PowerShell.Commands.Utility.dll<br />
Microsoft.PowerShell.Commands.Utility.resources.dll<br />
Microsoft.PowerShell.ConsoleHost.dll<br />
Microsoft.PowerShell.ConsoleHost.resources.dll<br />
Microsoft.PowerShell.Security.dll<br />
Microsoft.PowerShell.Security.resources.dll<br />
mscorlib.dll<br />
System.Configuration.Install.dll<br />
System.Data.dll<br />
System.DirectoryServices.dll<br />
System.dll<br />
System.Management.Automation.dll<br />
System.Management.Automation.resources.dll<br />
System.Management.dll<br />
System.ServiceProcess.dll<br />
System.Xml.dll 
</p>
        <p>
As you can see SharePoint is not one of those in the list, also missing that could
be useful is the System.Web assembly 
</p>
        <p>
There are a few ways to load an assembly onto your AppDomain but the easiest is to
call the static method LoadWithPartialName on the Assembly class. 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[System.Reflection.Assembly]::LoadWithPartialName(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Microsoft.SharePoint"</span>) 
<br /></span>
        </p>
        <p>
LoadWithPartialName is great because you dont need to specify the full name to the
assembly which in SharePoint v3 would be 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[System.Reflection.Assembly]::Load(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"</span>) 
<br /></span>
        </p>
        <p>
and for MOSS 
</p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">[System.Reflection.Assembly]::Load(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Microsoft.SharePoint.Portal,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"</span>) 
<br /></span>
        </p>
        <p>
Now a lot of people will cry LoadWithPartialName has been deprecated as MS have got
concerned how it has to make to many guesses over locating the assembly. 
<br />
Personally I want to see a method that will simply load the latest version of the
assembly I've told it to load, in a controlled environment like a SharePoint server
thats exactly the behaviour I want to see. &lt;rant&gt; MS for god's sake just document
the method properly and let devs choose whether to use it or not. &lt;/rant&gt; 
</p>
        <p>
Anyway if you want to use the Load method take a look at this blog entry: <a href="http://www.leeholmes.com/blog/HowDoIEasilyLoadAssembliesWhenLoadWithPartialNameHasBeenDeprecated.aspx"><font color="#669966">http://www.leeholmes.com/blog/HowDoIEasilyLoadAssembliesWhenLoadWithPartialNameHasBeenDeprecated.aspx</font></a></p>
        <p>
Now you don't want to type the load commands each time so put them in your Powershell
Profile script. 
<br />
This changes location a lot depending on which version of Powershell your running
so see this entry for the full details <a href="http://www.leeholmes.com/blog/TheStoryBehindTheNamingAndLocationOfPowerShellProfiles.aspx"><font color="#669966">http://www.leeholmes.com/blog/TheStoryBehindTheNamingAndLocationOfPowerShellProfiles.aspx</font></a></p>
        <p>
So now what can we do with this? 
</p>
        <p>
Well first lets get a site collection we can play with 
</p>
        <p>
First create an SPSite object and pass it a valid site url 
</p>
        <p>
          <br />
        </p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">      $spsite=
Microsoft.SharePoint.SPSite(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://portal.contoso.com"</span>)<br /></span>
        </p>
        <p>
        </p>
        <p>
to see the contents of the object just type the object on the command line 
</p>
        <blockquote>
          <p>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">$spsite </span>
          </p>
        </blockquote>
        <p>
To just get a list of the methods on the SPSite object 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   $spsite <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> get-member
-membertype method 
<br /></span>
        </p>
        <p>
To just get a list of the properties on the SPSite object 
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   $spsite <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> get-member
-membertype property </span>
        </p>
        <p>
To get a list of all sub sites 
<br /></p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   $spsite.AllWebs 
<br /></span>
        </p>
        <p>
Get a list of webs ordered by the last time that the contents have been changed 
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   $spsite.allwebs <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> select
LastItemModifiedDate, URL , Created <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> sort
LastItemModifiedDate 
<br /><br /></span>
        </p>
        <p>
        </p>
        <p>
There's lots more that you can do and I'll post them as I go.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=1665700b-e0de-4b8a-bb1c-014d6fbcf2db" />
      </body>
      <title>PowerShell and SharePoint - Oh Yes</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,1665700b-e0de-4b8a-bb1c-014d6fbcf2db.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/10/25/PowerShellAndSharePointOhYes.aspx</link>
      <pubDate>Wed, 25 Oct 2006 10:01:53 GMT</pubDate>
      <description>&lt;p&gt;
Hi, 
&lt;p&gt;
I'm about to start off a new series of entries about using Powershell to control SharePoint.&amp;nbsp;
There's a big gap in the ability to script SharePoint between stsadm commands and
custom .net programs and PowerShell fills it nicely. 
&lt;p&gt;
All my entries from now on will focus on SharePoint version 3. 
&lt;p&gt;
PowerShell is 'DOS for the .NET generation' (c) :-)&amp;nbsp;and its a fantastic way to
both interactively control SharePoint via its Object Model from a command line and
to create scripts that can be run in a batch. Its currently at version RC2 and is
available from here &lt;a href="http://support.microsoft.com/kb/925228"&gt;&lt;font color=#669966&gt;http://support.microsoft.com/kb/925228&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
It installs as a windows update package rather than a separate install as it used
to in earlier betas, thats a sign of its being a core element of Windows going forward. 
&lt;/p&gt;
&lt;p&gt;
Ok lets do some Powershell SharePoint basics. 
&lt;p&gt;
First although Powershell can call any .net class the assembly must be loaded first. 
&lt;br&gt;
By default Powershell loads a small list of assemblies, this command will get the
list of loaded assemblies: 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[System.AppDomain]::CurrentDomain.GetAssemblies()&lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The syntax for calling a .NET class's static method is for the brackets go around
the Class name and the double colon between the class and the static method 
&lt;p&gt;
The output from that is a little hard to read lets just list the files involved 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[AppDomain]::CurrentDomain.GetAssemblies() &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt;-&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; {
split-path $_.Location -leaf } &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; sort 
&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Here's the list of files the above command gives on my machine 
&lt;/p&gt;
&lt;p&gt;
Microsoft.PowerShell.Commands.Management.dll&lt;br&gt;
Microsoft.PowerShell.Commands.Utility.dll&lt;br&gt;
Microsoft.PowerShell.Commands.Utility.resources.dll&lt;br&gt;
Microsoft.PowerShell.ConsoleHost.dll&lt;br&gt;
Microsoft.PowerShell.ConsoleHost.resources.dll&lt;br&gt;
Microsoft.PowerShell.Security.dll&lt;br&gt;
Microsoft.PowerShell.Security.resources.dll&lt;br&gt;
mscorlib.dll&lt;br&gt;
System.Configuration.Install.dll&lt;br&gt;
System.Data.dll&lt;br&gt;
System.DirectoryServices.dll&lt;br&gt;
System.dll&lt;br&gt;
System.Management.Automation.dll&lt;br&gt;
System.Management.Automation.resources.dll&lt;br&gt;
System.Management.dll&lt;br&gt;
System.ServiceProcess.dll&lt;br&gt;
System.Xml.dll 
&lt;p&gt;
As you can see SharePoint is not one of those in the list, also missing that could
be useful is the System.Web assembly 
&lt;p&gt;
There are a few ways to load an assembly onto your AppDomain but the easiest is to
call the static method LoadWithPartialName on the Assembly class. 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[System.Reflection.Assembly]::LoadWithPartialName(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Microsoft.SharePoint"&lt;/span&gt;) 
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
LoadWithPartialName is great because you dont need to specify the full name to the
assembly which in SharePoint v3 would be 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[System.Reflection.Assembly]::Load(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"&lt;/span&gt;) 
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
and for MOSS 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;[System.Reflection.Assembly]::Load(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Microsoft.SharePoint.Portal,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"&lt;/span&gt;) 
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Now a lot of people will cry LoadWithPartialName has been deprecated as MS have got
concerned how it has to make to many guesses over locating the assembly. 
&lt;br&gt;
Personally I want to see a method that will simply load the latest version of the
assembly I've told it to load, in a controlled environment like a SharePoint server
thats exactly the behaviour I want to see. &amp;lt;rant&amp;gt; MS for god's sake just document
the method properly and let devs choose whether to use it or not. &amp;lt;/rant&amp;gt; 
&lt;p&gt;
Anyway if you want to use the Load method take a look at this blog entry: &lt;a href="http://www.leeholmes.com/blog/HowDoIEasilyLoadAssembliesWhenLoadWithPartialNameHasBeenDeprecated.aspx"&gt;&lt;font color=#669966&gt;http://www.leeholmes.com/blog/HowDoIEasilyLoadAssembliesWhenLoadWithPartialNameHasBeenDeprecated.aspx&lt;/font&gt;&lt;/a&gt; 
&lt;p&gt;
Now you don't want to type the load commands each time so put them in your Powershell
Profile script. 
&lt;br&gt;
This changes location a lot depending on which version of Powershell your running
so see this entry for the full details &lt;a href="http://www.leeholmes.com/blog/TheStoryBehindTheNamingAndLocationOfPowerShellProfiles.aspx"&gt;&lt;font color=#669966&gt;http://www.leeholmes.com/blog/TheStoryBehindTheNamingAndLocationOfPowerShellProfiles.aspx&lt;/font&gt;&lt;/a&gt; 
&lt;p&gt;
So now what can we do with this? 
&lt;p&gt;
Well first lets get a site collection we can play with 
&lt;p&gt;
First create an SPSite object and pass it a valid site url 
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$spsite=
Microsoft.SharePoint.SPSite(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://portal.contoso.com"&lt;/span&gt;)&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
to see the contents of the object just type the object on the command line &lt;blockquote&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;$spsite &lt;/span&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
To just get a list of the methods on the SPSite object 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$spsite &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; get-member
-membertype method 
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
To just get a list of the properties on the SPSite object 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$spsite &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; get-member
-membertype property &lt;/span&gt; 
&lt;p&gt;
To get a list of all sub sites 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$spsite.AllWebs 
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Get a list of webs ordered by the last time that the contents have been changed 
&lt;p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$spsite.allwebs &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; select
LastItemModifiedDate, URL , Created &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; sort
LastItemModifiedDate 
&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
There's lots more that you can do and I'll post them as I go.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=1665700b-e0de-4b8a-bb1c-014d6fbcf2db" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,1665700b-e0de-4b8a-bb1c-014d6fbcf2db.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Whoa, its been a while since I've blogged but sundry projects and SharePoint v3 has
taken up all my time. 
</p>
        <p>
Just to let you know that I'm presenting at the UK SharePoint users group meeting
this Thursday the 26th October. 
</p>
        <p>
I'm doing 2 sessions; one on using Powershell with SharePoint v3 in which I'll go
through Powershell basics and how to use it to control SharePoint. Then I will
attempt to build a portal without touching any settings in the UI! Wish me luck. 
</p>
        <p>
The second one will explore the new extensible admin object model.<br />
This will demonstrate creating custom stsadm commands along with creating an application
that syncs changed MOSS User profile information back to Active Directory.<br />
It will be a small application integrated into SharePoint and built using the new
SPService, SPServiceInstance and SPJobDefinition classes.<br />
I'll be describing how they work together, its cool stuff. 
</p>
        <p>
Everybody is welcome (you just need to register on the suguk site) so if you are in
London this Thursday it would be great to see you.  The meeting kicks off
at 6.30pm 
</p>
        <p>
If you plan to attend just register on the SUGUK site and leave your name on
this list 
<br /><a href="http://suguk.org/forums/thread/1490.aspx">http://suguk.org/forums/thread/1490.aspx</a></p>
        <p>
cheers,<br />
Colin
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56" />
      </body>
      <title>Presenting at the SUGUK Meeting 26th October</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/10/25/PresentingAtTheSUGUKMeeting26thOctober.aspx</link>
      <pubDate>Wed, 25 Oct 2006 08:37:47 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Whoa, its been a while since I've blogged but sundry projects and SharePoint v3 has
taken up all my time. 
&lt;p&gt;
Just to let you know that I'm presenting at the UK SharePoint users group meeting
this Thursday the 26th October. 
&lt;p&gt;
I'm doing 2 sessions; one on using Powershell with SharePoint v3 in which I'll go
through Powershell basics and how to use it to control SharePoint. Then&amp;nbsp;I will
attempt to build a portal without touching any settings in the UI! Wish me luck. 
&lt;p&gt;
The second one will explore the new extensible admin object model.&lt;br&gt;
This will demonstrate creating custom stsadm commands along with creating an application
that syncs changed MOSS User profile information back to Active Directory.&lt;br&gt;
It will be a small application integrated into SharePoint and built using the new
SPService, SPServiceInstance and SPJobDefinition classes.&lt;br&gt;
I'll be describing how they work together, its cool stuff. 
&lt;p&gt;
Everybody is welcome (you just need to register on the suguk site) so if you are in
London&amp;nbsp;this Thursday it would be great to see you.&amp;nbsp; The meeting kicks off
at 6.30pm 
&lt;p&gt;
If you plan to attend just register on the&amp;nbsp;SUGUK site and leave your name on
this list 
&lt;br&gt;
&lt;a href="http://suguk.org/forums/thread/1490.aspx"&gt;http://suguk.org/forums/thread/1490.aspx&lt;/a&gt; 
&lt;p&gt;
cheers,&lt;br&gt;
Colin
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,7f6e8c0d-c641-4d1f-aa4b-e78e893fcf56.aspx</comments>
      <category>PowerShell</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=457e5ce4-4673-456a-9a24-c72145acd57b</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=457e5ce4-4673-456a-9a24-c72145acd57b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Flexnet Consultants have just released a brand new free Web Part. 
</p>
        <p>
The PhotoGrid WebPart will show a nXn grid of Picture Library images with a each image
randomly chosen to be enlarged. This is similar to the Flikr Photobadge.
</p>
        <p>
You can set the number of pictures on each row and the number of rows along with the
time the enlarged picture is displayed (Display time). 
</p>
        <p>
Our Web Parts page uses a Flash embedded demo to show you how it would look.
</p>
        <p>
          <a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm">http://www.flexnetconsult.co.uk/WebParts/WebParts.htm</a>
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=457e5ce4-4673-456a-9a24-c72145acd57b" />
      </body>
      <title>New Free Web Part: Flash Dynamic PhotoGrid </title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/04/02/NewFreeWebPartFlashDynamicPhotoGrid.aspx</link>
      <pubDate>Sun, 02 Apr 2006 17:49:45 GMT</pubDate>
      <description>&lt;p&gt;
Flexnet Consultants have just released a brand new free Web Part. 
&lt;/p&gt;
&lt;p&gt;
The PhotoGrid WebPart will show a nXn grid of Picture Library images with a each image
randomly chosen to be enlarged. This is similar to the Flikr Photobadge.
&lt;/p&gt;
&lt;p&gt;
You can set the number of pictures on each row and the number of rows along with the
time the enlarged picture is displayed (Display time). 
&lt;/p&gt;
&lt;p&gt;
Our Web Parts page uses a Flash embedded demo to show you how it would look.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm"&gt;http://www.flexnetconsult.co.uk/WebParts/WebParts.htm&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=457e5ce4-4673-456a-9a24-c72145acd57b" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,457e5ce4-4673-456a-9a24-c72145acd57b.aspx</comments>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=0b75dd93-971f-48f1-b572-8e871668b53d</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=0b75dd93-971f-48f1-b572-8e871668b53d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Version 1.2 of our free Flash Slideshow Web Part is released.
</p>
        <p>
The Slideshow Web Part will show a rotating display of all the pictures in the Picture
Library with an adjustable fade transition between each picture. 
</p>
        <p>
This version has better support for SharePoint sites running on non standard http
ports.
</p>
        <p>
It now also supports all the image formats that the Picture Library does.
</p>
        <p>
          <a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm">http://www.flexnetconsult.co.uk/WebParts/WebParts.htm</a>
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b75dd93-971f-48f1-b572-8e871668b53d" />
      </body>
      <title>Flash Slideshow Web Part Version 1.2 released</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/04/02/FlashSlideshowWebPartVersion12Released.aspx</link>
      <pubDate>Sun, 02 Apr 2006 17:43:48 GMT</pubDate>
      <description>&lt;p&gt;
Version 1.2 of our free Flash Slideshow Web Part is released.
&lt;/p&gt;
&lt;p&gt;
The Slideshow Web Part will show a rotating display of all the pictures in the Picture
Library with an adjustable fade transition between each picture. 
&lt;/p&gt;
&lt;p&gt;
This version has better support for SharePoint sites running on non standard http
ports.
&lt;/p&gt;
&lt;p&gt;
It now also supports all the image formats that the Picture Library does.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.flexnetconsult.co.uk/WebParts/WebParts.htm"&gt;http://www.flexnetconsult.co.uk/WebParts/WebParts.htm&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b75dd93-971f-48f1-b572-8e871668b53d" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b75dd93-971f-48f1-b572-8e871668b53d.aspx</comments>
      <category>SharePoint</category>
      <category>WebParts</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=67e085b5-e328-4b3c-b814-9db550b99d82</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,67e085b5-e328-4b3c-b814-9db550b99d82.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,67e085b5-e328-4b3c-b814-9db550b99d82.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=67e085b5-e328-4b3c-b814-9db550b99d82</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Sometimes when working in client-side javascript you'd like to know your Windows username
for instance to add to the root Outlook Web Access URL for say a contacts search
i.e. <a href="http://flexnetowa/exchange/colinb/contacts/?cmd=search">http://flexnetowa/exchange/colinb/contacts/?cmd=search</a> 
</p>
        <p>
Now the stock answer whenever this comes up in the SharePoint newsgroups is: it can't
be done, use server side code to render it out.
</p>
        <p>
Thats fair enough and easy to do, I've created a WebPart that stores a users details
as a JavaScript object so it can be referenced in code. But what if I don't want to
install yet another server-side Web Part. 
</p>
        <p>
In the interests of providing code you won't get anywhere else here's the tip.
</p>
        <p>
Now its true the SharePoint Web Services provide no method to tell you who you are
(side-note: I suspect you may be able to do this by creating a CAML query against
the userinfo table but I've not managed to get that working) but you can get your
username by using the FrontPage RPC and calling author.dll, this is how Word displays
who you are on its TaskPane when you open a Word document in a document library. 
</p>
        <p>
When you call the author.dll ISAPI DLL with the 'open service' method name it returns
a host of information about the server and the services it provides.
</p>
        <p>
I'm using the XmlHttpRequest object again which despite the name can also be used
to retrieve a text document not just an XML one.
</p>
        <p>
heres the returned information
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;html&gt;&lt;head&gt;&lt;title&gt;vermeer
RPC packet&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;p&gt;method=open service:6.0.2.6356<br />
&lt;p&gt;service=<br />
&lt;ul&gt;<br />
&lt;li&gt;service_name=<br />
&lt;li&gt;meta_info=<br />
&lt;ul&gt;<br />
&lt;li&gt;vti_defaultlanguage<br />
&lt;li&gt;SW|en-us<br />
&lt;li&gt;vti_usernames<br />
&lt;li&gt;VR|<br />
&lt;li&gt;vti_servercharsets<br />
&lt;li&gt;VX|windows-1257 big5 windows-1252 windows-874 utf-8 windows-1251 windows-1256
euc-kr gb2312 windows-1253 windows-1258 koi8-r iso-8859-1 gb18030 iso-2022-jp ks_c_5601-1987
windows-1250 windows-1255 us-ascii euc-jp unicode unicodeFFFE windows-1254 iso-8859-2
iso-8859-15 shift_jis<br />
&lt;li&gt;vti_scnoprompt<br />
&lt;li&gt;IX|1<br />
&lt;li&gt;vti_toolpaneurl<br />
&lt;li&gt;SX|http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sharepoint.flexnet.ds/_layouts/1033/toolpane.aspx</span><br />
&lt;li&gt;vti_assemblyversion<br />
&lt;li&gt;SX|Microsoft.SharePoint, Version&amp;#61;11.0.0.0, Culture&amp;#61;neutral,
PublicKeyToken&amp;#61;71e9bce111e9429c<br />
&lt;li&gt;vti_webtemplate<br />
&lt;li&gt;IR|1<br />
&lt;li&gt;vti_hasonetlayoutfiles<br />
&lt;li&gt;BR|<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span><br />
&lt;li&gt;vti_navbuttonnextlabel<br />
&lt;li&gt;SR|Next<br />
&lt;li&gt;vti_casesensitiveurls<br />
&lt;li&gt;IX|0<br />
&lt;li&gt;vti_htmlextensions<br />
&lt;li&gt;SX|.html.htm.shtml.shtm.stm.htt.htx.asp.aspx.alx.asa.hta.htc.jsp.cfm.odc.dwt.php.phtml.php2.php3.php4.<br />
&lt;li&gt;vti_approvallevels<br />
&lt;li&gt;VR|Approved Denied Pending&amp;#92; Review<br />
&lt;li&gt;vti_themedefault<br />
&lt;li&gt;SR|none<br />
&lt;li&gt;vti_welcomenames<br />
&lt;li&gt;VX|<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">default</span>.htm <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">default</span>.aspx<br />
&lt;li&gt;vti_servertz<br />
&lt;li&gt;SX|+0100<br />
&lt;li&gt;vti_adminurl<br />
&lt;li&gt;SX|http:<span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//sharepoint.flexnet.ds/_layouts/1033/settings.aspx</span><br />
&lt;li&gt;vti_showhiddenpages<br />
&lt;li&gt;IW|1<br />
&lt;li&gt;vti_categories<br />
&lt;li&gt;VR|Business Competition Expense&amp;#92; Report Goals/Objectives Ideas In&amp;#92;
Process Miscellaneous Planning Schedule Travel VIP Waiting<br />
&lt;li&gt;vti_featurelist<br />
&lt;li&gt;VX|vti_RulesScript vti_ServerIndexServer vti_TimedDocEvents vti_ServiceMarkUrlDirExec
vti_DocSaveToDB vti_ServiceMarkUrlDirBrowse vti_ACAll vti_ServerODBC vti_ServerASP
vti_ServiceMarkUrlDirScript<br />
&lt;li&gt;vti_hasfulltextsearch<br />
&lt;li&gt;IX|1<br />
&lt;li&gt;vti_defaultcharset<br />
&lt;li&gt;SR|windows-1252<br />
&lt;li&gt;vti_navbuttonuplabel<br />
&lt;li&gt;SR|Up<br />
&lt;li&gt;vti_httpdversion<br />
&lt;li&gt;SX|Microsoft-IIS/6.0<br />
&lt;li&gt;vti_serverlanguages<br />
&lt;li&gt;VX|en-us<br />
&lt;li&gt;vti_sourcecontrolproject<br />
&lt;li&gt;SX|&amp;#60;STS-based Locking&amp;#62;<br />
&lt;li&gt;vti_doclibwebviewenabled<br />
&lt;li&gt;IX|1<br />
&lt;li&gt;vti_extenderversion<br />
&lt;li&gt;SR|6.0.2.6361<br />
&lt;li&gt;vti_ignorekeyboard<br />
&lt;li&gt;IR|0<br />
&lt;li&gt;vti_navbuttonprevlabel<br />
&lt;li&gt;SR|Back<br />
&lt;li&gt;vti_longfilenames<br />
&lt;li&gt;IX|1<br />
&lt;li&gt;vti_sourcecontrolsystem<br />
&lt;li&gt;SX|lw<br />
&lt;li&gt;vti_username<br />
&lt;li&gt;SX|FLEXNET&amp;#92;colinb<br />
&lt;li&gt;vti_navbuttonhomelabel<br />
&lt;li&gt;SR|Home<br />
&lt;li&gt;vti_sourcecontrolcookie<br />
&lt;li&gt;SX|fp_internal<br />
&lt;li&gt;vti_sitecollectionurl<br />
&lt;li&gt;SX|/<br />
&lt;li&gt;vti_language<br />
&lt;li&gt;IR|1033<br />
&lt;/ul&gt;<br />
&lt;/ul&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br /></span>
        </p>
        <p>
 
</p>
        <p>
Notice my windows username is listed against the vti_username item.
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">Using
the XmlHttpRequest object to call author.dll s<span style="FONT-SIZE: 10pt; COLOR: #003300; mso-bidi-font-family: 'Courier New'">ynchronously
(we're going to wait for the call to return)</span></font>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">xmlrequest <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"method=open
service:6.0.2.6356&amp;service_name="</span>;<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (!xmlhttp)
xmlhttp=GetHTTPObject();<br /><br />
xmlhttp.open(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"POST"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"/_vti_bin/_vti_aut/author.dll
"</span>,<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>); 
<br />
xmlhttp.setRequestHeader(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Content-Type"</span>,<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/x-www-form-urlencoded"</span>);<br />
xmlhttp.setRequestHeader(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X-Vermeer-Content-Type"</span>,<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/x-www-form-urlencoded"</span>);<br /><br />
xmlhttp.send(xmlrequest);<br /></span>
        </p>
        <p>
The responseText property on xmlhttp contains the returned document.
</p>
        <p>
The hardest bit is parsing the result to extract the username.
</p>
        <p>
Once that is done I show the username in a DIV element.
</p>
        <p>
So the next time someone asks this question we'll be able to give them some options.
</p>
        <p>
          <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/ClientSideUsername.dwp">ClientSideUsername.dwp
(2.92 KB)</a>
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=67e085b5-e328-4b3c-b814-9db550b99d82" />
      </body>
      <title>Client Side: Who am I?</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,67e085b5-e328-4b3c-b814-9db550b99d82.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/04/02/ClientSideWhoAmI.aspx</link>
      <pubDate>Sun, 02 Apr 2006 15:43:59 GMT</pubDate>
      <description>&lt;p&gt;
Sometimes when working in client-side javascript you'd like to know your Windows username
for instance to add to the root Outlook Web Access URL for say&amp;nbsp;a contacts search
i.e. &lt;a href="http://flexnetowa/exchange/colinb/contacts/?cmd=search"&gt;http://flexnetowa/exchange/colinb/contacts/?cmd=search&lt;/a&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Now the stock answer whenever this comes up in the SharePoint newsgroups is: it can't
be done, use server side code to render it out.
&lt;/p&gt;
&lt;p&gt;
Thats fair enough and easy to do, I've created a WebPart that stores a users details
as a JavaScript object so it can be referenced in code. But what if I don't want to
install yet another server-side Web Part. 
&lt;/p&gt;
&lt;p&gt;
In the interests of providing code you won't get anywhere else here's&amp;nbsp;the tip.
&lt;/p&gt;
&lt;p&gt;
Now its true the SharePoint Web Services provide no method to tell you who you are
(side-note: I suspect&amp;nbsp;you may be able to do this by creating a CAML query against
the userinfo table but I've not managed to get that working) but you can get your
username by using the FrontPage RPC and calling author.dll, this is how Word displays
who you are on its TaskPane when you open a Word document in a document library. 
&lt;/p&gt;
&lt;p&gt;
When you call the author.dll ISAPI DLL with the 'open service' method name it returns
a host of information about the server and the services it provides.
&lt;/p&gt;
&lt;p&gt;
I'm using the XmlHttpRequest object again which despite the name can also be used
to retrieve a text document not just an XML one.
&lt;/p&gt;
&lt;p&gt;
heres the returned information
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;vermeer
RPC packet&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br&gt;
&amp;lt;body&amp;gt;&lt;br&gt;
&amp;lt;p&amp;gt;method=open service:6.0.2.6356&lt;br&gt;
&amp;lt;p&amp;gt;service=&lt;br&gt;
&amp;lt;ul&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;service_name=&lt;br&gt;
&amp;lt;li&amp;gt;meta_info=&lt;br&gt;
&amp;lt;ul&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;vti_defaultlanguage&lt;br&gt;
&amp;lt;li&amp;gt;SW|en-us&lt;br&gt;
&amp;lt;li&amp;gt;vti_usernames&lt;br&gt;
&amp;lt;li&amp;gt;VR|&lt;br&gt;
&amp;lt;li&amp;gt;vti_servercharsets&lt;br&gt;
&amp;lt;li&amp;gt;VX|windows-1257 big5 windows-1252 windows-874 utf-8 windows-1251 windows-1256
euc-kr gb2312 windows-1253 windows-1258 koi8-r iso-8859-1 gb18030 iso-2022-jp ks_c_5601-1987
windows-1250 windows-1255 us-ascii euc-jp unicode unicodeFFFE windows-1254 iso-8859-2
iso-8859-15 shift_jis&lt;br&gt;
&amp;lt;li&amp;gt;vti_scnoprompt&lt;br&gt;
&amp;lt;li&amp;gt;IX|1&lt;br&gt;
&amp;lt;li&amp;gt;vti_toolpaneurl&lt;br&gt;
&amp;lt;li&amp;gt;SX|http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sharepoint.flexnet.ds/_layouts/1033/toolpane.aspx&lt;/span&gt;
&lt;br&gt;
&amp;lt;li&amp;gt;vti_assemblyversion&lt;br&gt;
&amp;lt;li&amp;gt;SX|Microsoft.SharePoint, Version&amp;amp;#61;11.0.0.0, Culture&amp;amp;#61;neutral,
PublicKeyToken&amp;amp;#61;71e9bce111e9429c&lt;br&gt;
&amp;lt;li&amp;gt;vti_webtemplate&lt;br&gt;
&amp;lt;li&amp;gt;IR|1&lt;br&gt;
&amp;lt;li&amp;gt;vti_hasonetlayoutfiles&lt;br&gt;
&amp;lt;li&amp;gt;BR|&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;
&lt;br&gt;
&amp;lt;li&amp;gt;vti_navbuttonnextlabel&lt;br&gt;
&amp;lt;li&amp;gt;SR|Next&lt;br&gt;
&amp;lt;li&amp;gt;vti_casesensitiveurls&lt;br&gt;
&amp;lt;li&amp;gt;IX|0&lt;br&gt;
&amp;lt;li&amp;gt;vti_htmlextensions&lt;br&gt;
&amp;lt;li&amp;gt;SX|.html.htm.shtml.shtm.stm.htt.htx.asp.aspx.alx.asa.hta.htc.jsp.cfm.odc.dwt.php.phtml.php2.php3.php4.&lt;br&gt;
&amp;lt;li&amp;gt;vti_approvallevels&lt;br&gt;
&amp;lt;li&amp;gt;VR|Approved Denied Pending&amp;amp;#92; Review&lt;br&gt;
&amp;lt;li&amp;gt;vti_themedefault&lt;br&gt;
&amp;lt;li&amp;gt;SR|none&lt;br&gt;
&amp;lt;li&amp;gt;vti_welcomenames&lt;br&gt;
&amp;lt;li&amp;gt;VX|&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;default&lt;/span&gt;.htm &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;default&lt;/span&gt;.aspx&lt;br&gt;
&amp;lt;li&amp;gt;vti_servertz&lt;br&gt;
&amp;lt;li&amp;gt;SX|+0100&lt;br&gt;
&amp;lt;li&amp;gt;vti_adminurl&lt;br&gt;
&amp;lt;li&amp;gt;SX|http:&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//sharepoint.flexnet.ds/_layouts/1033/settings.aspx&lt;/span&gt;
&lt;br&gt;
&amp;lt;li&amp;gt;vti_showhiddenpages&lt;br&gt;
&amp;lt;li&amp;gt;IW|1&lt;br&gt;
&amp;lt;li&amp;gt;vti_categories&lt;br&gt;
&amp;lt;li&amp;gt;VR|Business Competition Expense&amp;amp;#92; Report Goals/Objectives Ideas In&amp;amp;#92;
Process Miscellaneous Planning Schedule Travel VIP Waiting&lt;br&gt;
&amp;lt;li&amp;gt;vti_featurelist&lt;br&gt;
&amp;lt;li&amp;gt;VX|vti_RulesScript vti_ServerIndexServer vti_TimedDocEvents vti_ServiceMarkUrlDirExec
vti_DocSaveToDB vti_ServiceMarkUrlDirBrowse vti_ACAll vti_ServerODBC vti_ServerASP
vti_ServiceMarkUrlDirScript&lt;br&gt;
&amp;lt;li&amp;gt;vti_hasfulltextsearch&lt;br&gt;
&amp;lt;li&amp;gt;IX|1&lt;br&gt;
&amp;lt;li&amp;gt;vti_defaultcharset&lt;br&gt;
&amp;lt;li&amp;gt;SR|windows-1252&lt;br&gt;
&amp;lt;li&amp;gt;vti_navbuttonuplabel&lt;br&gt;
&amp;lt;li&amp;gt;SR|Up&lt;br&gt;
&amp;lt;li&amp;gt;vti_httpdversion&lt;br&gt;
&amp;lt;li&amp;gt;SX|Microsoft-IIS/6.0&lt;br&gt;
&amp;lt;li&amp;gt;vti_serverlanguages&lt;br&gt;
&amp;lt;li&amp;gt;VX|en-us&lt;br&gt;
&amp;lt;li&amp;gt;vti_sourcecontrolproject&lt;br&gt;
&amp;lt;li&amp;gt;SX|&amp;amp;#60;STS-based Locking&amp;amp;#62;&lt;br&gt;
&amp;lt;li&amp;gt;vti_doclibwebviewenabled&lt;br&gt;
&amp;lt;li&amp;gt;IX|1&lt;br&gt;
&amp;lt;li&amp;gt;vti_extenderversion&lt;br&gt;
&amp;lt;li&amp;gt;SR|6.0.2.6361&lt;br&gt;
&amp;lt;li&amp;gt;vti_ignorekeyboard&lt;br&gt;
&amp;lt;li&amp;gt;IR|0&lt;br&gt;
&amp;lt;li&amp;gt;vti_navbuttonprevlabel&lt;br&gt;
&amp;lt;li&amp;gt;SR|Back&lt;br&gt;
&amp;lt;li&amp;gt;vti_longfilenames&lt;br&gt;
&amp;lt;li&amp;gt;IX|1&lt;br&gt;
&amp;lt;li&amp;gt;vti_sourcecontrolsystem&lt;br&gt;
&amp;lt;li&amp;gt;SX|lw&lt;br&gt;
&amp;lt;li&amp;gt;vti_username&lt;br&gt;
&amp;lt;li&amp;gt;SX|FLEXNET&amp;amp;#92;colinb&lt;br&gt;
&amp;lt;li&amp;gt;vti_navbuttonhomelabel&lt;br&gt;
&amp;lt;li&amp;gt;SR|Home&lt;br&gt;
&amp;lt;li&amp;gt;vti_sourcecontrolcookie&lt;br&gt;
&amp;lt;li&amp;gt;SX|fp_internal&lt;br&gt;
&amp;lt;li&amp;gt;vti_sitecollectionurl&lt;br&gt;
&amp;lt;li&amp;gt;SX|/&lt;br&gt;
&amp;lt;li&amp;gt;vti_language&lt;br&gt;
&amp;lt;li&amp;gt;IR|1033&lt;br&gt;
&amp;lt;/ul&amp;gt;&lt;br&gt;
&amp;lt;/ul&amp;gt;&lt;br&gt;
&amp;lt;/body&amp;gt;&lt;br&gt;
&amp;lt;/html&amp;gt;&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Notice my windows username is listed against the vti_username item.
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;Using
the XmlHttpRequest object&amp;nbsp;to call author.dll s&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; mso-bidi-font-family: 'Courier New'"&gt;ynchronously
(we're going to wait for the call to return)&lt;/span&gt;
&lt;/p&gt;
&gt;&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;xmlrequest &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"method=open
service:6.0.2.6356&amp;amp;service_name="&lt;/span&gt;;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (!xmlhttp)
xmlhttp=GetHTTPObject();&lt;br&gt;
&lt;br&gt;
xmlhttp.open(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"POST"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"/_vti_bin/_vti_aut/author.dll
"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;); 
&lt;br&gt;
xmlhttp.setRequestHeader(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Content-Type"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/x-www-form-urlencoded"&lt;/span&gt;);&lt;br&gt;
xmlhttp.setRequestHeader(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"X-Vermeer-Content-Type"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/x-www-form-urlencoded"&lt;/span&gt;);&lt;br&gt;
&lt;br&gt;
xmlhttp.send(xmlrequest);&lt;br&gt;
&lt;/p&gt;
&gt; 
&lt;p&gt;
The responseText property on xmlhttp contains the returned document.
&lt;/p&gt;
&lt;p&gt;
The hardest bit is parsing the result to extract the username.
&lt;/p&gt;
&lt;p&gt;
Once that is done I show the username&amp;nbsp;in&amp;nbsp;a DIV element.
&lt;/p&gt;
&lt;p&gt;
So the next time someone asks this question we'll be able to give them some options.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/ClientSideUsername.dwp"&gt;ClientSideUsername.dwp
(2.92 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=67e085b5-e328-4b3c-b814-9db550b99d82" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,67e085b5-e328-4b3c-b814-9db550b99d82.aspx</comments>
      <category>AJAX</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=0b043e21-c672-4558-a8e5-db526e1799ea</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b043e21-c672-4558-a8e5-db526e1799ea.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b043e21-c672-4558-a8e5-db526e1799ea.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=0b043e21-c672-4558-a8e5-db526e1799ea</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,932884be-2276-4236-8df4-f360149b5fd1.aspx">part
1</a> we have got to the point where we have called the SharePoint lists.asmx Web
Service and retrieved the list of all Lists on our SharePoint site.<br />
We now need to filter down to only those lists that are based on the links list template,
this is template type 103, we can use an Xpath expression to filter the items. 
<br /></p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Filter for the Links lists items </span>
            <br />
links_lists=ajaxsp_GetSoapResponseItems(xmlhttpLists.responseXML, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"//sp:List[@ServerTemplate='"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> ListTemplate <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"']"</span>,
moz_NSResolver1 );</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" size="2">We
loop through the list items and use the getAttribute of the XML Dom node to retrieve
the fields we are interested in and concatenate a string of &lt;LI&gt; items which
we then set to the innerHTML property of a DIV element.</font>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" size="2">Each
list item on the left is a hyperlink that calls the javascript function GetLinkItems
when clicked.<br />
This function is passed three parameters - the list Guid, list Title and the Default
View URL which normally is the full list of links.</font>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">function
GetLinkItems(ListGuid, ListName, ListDefaultView)</span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p>
            <br />
            <font face="Verdana" size="2">To get the list items we need to call the GetListItems
method and pass it the listName parameter.</font>
          </p>
          <font face="Verdana" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Create SOAP Request</span>
                <br />
xmlrequest <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> SoapPrefix <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> '&lt;GetListItems
xmlns=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://schemas.microsoft.com/sharepoint/soap/"</span>&gt;'<br />
xmlrequest <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> xmlrequest <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> '&lt;listName&gt;' <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> ListGuid <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> '&lt;/listName&gt;&lt;/GetListItems&gt;' <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> SoapPostfix;<br /></span>
            </p>
          </font>
          <p>
            <font face="Verdana" size="2">To send the SOAP request we do the same as before only
this time we set the GetListItems SOAP method</font>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">xmlhttpItems.open(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"POST"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"_vti_bin/Lists.asmx?op=GetListItems
"</span>,<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>);
xmlhttpItems.setRequestHeader(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Content-Type"</span>,<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"text/xml;
charset=utf-8"</span>); xmlhttpItems.setRequestHeader(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SOAPAction"</span>,<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://schemas.microsoft.com/sharepoint/soap/GetListItems
"</span>); 
<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Set event handler </span><br />
xmlhttpItems.onreadystatechange=ajaxsp_GetLinkItemsEvent; 
<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Post request</span><br />
xmlhttpItems.send(xmlrequest);</span>
          </p>
          <p>
            <font face="Verdana" size="2">Our GetLinkItemsEvent parses the XML and formats the
data into a TABLE element with the ms-summarycustombody style to match the theme of
the SharePoint site.<br />
Each hyperlink has the target=”_blank” attribute which causes the links to open in
a new window, my preferred method of opening links. This can easily be changed.</font>
            <br />
            <br />
          </p>
          <p>
            <font face="Verdana" size="2">
              <strong>Creating a new Item Form</strong>
            </font>
          </p>
          <p>
            <font face="Verdana" size="2">Now we have displayed our list of links we need to look
at adding a new item.<br />
In the Web Part after the script blocks I have some HTML that contains a DIV element.
The DIV element has a style that sets its position to be absolute and hidden.<br />
Inside the DIV I’ve create a HTML table that sets the layout of the AddNew form.<br />
To render the URL editing and Notes fields I use the built-in functions provided in
the SharePoint javascript file ows.js to handle input fields on SharePoint forms. 
<br />
The complete list of fields type that can be used are:</font>
          </p>
          <p>
            <font face="Verdana" size="2">DateField<br />
URLField<br />
NumberField<br />
BooleanField<br />
NoteField<br />
RichTextField<br />
TextField<br />
FileNameField<br />
GridChoiceField<br />
ChoiceField</font>
          </p>
          <p>
            <font face="Verdana" size="2">I only need to use the URLField and NoteField type. </font>
          </p>
          <p>
            <br />
            <font face="Verdana" size="2">These functions are called in javascript like this 
<br />
var fld = new URLField(frm,"URL","URL", "","");<br />
fld.fRequired = true;<br />
fld.IMEMode="";fld.BuildUI();</font>
          </p>
          <p>
            <font face="Verdana" size="2">The URLField function takes parameters of a OWSForm,
Internal Field Name, Display Name, Default URL Value , Default Description.<br />
BuildUI takes care of creating the input HTML which is great as it automatically creates
two input fields, one for the URL and one for the description. </font>
          </p>
          <p>
            <font face="Verdana" size="2">I create a NoteField object like this.</font>
          </p>
          <p>
            <font face="Verdana" size="2">fld = new NoteField(frm,"Comments","Notes","");<br />
fld.stNumLines = "6";<br />
fld.IMEMode="";<br />
fld.BuildUI();</font>
          </p>
          <p>
            <font face="Verdana" size="2">The NoteField functions parameters are a OWSForm, Internal
Field Name, Display Name, Default Note Field Value</font>
          </p>
          <p>
            <br />
            <font face="Verdana" size="2">Heres the function prototype for creating a OWSForm
object:<br /></font>
          </p>
          <p>
            <font face="Verdana" size="2">function OWSForm(stName, fUseDHTMLOverride, stPagePath)</font>
          </p>
          <p>
            <font face="Verdana" size="2">Creating the OWSForm is tricky in that it’s easy to
create the OWSForm object in itself but it expects the name of the onpage form used
in the WebPart page postbacks, that’s fine but it overwrites the onsubmit function
which causes problems for any other component like the Web Part settings toolbar that
need to post to the server. The way around this is to pass it a dummy name and then
after the call set the Form name to the genuine article.<br />
The second parameter is fUseDHTMLOverride which is used to force the use of DHTML
when rendering the controls.<br />
stPagePath is used to locate any extra files needed such as the datepicker’s template
htm page.</font>
          </p>
          <p>
            <font face="Verdana" size="2">Heres how its called in code</font>
          </p>
          <font face="Verdana" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Pass a dummy form name so it does not overwrite the Submit event </span>
                <br />
var _WPQ_frm= <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> OWSForm(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"DummyName"</span> , <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"_layouts/"</span>); 
<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Now assign the proper form name it as it’s needed for the fields to locate their values </span><br />
_WPQ_frm.stName=MSOWebPartPageFormName; 
<br /></span>
            </p>
          </font>
          <p>
            <font face="Verdana" size="2">We use the global variable MSOWebPartPageFormName here
which is defined in ows.js and available on all WebPartPages and gives the name of
the FORM element used for postback. Note we don’t postback ourselves but the OWS Field
elements think that they might.</font>
          </p>
          <p>
            <font face="Verdana" size="2">I’ve laid out the new item form with the Javascript
to create the edit fields embedded in a HTML table. This table is wrapped in a DIV
which is initially hidden. The code to show and center the DIV element is Javascript
101 so I won’t go into details but check the function ajaxsp_DisplayNewForm if you’re
interested.</font>
          </p>
          <p>
            <font face="Verdana" size="2">I want to set focus to the Http edit field so we need
to a reference to the Edit fields. 
<br />
We can use getElementById for this but we need to know the name of the field on the
form.<br />
The key to this is to understand how the OWS form elements name themselves.</font>
          </p>
          <p>
            <font face="Verdana" size="2">Fields are named by the internal function FrmStFieldNameFactory
which does this: 
<br />
return "OWS:" + name + ":" + stPart;<br />
This concatenates OWS with the name of the field and the subfield name. </font>
          </p>
          <p>
            <font face="Verdana" size="2">The URL field type is composed of two sub fields named
URL and Desc. In this case we’re referencing the URL field and the URL subpart of
that field. </font>
          </p>
          <p>
            <font face="Verdana" size="2">So to reference the URL sub part of the URL field we
can use this code.</font>
          </p>
          <p>
            <font face="Verdana" size="2">var fldURL=document.getElementById("OWS:URL:URL"); 
<br />
if (fldURL) fldURL.focus();</font>
          </p>
          <p>
            <font face="Verdana" size="2">
            </font> 
</p>
          <p>
            <font face="Verdana" size="2">
              <strong>Adding a new record via SOAP services</strong>
            </font>
          </p>
          <p>
            <font face="Verdana" size="2">Now that we can get the URL, Description and Notes field
values we use the UpdateListItems method of the Lists.asmx web service to add the
new record. 
<br />
This method takes a CAML string to do adds, updates and deletes. 
<br />
This is an example CAML batch string we send:</font>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;Batch&gt;<br />
&lt;Method ID='1' Cmd='New'&gt;<br />
&lt;Field Name='URL'&gt;http/www.google.com, Description here <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">-</span> note
comma and space&lt;/Field&gt;<br />
&lt;Field Name='Comments'&gt;My Comment String&lt;/Field&gt;<br />
&lt;Method&gt;<br />
&lt;/Batch&gt;</span>
          </p>
          <p>
            <font face="Verdana" size="2">The ajaxsp_AddListItem routine assembles this string,
places it inside the UpdateListItems SOAP string and sends it to the web service.  
<br />
The ajaxsp_AddListItemEvent handles the returned SOAP string which may include a faultstring
node if the SOAP call fails or an ErrorText node if the new record fails to add in
SharePoint. Once the insert succeeds we hide the new item form and refresh the list. </font>
          </p>
          <p>
            <font face="Verdana" size="2">Thats almost it, there is some extra code where I store
the last displayed list in a cookie so if the page refreshes I can display the list
items again. This cookie is designed to only last for the browser session.</font>
          </p>
          <p>
            <font face="Verdana" size="2">
              <br />
 
</font>
          </p>
          <p>
            <font face="Verdana" size="2">
              <strong>Summary</strong>
            </font>
          </p>
          <p>
            <font face="Verdana" size="2">This has been a deep dive into calling the SharePoint
Web Services from client side javascript but the actual methods involved are pretty
basic and simple to use, most of the complications and extra code come from handling
non IE browsers.</font>
          </p>
          <p>
            <font face="Verdana" size="2">Some of the other ways that Web Services could be used
include adding field by field server-side validation, filling comboboxes from SQL
Server tables, getting unread email counts information from Exchange via WebDav.</font>
            <br />
            <br />
          </p>
          <p>
            <font face="Verdana" size="2">Feel free to download the DWP file and browse the code
for yourselves.
</font>
          </p>
          <p>
          </p>
        </span>
        <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/LinksLists.dwp">LinksLists.dwp
(16.2 KB)</a>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b043e21-c672-4558-a8e5-db526e1799ea" />
      </body>
      <title>Cross-Browser AJAX for SharePoint Lists Part 2</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,0b043e21-c672-4558-a8e5-db526e1799ea.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/04/02/CrossBrowserAJAXForSharePointListsPart2.aspx</link>
      <pubDate>Sun, 02 Apr 2006 14:55:49 GMT</pubDate>
      <description>&lt;p&gt;
In &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,932884be-2276-4236-8df4-f360149b5fd1.aspx"&gt;part
1&lt;/a&gt; we have got to the point where we have called the SharePoint lists.asmx Web
Service and retrieved the list of all Lists on our SharePoint site.&lt;br&gt;
We now need to filter down to only those lists that are based on the links list template,
this is template type 103, we can use an Xpath expression to filter the items. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Filter for the Links lists items &lt;/span&gt;
&lt;br&gt;
links_lists=ajaxsp_GetSoapResponseItems(xmlhttpLists.responseXML, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"//sp:List[@ServerTemplate='"&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; ListTemplate &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"']"&lt;/span&gt;,
moz_NSResolver1 );&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;We
loop through the list items and use the getAttribute of the XML Dom node to retrieve
the fields we are interested in and concatenate a string of &amp;lt;LI&amp;gt; items which
we then set to the innerHTML property of a DIV element.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;Each
list item on the left is a hyperlink that calls the javascript function GetLinkItems
when clicked.&lt;br&gt;
This function is passed three parameters - the list Guid, list Title and the Default
View URL which normally is the full list of links.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;function
GetLinkItems(ListGuid, ListName, ListDefaultView)&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p&gt;
&lt;br&gt;
&lt;font face=Verdana size=2&gt;To get the list items we need to call the GetListItems method
and pass it the listName parameter.&lt;/font&gt;
&lt;/p&gt;
&lt;font face=Verdana size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Create SOAP Request&lt;/span&gt;
&lt;br&gt;
xmlrequest &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; SoapPrefix &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; '&amp;lt;GetListItems
xmlns=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://schemas.microsoft.com/sharepoint/soap/"&lt;/span&gt;&amp;gt;'&lt;br&gt;
xmlrequest &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; xmlrequest &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; '&amp;lt;listName&amp;gt;' &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; ListGuid &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; '&amp;lt;/listName&amp;gt;&amp;lt;/GetListItems&amp;gt;' &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; SoapPostfix;&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/font&gt; 
&lt;p&gt;
&lt;font face=Verdana size=2&gt;To send the SOAP request we do the same as before only this
time we set the GetListItems SOAP method&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;xmlhttpItems.open(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"POST"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"_vti_bin/Lists.asmx?op=GetListItems
"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;);
xmlhttpItems.setRequestHeader(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Content-Type"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"text/xml;
charset=utf-8"&lt;/span&gt;); xmlhttpItems.setRequestHeader(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SOAPAction"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://schemas.microsoft.com/sharepoint/soap/GetListItems
"&lt;/span&gt;); 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Set event handler &lt;/span&gt;
&lt;br&gt;
xmlhttpItems.onreadystatechange=ajaxsp_GetLinkItemsEvent; 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Post request&lt;/span&gt;
&lt;br&gt;
xmlhttpItems.send(xmlrequest);&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Our GetLinkItemsEvent parses the XML and formats the data
into a TABLE element with the ms-summarycustombody style to match the theme of the
SharePoint site.&lt;br&gt;
Each hyperlink has the target=”_blank” attribute which causes the links to open in
a new window, my preferred method of opening links. This can easily be changed.&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;&lt;strong&gt;Creating a new Item Form&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Now we have displayed our list of links we need to look
at adding a new item.&lt;br&gt;
In the Web Part after the script blocks I have some HTML that contains a DIV element.
The DIV element has a style that sets its position to be absolute and hidden.&lt;br&gt;
Inside the DIV I’ve create a HTML table that sets the layout of the AddNew form.&lt;br&gt;
To render the URL editing and Notes fields I use the built-in functions provided in
the SharePoint javascript file ows.js to handle input fields on SharePoint forms. 
&lt;br&gt;
The complete list of fields type that can be used are:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;DateField&lt;br&gt;
URLField&lt;br&gt;
NumberField&lt;br&gt;
BooleanField&lt;br&gt;
NoteField&lt;br&gt;
RichTextField&lt;br&gt;
TextField&lt;br&gt;
FileNameField&lt;br&gt;
GridChoiceField&lt;br&gt;
ChoiceField&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;I only need to use the URLField and NoteField type. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;font face=Verdana size=2&gt;These functions are called in javascript like this 
&lt;br&gt;
var fld = new URLField(frm,"URL","URL", "","");&lt;br&gt;
fld.fRequired = true;&lt;br&gt;
fld.IMEMode="";fld.BuildUI();&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;The URLField function takes parameters of a OWSForm, Internal
Field Name, Display Name, Default URL Value , Default Description.&lt;br&gt;
BuildUI takes care of creating the input HTML which is great as it automatically creates
two input fields, one for the URL and one for the description. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;I create a NoteField object like this.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;fld = new NoteField(frm,"Comments","Notes","");&lt;br&gt;
fld.stNumLines = "6";&lt;br&gt;
fld.IMEMode="";&lt;br&gt;
fld.BuildUI();&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;The NoteField functions parameters are a OWSForm, Internal
Field Name, Display Name, Default Note Field Value&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;font face=Verdana size=2&gt;Heres the function prototype for creating a OWSForm object:&lt;br&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;function OWSForm(stName, fUseDHTMLOverride, stPagePath)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Creating the OWSForm is tricky in that it’s easy to create
the OWSForm object in itself but it expects the name of the onpage form used in the
WebPart page postbacks, that’s fine but it overwrites the onsubmit function which
causes problems for any other component like the Web Part settings toolbar that need
to post to the server. The way around this is to pass it a dummy name and then after
the call set the Form name to the genuine article.&lt;br&gt;
The second parameter is fUseDHTMLOverride which is used to force the use of DHTML
when rendering the controls.&lt;br&gt;
stPagePath is used to locate any extra files needed such as the datepicker’s template
htm page.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Heres how its called in code&lt;/font&gt;
&lt;/p&gt;
&lt;font face=Verdana size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Pass a dummy form name so it does not overwrite the Submit event &lt;/span&gt;
&lt;br&gt;
var _WPQ_frm= &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; OWSForm(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"DummyName"&lt;/span&gt; , &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"_layouts/"&lt;/span&gt;); 
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Now assign the proper form name it as it’s needed for the fields to locate their values &lt;/span&gt;
&lt;br&gt;
_WPQ_frm.stName=MSOWebPartPageFormName; 
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/font&gt; 
&lt;p&gt;
&lt;font face=Verdana size=2&gt;We use the global variable MSOWebPartPageFormName here which
is defined in ows.js and available on all WebPartPages and gives the name of the FORM
element used for postback. Note we don’t postback ourselves but the OWS Field elements
think that they might.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;I’ve laid out the new item form with the Javascript to create
the edit fields embedded in a HTML table. This table is wrapped in a DIV which is
initially hidden. The code to show and center the DIV element is Javascript 101 so
I won’t go into details but check the function ajaxsp_DisplayNewForm if you’re interested.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;I want to set focus to the Http edit field so we need to
a reference to the Edit fields. 
&lt;br&gt;
We can use getElementById for this but we need to know the name of the field on the
form.&lt;br&gt;
The key to this is to understand how the OWS form elements name themselves.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Fields are named by the internal function FrmStFieldNameFactory
which does this: 
&lt;br&gt;
return "OWS:" + name + ":" + stPart;&lt;br&gt;
This concatenates OWS with the name of the field and the subfield name. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;The URL field type is composed of two sub fields named URL
and Desc. In this case we’re referencing the URL field and the URL subpart of that
field. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;So to reference the URL sub part of the URL field we can
use this code.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;var fldURL=document.getElementById("OWS:URL:URL"); 
&lt;br&gt;
if (fldURL) fldURL.focus();&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;&lt;strong&gt;Adding a new record via SOAP services&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Now that we can get the URL, Description and Notes field
values we use the UpdateListItems method of the Lists.asmx web service to add the
new record. 
&lt;br&gt;
This method takes a CAML string to do adds, updates and deletes. 
&lt;br&gt;
This is an example CAML batch string we send:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;Batch&amp;gt;&lt;br&gt;
&amp;lt;Method ID='1' Cmd='New'&amp;gt;&lt;br&gt;
&amp;lt;Field Name='URL'&amp;gt;http/www.google.com, Description here &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;-&lt;/span&gt; note
comma and space&amp;lt;/Field&amp;gt;&lt;br&gt;
&amp;lt;Field Name='Comments'&amp;gt;My Comment String&amp;lt;/Field&amp;gt;&lt;br&gt;
&amp;lt;Method&amp;gt;&lt;br&gt;
&amp;lt;/Batch&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;The ajaxsp_AddListItem routine assembles this string, places
it inside the UpdateListItems SOAP string and sends it to the web service.&amp;nbsp; 
&lt;br&gt;
The ajaxsp_AddListItemEvent handles the returned SOAP string which may include a faultstring
node if the SOAP call fails or an ErrorText node if the new record fails to add in
SharePoint. Once the insert succeeds we hide the new item form and refresh the list. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Thats almost it, there is some extra code where I store
the last displayed list in a cookie so if the page refreshes I can display the list
items again. This cookie is designed to only last for the browser session.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&gt; 
&lt;p&gt;
&lt;font face=Verdana size=2&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;This has been a deep dive into calling the SharePoint Web
Services from client side javascript but the actual methods involved are pretty basic
and simple to use, most of the complications and extra code come from handling non
IE browsers.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Some of the other ways that Web Services could be used include
adding field by field server-side validation, filling comboboxes from SQL Server tables,
getting unread email counts information from Exchange via WebDav.&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Feel free to download the DWP file and browse the code for
yourselves.
&lt;/p&gt;
&lt;p&gt;
&gt;
&lt;/span&gt;&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/LinksLists.dwp"&gt;LinksLists.dwp
(16.2 KB)&lt;/a&gt;&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=0b043e21-c672-4558-a8e5-db526e1799ea" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,0b043e21-c672-4558-a8e5-db526e1799ea.aspx</comments>
      <category>AJAX</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=97997234-5407-4cd3-95d1-d6e074a6a037</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,97997234-5407-4cd3-95d1-d6e074a6a037.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,97997234-5407-4cd3-95d1-d6e074a6a037.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=97997234-5407-4cd3-95d1-d6e074a6a037</wfw:commentRss>
      <title>Add SharePoint Portal Exclude/ Include Rules via Code</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,97997234-5407-4cd3-95d1-d6e074a6a037.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/03/13/AddSharePointPortalExcludeIncludeRulesViaCode.aspx</link>
      <pubDate>Mon, 13 Mar 2006 21:26:27 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;If
you have ever wondered how you can add or remove items via code that you see on the
exclude and include content page then here is some sample code to do that.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;As you can see in the screen-shot below I’ve added a new rule
(called a Site Restriction in SharePoint terms) that includes a main site and its
content and excludes a subsite, these sub filters are called SitePaths.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;img alt="" hspace=0 src="file:///C:/Documents%20and%20Settings/colinb/My%20Documents/blog/Include-Exclude%20Content/IncludeExclude-Content.gif" align=baseline border=0&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Using code shown at the end of this entry I've added the w2k3-devclient:5003
site rule.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;What we need to do is obtain the ISiteRestrictions interface and
use its Add method passing it a group name (note this is not the full URL it must
be&amp;nbsp;a without the http:// prefix) and true or false indicating whether it is to
be included or excluded.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;MSSITLB.ISiteRestriction
Add ( System.String bstrName , System.Boolean fIncluded )&lt;/span&gt;
&lt;/p&gt;
&lt;o:p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
The Add method returns a ISiteRestriction object which in turn has a Add method returning
a ISitePath2 object which allows us to add Site Paths to fine tune the filtering of
the content source.
&lt;/p&gt;
&lt;/o:p&gt;
&gt; 
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font size=2&gt;Some methods of the ISitePath2 interface
are&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; AccountName
[ get]&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; AuthenticationType
[ get]&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; FollowComplexUrls
[ get, set ]&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; Included
[ get, set ]&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; IncludeSubdirs
[ get, set ]&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; SuppressIndex
[ get, set ]&lt;br&gt;
&lt;/p&gt;
&gt; 
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;Curious at the 2 at the end of ISitePath2? Way back in the old days of
COM if you wanted to extend an interface with new methods you couldn’t change the
original as that was part of the COM contract of invariance of interfaces, so the
developers normally just pegged the next number up on the interface name to create
the new one. (Update: whoops this is just been added to .net best practice guidelines
;-) )&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;Now the path to actually get a ISiteRestriction interface is a bit torturous
mainly because all the functionality for controlling the search engine is done by
accessing the SharePoint Portal Search COM libraries via interop and the documentation
for these interfaces are completely missing. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;Also according to MSFT they are completely unsupported, hmm so the means
of controlling your enterprise wide search engine via API’s is unsupported? &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;This is not good but hopefully completely sorted via a managed interface
in v3. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;o:p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;For now to get access to the interfaces we need to add a reference to
thses libraries on the COM tab - the SharePoint Portal Search CoClasses Type Library
which gives us access to SearchAdminClass and also the Microsoft Search Interface
Type Library for the other COM interfaces.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;font size=2&gt;We instantiate the SearchAdminClass
class which gives use access to the Applications property, now Applications in MS
Search terminology comes down to the directory that the indexes are stored in. Different
applications will have different directories, it’s a way of separating index content. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/div&gt;
&lt;li&gt;
&lt;div class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;font size=2&gt;Each portal site has
a specific ApplicationName that we get from the PortalSite object. &lt;/font&gt;
&lt;/div&gt;
&lt;li&gt;
&lt;div class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;font size=2&gt;This then allows us
to get a reference to the BuilderServer interface which we can get the list of Catalogs. &lt;/font&gt;&lt;font size=2&gt;The
default catalogs are the famous Portal_Content and Non_Portal_Content.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/div&gt;
&lt;li&gt;
&lt;div class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;font size=2&gt;Then finally within
each catalog live the Site Restrictions which define the source of the data to be
indexed.&lt;/font&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;Heres the sample code for a simple console application that lists the
Catalogs and all the Site Restrictions and Site Paths within them.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font size=2&gt;As
shown in the screen-shot above it also adds some test rules to the Non_Portal_Content
catalog so comment that out of you don't want that to happen.&lt;/font&gt;&lt;/span&gt;
&lt;/o:p&gt;
&gt;
&lt;o:p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; Microsoft.SharePoint.Portal.Topology;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; MSSCTLB;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; MSSITLB;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/span&gt; ShowRestrictions&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
Summary description for Class1.&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Class1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
The main entry point for the application.&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;///
&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[STAThread]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Main(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;[]
args)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ShowRestrictions();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; ShowRestrictions()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TopologyManager
man=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; TopologyManager();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PortalSite
site=man.PortalSites[&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Uri(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://w2k3-devclient:5001"&lt;/span&gt;)];&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MSSCTLB.SearchAdminClass
sadmin=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SearchAdminClass();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IApplications
applications1 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (IApplications)
sadmin.Applications;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IApplication2
application1 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (IApplication2)
applications1[site.SearchApplicationName];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IBuildServer2
buildserver= (IBuildServer2)application1.BuildServer;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IBuildCatalogs2
catalogs=(IBuildCatalogs2)buildserver.BuildCatalogs;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt;(IBuildCatalog3
cat &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; catalogs)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Catalog
{0}"&lt;/span&gt;,cat.Name);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MSSITLB.ISiteRestrictions
siterestrictions=(MSSITLB.ISiteRestrictions)cat.Sites;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (cat.Name==&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Non_Portal_Content"&lt;/span&gt;)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MSSITLB.ISiteRestriction
NewSearchContent=siterestrictions.Add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"w2k3-devclient:5005"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NewSearchContent.Paths.Add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://w2k3-devclient:5005/sites/"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NewSearchContent.Paths.Add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://w2k3-devclient:5005/sites/dontsearchme/*"&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt;(ISiteRestriction2
restriction &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; siterestrictions)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(restriction.Name &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;","&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;+&lt;/span&gt; restriction.Included);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt;(MSSITLB.ISitePath2
sitepath &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; restriction.Paths)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.WriteLine(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SitePath
: {0},{1}"&lt;/span&gt;,sitepath.Path,sitepath.Included);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console.ReadLine();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
}&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/o:p&gt;
&lt;o:p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;Now there is a lot more to the Search classes than this, with them you
can control all aspects of the search process and I hope to get some time to do more
digging.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;o:p&gt;
&lt;font size=2&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=2&gt;Colin.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/o:p&gt;
&amp;nbsp;&gt;
&lt;p&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&gt;&gt;&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=97997234-5407-4cd3-95d1-d6e074a6a037" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,97997234-5407-4cd3-95d1-d6e074a6a037.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=4cf75796-a897-4b36-a1f4-c57cb681248f</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,4cf75796-a897-4b36-a1f4-c57cb681248f.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,4cf75796-a897-4b36-a1f4-c57cb681248f.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=4cf75796-a897-4b36-a1f4-c57cb681248f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here's something I thought I'd throw out there to demonstrate the much underrated
Content Editor Web Part (CEWP). It's a client-side JavaScript Color Picker based on
code from <a href="http://www.mickweb.com/javascript/colours/websafe.html">http://www.mickweb.com/javascript/colours/websafe.html</a> 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/ColorPicker.gif" border="0" />
        </p>
        <p>
The CEWP allows you to either embed formatted Rich Text into the web page or pure
HTML/JavaScript so I could very quickly create a Web Part using the copied javascript.
It just took a few mods such as getting rid of the image dependency by using a
SPAN to form the cells instead.
</p>
        <p>
The code's not much to talk about its just plain JavaScript creating a HTML &lt;table&gt;
with &lt;td&gt;'s for the color cells. One interesting point is that the color table
is dynamically generated. This is done by placing an empty block element, &lt;p&gt;
in this case, giving it an ID and then set its innerHTML property to the generated
table string.
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">function
AttachColorTable(){<br />
document.getElementById(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"'colourtable'"</span>).innerHTML=
table_maker(36,6,'Select Colour');<br />
}</span>
        </p>
        <p>
This code is called on the load event of the page. I use attachEvent so I don't override
any other code that may be using the onLoad event.<br /></p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">window.attachEvent('onload',AttachColorTable);</span>
        </p>
        <p>
You can either import the DWP file on a single page or upload to the Site or
Virtual Server galleries using instructions given by Todd Bleaker in a cool tip here <a href="http://mindsharpblogs.com/todd/archive/2005/08/04/646.aspx">http://mindsharpblogs.com/todd/archive/2005/08/04/646.aspx</a></p>
        <p>
Also check out the Google search Web Part also using the CEWP by Todd <a href="http://mindsharpblogs.com/todd/archive/2005/08/04/647.aspx">http://mindsharpblogs.com/todd/archive/2005/08/04/647.aspx</a></p>
        <p>
 
</p>
        <p>
Download : <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Color%20Picker1.zip">Color
Picker1.zip (1.36 KB)</a></p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=4cf75796-a897-4b36-a1f4-c57cb681248f" />
      </body>
      <title>Color Picker Web Part</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,4cf75796-a897-4b36-a1f4-c57cb681248f.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/02/09/ColorPickerWebPart.aspx</link>
      <pubDate>Thu, 09 Feb 2006 10:19:02 GMT</pubDate>
      <description>&lt;p&gt;
Here's something I thought I'd throw out there to demonstrate the much underrated
Content Editor Web Part (CEWP). It's a client-side JavaScript Color Picker based on
code from &lt;a href="http://www.mickweb.com/javascript/colours/websafe.html"&gt;http://www.mickweb.com/javascript/colours/websafe.html&lt;/a&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/ColorPicker.gif" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The CEWP allows you to either embed formatted Rich Text into the web page or pure
HTML/JavaScript so I could very quickly create a Web Part using the copied javascript.
It just took a few mods such as getting rid of the image dependency by using&amp;nbsp;a
SPAN to form the cells instead.
&lt;/p&gt;
&lt;p&gt;
The code's not much to talk about its just plain JavaScript creating a HTML &amp;lt;table&amp;gt;
with &amp;lt;td&amp;gt;'s for the color cells. One interesting point is that the color table
is dynamically generated. This is done by placing an empty block element, &amp;lt;p&amp;gt;
in this case, giving it an ID and then set its innerHTML property to the generated
table string.
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;function
AttachColorTable(){&lt;br&gt;
document.getElementById(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"'colourtable'"&lt;/span&gt;).innerHTML=
table_maker(36,6,'Select Colour');&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
This code is called on the load event of the page. I use attachEvent so I don't override
any other code that may be using the onLoad event.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;window.attachEvent('onload',AttachColorTable);&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
You can either import the DWP file on a single page or upload to the Site&amp;nbsp;or
Virtual Server galleries using instructions given by Todd Bleaker in a cool tip here &lt;a href="http://mindsharpblogs.com/todd/archive/2005/08/04/646.aspx"&gt;http://mindsharpblogs.com/todd/archive/2005/08/04/646.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Also check out&amp;nbsp;the Google search Web Part also using the CEWP by Todd &lt;a href="http://mindsharpblogs.com/todd/archive/2005/08/04/647.aspx"&gt;http://mindsharpblogs.com/todd/archive/2005/08/04/647.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Download : &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Color%20Picker1.zip"&gt;Color
Picker1.zip (1.36 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=4cf75796-a897-4b36-a1f4-c57cb681248f" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,4cf75796-a897-4b36-a1f4-c57cb681248f.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=74e14296-f641-4d42-affa-8ef13e499c93</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,74e14296-f641-4d42-affa-8ef13e499c93.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,74e14296-f641-4d42-affa-8ef13e499c93.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=74e14296-f641-4d42-affa-8ef13e499c93</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I tend to keep an eye on the sharepoint newsgroups mainly because I can jump
in and help someone out with something I've had problems with in the past. One
question today on the newsgroup was about adding a hidden field to a sharepoint list
via the object model. I've hit this before and until you find out whats going on you
feel a bit like you're in a maze of twisty passages all alike.
</p>
        <p>
Often you might want an internal tracking flag or number handled via code that you
don't want exposed in the edit list UI that some unsupecting user might then delete
by accident.
</p>
        <p>
In theory this should simple.
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">        SPSite
spsite=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SPSite(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"><a href="http://localhost:4455/">http://localhost:4455</a></span>);<br />
        SPWeb web=spsite.OpenWeb();<br /><br />
        SPList list =web.Lists[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Announcements"</span>];<br /><br />
        <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> id=list.Fields.Add(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"NewField"</span>,SPFieldType.Boolean,<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">false</span>);<br />
        SPField spfield=(SPField)list.Fields.GetField(id);<br /><br />
        spfield.Hidden=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>;<br />
        spfield.Update();</span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <br />
          </span>
        </p>
        <p>
 
</p>
        <p>
But if you try this you'll hit an exception - the reason? The code for the Hidden
property checks to see if the property <font color="#800000">CanToggleHidden </font>property
is true and throws an exception if its not. 
</p>
        <p>
Fair enough,all we do then is set the <font color="#800000">CanToggleHidden </font> property
to true and do the update but there is no such property on the object model. 
</p>
        <p>
There are two ways around this but its best to know some internal details about the
SPField object. This way the internal data for a field is stored is in an XML format
like this 
</p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;Field
DisplayName=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"NewField"</span> Type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Boolean"</span> Required=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"FALSE"</span> Name=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"NewField"</span> ColName=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"bit4"</span> CanToggleHidden=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"TRUE"</span> Hidden=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"TRUE"</span>/&gt;</span>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" size="2">You
can see here the CanToggleHiden and the Hidden properties. Note not all fields will
have these extra properties if they are not set. The properties are read from /written
to via the .dotnet XML classes.</font>
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" size="2">This
field definition is a subset of the whole list schema which is taken from the tp_Fields
column of the Lists table in the SharePoint content database. The ColName refers to
the column used to store the data in the UserData table. You don't need to add this
column by hand its automatically calculated from the field type and number of fields
of that type already in use.</font>
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" size="2">Now
the SPField object internally gets and set its properties into this XML fragment using
some helper functions one of which is SetFieldBoolValue for boolean fields, there
is also SetFieldIntValue and SetFieldAttributeValue.</font>
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font face="Verdana" size="2">The
first way to get around the limitation is to add the field directly as XML using the <strong>AddFieldAsXml</strong> method
on the SPFieldCollection using the XML format as above but leaving out the columnname.</font>
            </span>
          </p>
          <p>
          </p>
        </span>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
SPList list =web.Lists[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Announcements"</span>];</span>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
list.Fields.AddFieldAsXml(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;Field
DisplayName=\"NewField\" Type=\"Boolean\" Required=\"FALSE\" Name=\"NewField\" CanToggleHidden=\"TRUE\"
Hidden=\"TRUE\"/&gt;"</span>);</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" size="2">Thats
the supported way but one other interesting method is to toggle the internal <font color="#800000">CanToggleHidden</font> internal
property with reflection.</font>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" size="2">Add
a reference to the System.Reflection namespace and you can do this</font>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <font face="Verdana" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">  
Type type <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> spfield.GetType(); <br />
   MethodInfo mi= type.GetMethod(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SetFieldBoolValue"</span>,
BindingFlags.NonPublic <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">|</span> BindingFlags.Instance); 
<br />
   mi.Invoke(spfield,<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span>[]{<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"CanToggleHidden"</span>, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>});</span>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <font face="Verdana" size="2">you
can then set the Hidden property via the OM without getting an exception</font>
              </span>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   spfield.Hidden=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>;<br />
   spfield.Update();</span>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <font face="Verdana" size="2">
                </font>
                <br />
                <font face="Verdana" size="2">Either way both of these are hacks but at least one
is supported.</font>
                <br />
 
</span>
            </p>
          </font>
        </span>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=74e14296-f641-4d42-affa-8ef13e499c93" />
      </body>
      <title>Adding a hidden SharePoint Field in code</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,74e14296-f641-4d42-affa-8ef13e499c93.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/02/07/AddingAHiddenSharePointFieldInCode.aspx</link>
      <pubDate>Tue, 07 Feb 2006 10:10:34 GMT</pubDate>
      <description>&lt;p&gt;
I tend to keep an eye&amp;nbsp;on the sharepoint newsgroups mainly because I can jump
in and help someone out with something I've had problems with&amp;nbsp;in the past. One
question today on the newsgroup was about adding a hidden field to a sharepoint list
via the object model. I've hit this before and until you find out whats going on you
feel a bit like you're in a maze of twisty passages all alike.
&lt;/p&gt;
&lt;p&gt;
Often you might want an internal tracking flag or number handled via code that you
don't want exposed in the edit list UI that some unsupecting user might then delete
by accident.
&lt;/p&gt;
&lt;p&gt;
In theory this should simple.
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SPSite
spsite=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SPSite(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;&lt;a href="http://localhost:4455/"&gt;http://localhost:4455&lt;/a&gt;&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SPWeb web=spsite.OpenWeb();&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SPList list =web.Lists[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Announcements"&lt;/span&gt;];&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; id=list.Fields.Add(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"NewField"&lt;/span&gt;,SPFieldType.Boolean,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SPField spfield=(SPField)list.Fields.GetField(id);&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;spfield.Hidden=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;spfield.Update();&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
But if you try this you'll hit an exception - the reason? The code for the Hidden
property checks to see if the property &lt;font color=#800000&gt;CanToggleHidden &lt;/font&gt;property
is true and throws an exception if its not. 
&lt;/p&gt;
&lt;p&gt;
Fair enough,all we do then is set the &lt;font color=#800000&gt;CanToggleHidden&amp;nbsp;&lt;/font&gt;&amp;nbsp;property
to true and do the update but there is no such property on the object model. 
&lt;/p&gt;
&lt;p&gt;
There are two ways around this but its best to know some internal details about the
SPField object. This way the internal data for a field is stored is in an XML format
like this 
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;Field
DisplayName=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"NewField"&lt;/span&gt; Type=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Boolean"&lt;/span&gt; Required=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"FALSE"&lt;/span&gt; Name=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"NewField"&lt;/span&gt; ColName=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"bit4"&lt;/span&gt; CanToggleHidden=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"TRUE"&lt;/span&gt; Hidden=&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"TRUE"&lt;/span&gt;/&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;You
can see here the CanToggleHiden and the Hidden properties. Note not all fields will
have these extra properties if they are not set. The properties are read from /written
to via the .dotnet XML classes.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;This
field definition is a subset of the whole list schema which is taken from the tp_Fields
column of the Lists table in the SharePoint content database. The ColName refers to
the column used to store the data in the UserData table. You don't need to add this
column by hand its automatically calculated from the field type and number of fields
of that type already in use.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;Now
the SPField object internally gets and set its properties into this XML fragment using
some helper functions one of which is SetFieldBoolValue for boolean fields, there
is also SetFieldIntValue and SetFieldAttributeValue.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;The
first way to get around the limitation is to add the field directly as XML using the &lt;strong&gt;AddFieldAsXml&lt;/strong&gt; method
on the SPFieldCollection using the XML format as above but leaving out the columnname.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
SPList list =web.Lists[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Announcements"&lt;/span&gt;];&lt;/span&gt;&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
list.Fields.AddFieldAsXml(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"&amp;lt;Field
DisplayName=\"NewField\" Type=\"Boolean\" Required=\"FALSE\" Name=\"NewField\" CanToggleHidden=\"TRUE\"
Hidden=\"TRUE\"/&amp;gt;"&lt;/span&gt;);&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;Thats
the supported way but one other interesting method is to toggle the internal &lt;font color=#800000&gt;CanToggleHidden&lt;/font&gt; internal
property with reflection.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;Add
a reference to the System.Reflection namespace and you can do this&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;
Type type &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; spfield.GetType();&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp; MethodInfo mi= type.GetMethod(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"SetFieldBoolValue"&lt;/span&gt;,
BindingFlags.NonPublic &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;|&lt;/span&gt; BindingFlags.Instance); 
&lt;br&gt;
&amp;nbsp;&amp;nbsp; mi.Invoke(spfield,&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt;[]{&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"CanToggleHidden"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;});&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;you
can then set the Hidden property via the OM without getting an exception&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;spfield.Hidden=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;spfield.Update();&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;&lt;/font&gt;
&lt;br&gt;
&lt;font face=Verdana size=2&gt;Either way both of these are hacks but at least one is supported.&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/span&gt;&gt;&gt;&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=74e14296-f641-4d42-affa-8ef13e499c93" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,74e14296-f641-4d42-affa-8ef13e499c93.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=a64f1578-8c22-4127-b830-071cf5a76401</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a64f1578-8c22-4127-b830-071cf5a76401.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a64f1578-8c22-4127-b830-071cf5a76401.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=a64f1578-8c22-4127-b830-071cf5a76401</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This entry was prompted by a question on a newsgroup about hiding screen elements
so you can get the whole contents of a page fitting onto a printout without the top/left
nav links. 
</p>
        <p>
Personally I don't like the printer friendly buttons you see on web pages mainly because
you often find heaps of javascript dynamically altering DOM element's styles or the
developer has coded a special version of the page just for the printer. 
<br />
Sometimes that may be needed but I'd just recently done a website where this feature
was requested and came across an aspect of css that I'd missed before. That was the
media=print attribute. A few tweaks to the css file to hide navigation divs and margins
and voila the printouts came out perfectly.
</p>
        <p>
In CSS 2 you can specify different stylesheets for the different output devices the
document may be rendered to, see <a href="http://www.w3.org/TR/REC-CSS2/media.html">http://www.w3.org/TR/REC-CSS2/media.html</a> for
the full details.<br />
You can either reference a separate css file like this 
</p>
        <p>
          <font color="#0000ff">&lt;LINK rel="stylesheet" type="text/css" href="print.css" media="print"&gt;</font>
        </p>
        <p>
or you can inline the style like this 
</p>
        <p>
          <font color="#0000ff">@media print { .classname   {display :none; visibility:hidden
} }</font>
        </p>
        <p>
So to alter how a SharePoint page looks when printed we can either alter the css files
that SharePoint uses : ows.css and sps.css with SP Portal : or inline the stylesheet
in the page.<br />
We can inline by adding a Content Editor Web Part and using its source edit button
to add this text
</p>
        <p>
          <font color="#0000ff">&lt;style type="text/css"&gt; 
<br />
@media print 
<br />
{ 
<br />
.ms-bannerframe   {display :none; visibility:hidden } 
<br />
.ms-nav   {display :none; visibility:hidden } </font>
        </p>
        <p>
          <font color="#0000ff">} 
<br />
&lt;/style&gt;</font>
        </p>
        <p>
Go to File-Print Preview and you should see that the top and left nav bars are now
hidden.<br />
On the Portal sites you probably need to add the ms-navframe style to the list above
as that's used in the left nav bar.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a64f1578-8c22-4127-b830-071cf5a76401" />
      </body>
      <title>Hiding SharePoint Page Elements when Printing</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a64f1578-8c22-4127-b830-071cf5a76401.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/02/02/HidingSharePointPageElementsWhenPrinting.aspx</link>
      <pubDate>Thu, 02 Feb 2006 21:27:52 GMT</pubDate>
      <description>&lt;p&gt;
This entry was prompted by a question on a newsgroup about hiding screen elements
so you can get the whole contents of a page fitting onto a printout without the top/left
nav links. 
&lt;/p&gt;
&lt;p&gt;
Personally I don't like the printer friendly buttons you see on web pages mainly because
you often find heaps of javascript dynamically altering DOM element's styles or the
developer has coded a special version of the page just for the printer. 
&lt;br&gt;
Sometimes that may be needed but I'd just recently done a website where this feature
was requested and came across an aspect of css that I'd missed before. That was the
media=print attribute. A few tweaks to the css file to hide navigation divs and margins
and voila the printouts came out perfectly.
&lt;/p&gt;
&lt;p&gt;
In CSS 2 you can specify different stylesheets for the different output devices the
document may be rendered to, see &lt;a href="http://www.w3.org/TR/REC-CSS2/media.html"&gt;http://www.w3.org/TR/REC-CSS2/media.html&lt;/a&gt; for
the full details.&lt;br&gt;
You can either reference a separate css file like this 
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#0000ff&gt;&amp;lt;LINK rel="stylesheet" type="text/css" href="print.css" media="print"&amp;gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
or you can inline the style like this 
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#0000ff&gt;@media print { .classname&amp;nbsp;&amp;nbsp; {display :none; visibility:hidden
} }&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
So to alter how a SharePoint page looks when printed we can either alter the css files
that SharePoint uses : ows.css and sps.css with SP Portal : or inline the stylesheet
in the page.&lt;br&gt;
We can inline by adding a Content Editor Web Part and using its source edit button
to add this text
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#0000ff&gt;&amp;lt;style type="text/css"&amp;gt; 
&lt;br&gt;
@media print 
&lt;br&gt;
{ 
&lt;br&gt;
.ms-bannerframe&amp;nbsp;&amp;nbsp; {display :none; visibility:hidden } 
&lt;br&gt;
.ms-nav&amp;nbsp;&amp;nbsp; {display :none; visibility:hidden } &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#0000ff&gt;} 
&lt;br&gt;
&amp;lt;/style&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Go to File-Print Preview and you should see that the top and left nav bars are now
hidden.&lt;br&gt;
On the Portal sites you probably need to add the ms-navframe style to the list above
as that's used in the left nav bar.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=a64f1578-8c22-4127-b830-071cf5a76401" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,a64f1578-8c22-4127-b830-071cf5a76401.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=e530371f-bd74-434b-9237-f208a039c647</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,e530371f-bd74-434b-9237-f208a039c647.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,e530371f-bd74-434b-9237-f208a039c647.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=e530371f-bd74-434b-9237-f208a039c647</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <font size="2">
          <p>
Towards the end of last year our company Flexnet Consultants decided to release a
set of free Web Parts that we thought might be useful to have installed in WSS/SPS
sites. The first of these was a Flash slideshow based on the pictures held in a SharePoint
picture library <a href="http://www.flexnetconsult.co.uk/WebParts/FlashSlideShow.htm">http://www.flexnetconsult.co.uk/WebParts/FlashSlideShow.htm</a>.
</p>
          <p>
We like Flash a lot as its a great way to liven up dull static pages and the content
can be a lot more than 'eye-candy'
</p>
          <p>
            <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/FlashSlideshow-Settings.jpg" border="0" />
          </p>
          <p>
 
</p>
          <p>
The first thing you need is some way to create the swf file that Flash is compiled
into, in-house we use Flash MX. The actual slideshow view of the pictures wasn't a
real problem as that's exactly the kind of thing Flash is good at. We use ActionScript
to control the action on the Flash stage. 
</p>
          <p>
The main issue was how to get a list of the pictures held in the library. 
</p>
          <p>
We looked at a few possible ways, one would be to pass a list of pictures to
Flash using its URL or the FlashVars property, not pretty and not scaleable, the next
idea was to talk to the SharePoint Web Services, this would have been ideal except
Flash only really got proper support for talking to generic Web Services with the
recent version 8 and we wanted to support Flash players version 6 and upwards to allow
for the widest audience. We will probably create a version that supports 8 later. 
</p>
          <p>
That left us with one final method and it turns out to be a very easy one, the old
SharePoint URL protocol available since version 1. The docs for these calls are here <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spsdk11/Client_API/spURLProtocol.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spsdk11/Client_API/spURLProtocol.asp</a> ,
there's a lack of useful examples but its pretty easy to use.
</p>
          <p>
You pass parameters via URL to the SharePoint ISAPI DLL called owssvr.dll in
the _vti_bin directory and it returns xml information either formated in a CAML style
or raw data rowset style. We want raw Data so we put XMLDATA=true in the URL
</p>
          <p>
As an example if you pass <a href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE">http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE</a> then
you get this XML data back
</p>
          <div class="e">
            <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
              <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                <strong>
                  <font face="Courier New" color="#ff0000">-</font>
                </strong>
              </a>
              <span class="m">
                <font color="#0000ff">&lt;</font>
              </span>
              <span class="t">
                <font color="#990000">xml</font>
              </span>
              <span class="ns">
                <font color="#ff0000"> xmlns:s</font>
              </span>
              <span class="m">
                <font color="#0000ff">="</font>
              </span>
              <b class="ns">
                <font color="#ff0000">uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882</font>
              </b>
              <span class="m">
                <font color="#0000ff">"</font>
              </span>
              <span class="ns">
                <font color="#ff0000"> xmlns:dt</font>
              </span>
              <span class="m">
                <font color="#0000ff">="</font>
              </span>
              <b class="ns">
                <font color="#ff0000">uuid:C2F41010-65B3-11d1-A29F-00AA00C14882</font>
              </b>
              <span class="m">
                <font color="#0000ff">"</font>
              </span>
              <span class="ns">
                <font color="#ff0000"> xmlns:rs</font>
              </span>
              <span class="m">
                <font color="#0000ff">="</font>
              </span>
              <b class="ns">
                <font color="#ff0000">urn:schemas-microsoft-com:rowset</font>
              </b>
              <span class="m">
                <font color="#0000ff">"</font>
              </span>
              <span class="ns">
                <font color="#ff0000"> xmlns:z</font>
              </span>
              <span class="m">
                <font color="#0000ff">="</font>
              </span>
              <b class="ns">
                <font color="#ff0000">#RowsetSchema</font>
              </b>
              <font color="#0000ff">
                <span class="m">"</span>
                <span class="m">&gt;</span>
              </font>
            </div>
            <div>
              <div class="e">
                <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                  <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                    <strong>
                      <font face="Courier New" color="#ff0000">-</font>
                    </strong>
                  </a>
                  <span class="m">
                    <font color="#0000ff">&lt;</font>
                  </span>
                  <font color="#990000">
                    <span class="t">s:Schema</span>
                    <span class="t"> id</span>
                  </font>
                  <span class="m">
                    <font color="#0000ff">="</font>
                  </span>
                  <b>RowsetSchema</b>
                  <font color="#0000ff">
                    <span class="m">"</span>
                    <span class="m">&gt;</span>
                  </font>
                </div>
                <div>
                  <div class="e">
                    <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                        <strong>
                          <font face="Courier New" color="#ff0000">-</font>
                        </strong>
                      </a>
                      <span class="m">
                        <font color="#0000ff">&lt;</font>
                      </span>
                      <font color="#990000">
                        <span class="t">s:ElementType</span>
                        <span class="t"> name</span>
                      </font>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>row</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> content</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>eltOnly</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> rs:CommandTimeout</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>30</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m">&gt;</span>
                      </font>
                    </div>
                    <div>
                      <div class="e">
                        <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                          <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                            <strong>
                              <font face="Courier New" color="#ff0000">-</font>
                            </strong>
                          </a>
                          <span class="m">
                            <font color="#0000ff">&lt;</font>
                          </span>
                          <font color="#990000">
                            <span class="t">s:AttributeType</span>
                            <span class="t"> name</span>
                          </font>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>ows_SelectedFlag</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:name</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>Selection
Checkbox</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:number</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>1</b>
                          <font color="#0000ff">
                            <span class="m">"</span>
                            <span class="m">&gt;</span>
                          </font>
                        </div>
                        <div>
                          <div class="e">
                            <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                              <span class="b">
                                <strong>
                                  <font face="Courier New" color="#ff0000"> </font>
                                </strong>
                              </span>
                              <span class="m">
                                <font color="#0000ff">&lt;</font>
                              </span>
                              <span class="t">
                                <font color="#990000">s:datatype</font>
                              </span>
                              <span class="dt">
                                <font color="#008000">dt:type</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">ui1</font>
                              </b>
                              <span class="m">
                                <font color="#0000ff">"</font>
                              </span>
                              <span class="dt">
                                <font color="#008000"> dt:maxLength</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">1</font>
                              </b>
                              <font color="#0000ff">
                                <span class="m">"</span>
                                <span class="m"> /&gt;</span>
                              </font>
                            </div>
                          </div>
                          <div>
                            <span class="b">
                              <strong>
                                <font face="Courier New" color="#ff0000"> </font>
                              </strong>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&lt;/</font>
                            </span>
                            <span class="t">
                              <font color="#990000">s:AttributeType</font>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&gt;</font>
                            </span>
                          </div>
                        </div>
                      </div>
                      <div class="e">
                        <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                          <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                            <strong>
                              <font face="Courier New" color="#ff0000">-</font>
                            </strong>
                          </a>
                          <span class="m">
                            <font color="#0000ff">&lt;</font>
                          </span>
                          <font color="#990000">
                            <span class="t">s:AttributeType</span>
                            <span class="t"> name</span>
                          </font>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>ows_DocIcon</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:name</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>Type</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:number</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>2</b>
                          <font color="#0000ff">
                            <span class="m">"</span>
                            <span class="m">&gt;</span>
                          </font>
                        </div>
                        <div>
                          <div class="e">
                            <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                              <span class="b">
                                <strong>
                                  <font face="Courier New" color="#ff0000"> </font>
                                </strong>
                              </span>
                              <span class="m">
                                <font color="#0000ff">&lt;</font>
                              </span>
                              <span class="t">
                                <font color="#990000">s:datatype</font>
                              </span>
                              <span class="dt">
                                <font color="#008000">dt:type</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">string</font>
                              </b>
                              <span class="m">
                                <font color="#0000ff">"</font>
                              </span>
                              <span class="dt">
                                <font color="#008000"> dt:maxLength</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">512</font>
                              </b>
                              <font color="#0000ff">
                                <span class="m">"</span>
                                <span class="m"> /&gt;</span>
                              </font>
                            </div>
                          </div>
                          <div>
                            <span class="b">
                              <strong>
                                <font face="Courier New" color="#ff0000"> </font>
                              </strong>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&lt;/</font>
                            </span>
                            <span class="t">
                              <font color="#990000">s:AttributeType</font>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&gt;</font>
                            </span>
                          </div>
                        </div>
                      </div>
                      <div class="e">
                        <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                          <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                            <strong>
                              <font face="Courier New" color="#ff0000">-</font>
                            </strong>
                          </a>
                          <span class="m">
                            <font color="#0000ff">&lt;</font>
                          </span>
                          <font color="#990000">
                            <span class="t">s:AttributeType</span>
                            <span class="t"> name</span>
                          </font>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>ows_NameOrTitle</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:name</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>Name</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:number</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>3</b>
                          <font color="#0000ff">
                            <span class="m">"</span>
                            <span class="m">&gt;</span>
                          </font>
                        </div>
                        <div>
                          <div class="e">
                            <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                              <span class="b">
                                <strong>
                                  <font face="Courier New" color="#ff0000"> </font>
                                </strong>
                              </span>
                              <span class="m">
                                <font color="#0000ff">&lt;</font>
                              </span>
                              <span class="t">
                                <font color="#990000">s:datatype</font>
                              </span>
                              <span class="dt">
                                <font color="#008000">dt:type</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">string</font>
                              </b>
                              <span class="m">
                                <font color="#0000ff">"</font>
                              </span>
                              <span class="dt">
                                <font color="#008000"> dt:maxLength</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">512</font>
                              </b>
                              <font color="#0000ff">
                                <span class="m">"</span>
                                <span class="m"> /&gt;</span>
                              </font>
                            </div>
                          </div>
                          <div>
                            <span class="b">
                              <strong>
                                <font face="Courier New" color="#ff0000"> </font>
                              </strong>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&lt;/</font>
                            </span>
                            <span class="t">
                              <font color="#990000">s:AttributeType</font>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&gt;</font>
                            </span>
                          </div>
                        </div>
                      </div>
                      <div class="e">
                        <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                          <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                            <strong>
                              <font face="Courier New" color="#ff0000">-</font>
                            </strong>
                          </a>
                          <span class="m">
                            <font color="#0000ff">&lt;</font>
                          </span>
                          <font color="#990000">
                            <span class="t">s:AttributeType</span>
                            <span class="t"> name</span>
                          </font>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>ows_ImageSize</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:name</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>Picture
Size</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:number</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>4</b>
                          <font color="#0000ff">
                            <span class="m">"</span>
                            <span class="m">&gt;</span>
                          </font>
                        </div>
                        <div>
                          <div class="e">
                            <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                              <span class="b">
                                <strong>
                                  <font face="Courier New" color="#ff0000"> </font>
                                </strong>
                              </span>
                              <span class="m">
                                <font color="#0000ff">&lt;</font>
                              </span>
                              <span class="t">
                                <font color="#990000">s:datatype</font>
                              </span>
                              <span class="dt">
                                <font color="#008000">dt:type</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">i4</font>
                              </b>
                              <span class="m">
                                <font color="#0000ff">"</font>
                              </span>
                              <span class="dt">
                                <font color="#008000"> dt:maxLength</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">4</font>
                              </b>
                              <font color="#0000ff">
                                <span class="m">"</span>
                                <span class="m"> /&gt;</span>
                              </font>
                            </div>
                          </div>
                          <div>
                            <span class="b">
                              <strong>
                                <font face="Courier New" color="#ff0000"> </font>
                              </strong>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&lt;/</font>
                            </span>
                            <span class="t">
                              <font color="#990000">s:AttributeType</font>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&gt;</font>
                            </span>
                          </div>
                        </div>
                      </div>
                      <div class="e">
                        <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                          <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                            <strong>
                              <font face="Courier New" color="#ff0000">-</font>
                            </strong>
                          </a>
                          <span class="m">
                            <font color="#0000ff">&lt;</font>
                          </span>
                          <font color="#990000">
                            <span class="t">s:AttributeType</span>
                            <span class="t"> name</span>
                          </font>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>ows_FileSizeDisplay</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:name</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>File
Size</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:number</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>5</b>
                          <font color="#0000ff">
                            <span class="m">"</span>
                            <span class="m">&gt;</span>
                          </font>
                        </div>
                        <div>
                          <div class="e">
                            <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                              <span class="b">
                                <strong>
                                  <font face="Courier New" color="#ff0000"> </font>
                                </strong>
                              </span>
                              <span class="m">
                                <font color="#0000ff">&lt;</font>
                              </span>
                              <span class="t">
                                <font color="#990000">s:datatype</font>
                              </span>
                              <span class="dt">
                                <font color="#008000">dt:type</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">i4</font>
                              </b>
                              <span class="m">
                                <font color="#0000ff">"</font>
                              </span>
                              <span class="dt">
                                <font color="#008000"> dt:maxLength</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">4</font>
                              </b>
                              <font color="#0000ff">
                                <span class="m">"</span>
                                <span class="m"> /&gt;</span>
                              </font>
                            </div>
                          </div>
                          <div>
                            <span class="b">
                              <strong>
                                <font face="Courier New" color="#ff0000"> </font>
                              </strong>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&lt;/</font>
                            </span>
                            <span class="t">
                              <font color="#990000">s:AttributeType</font>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&gt;</font>
                            </span>
                          </div>
                        </div>
                      </div>
                      <div class="e">
                        <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                          <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                            <strong>
                              <font face="Courier New" color="#ff0000">-</font>
                            </strong>
                          </a>
                          <span class="m">
                            <font color="#0000ff">&lt;</font>
                          </span>
                          <font color="#990000">
                            <span class="t">s:AttributeType</span>
                            <span class="t"> name</span>
                          </font>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>ows_RequiredField</b>
                          <span class="m">
                            <font color="#0000ff">"</font>
                          </span>
                          <span class="t">
                            <font color="#990000"> rs:name</font>
                          </span>
                          <font color="#0000ff">
                            <span class="m">="</span>
                            <b>
                            </b>
                            <span class="m">"</span>
                          </font>
                          <span class="t">
                            <font color="#990000"> rs:number</font>
                          </span>
                          <span class="m">
                            <font color="#0000ff">="</font>
                          </span>
                          <b>6</b>
                          <font color="#0000ff">
                            <span class="m">"</span>
                            <span class="m">&gt;</span>
                          </font>
                        </div>
                        <div>
                          <div class="e">
                            <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                              <span class="b">
                                <strong>
                                  <font face="Courier New" color="#ff0000"> </font>
                                </strong>
                              </span>
                              <span class="m">
                                <font color="#0000ff">&lt;</font>
                              </span>
                              <span class="t">
                                <font color="#990000">s:datatype</font>
                              </span>
                              <span class="dt">
                                <font color="#008000">dt:type</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">string</font>
                              </b>
                              <span class="m">
                                <font color="#0000ff">"</font>
                              </span>
                              <span class="dt">
                                <font color="#008000"> dt:maxLength</font>
                              </span>
                              <span class="m">
                                <font color="#0000ff">="</font>
                              </span>
                              <b class="dt">
                                <font color="#008000">1073741823</font>
                              </b>
                              <font color="#0000ff">
                                <span class="m">"</span>
                                <span class="m"> /&gt;</span>
                              </font>
                            </div>
                          </div>
                          <div>
                            <span class="b">
                              <strong>
                                <font face="Courier New" color="#ff0000"> </font>
                              </strong>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&lt;/</font>
                            </span>
                            <span class="t">
                              <font color="#990000">s:AttributeType</font>
                            </span>
                            <span class="m">
                              <font color="#0000ff">&gt;</font>
                            </span>
                          </div>
                        </div>
                      </div>
                      <div>
                        <span class="b">
                          <strong>
                            <font face="Courier New" color="#ff0000"> </font>
                          </strong>
                        </span>
                        <span class="m">
                          <font color="#0000ff">&lt;/</font>
                        </span>
                        <span class="t">
                          <font color="#990000">s:ElementType</font>
                        </span>
                        <span class="m">
                          <font color="#0000ff">&gt;</font>
                        </span>
                      </div>
                    </div>
                  </div>
                  <div>
                    <span class="b">
                      <strong>
                        <font face="Courier New" color="#ff0000"> </font>
                      </strong>
                    </span>
                    <span class="m">
                      <font color="#0000ff">&lt;/</font>
                    </span>
                    <span class="t">
                      <font color="#990000">s:Schema</font>
                    </span>
                    <span class="m">
                      <font color="#0000ff">&gt;</font>
                    </span>
                  </div>
                </div>
              </div>
              <div class="e">
                <div class="c" style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                  <a class="b" onfocus="h()" onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE#">
                    <strong>
                      <font face="Courier New" color="#ff0000">-</font>
                    </strong>
                  </a>
                  <span class="m">
                    <font color="#0000ff">&lt;</font>
                  </span>
                  <span class="t">
                    <font color="#990000">rs:data</font>
                  </span>
                  <span class="m">
                    <font color="#0000ff">&gt;</font>
                  </span>
                </div>
                <div>
                  <div class="e">
                    <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <span class="b">
                        <strong>
                          <font face="Courier New" color="#ff0000"> </font>
                        </strong>
                      </span>
                      <span class="m">
                        <font color="#0000ff">&lt;</font>
                      </span>
                      <span class="t">
                        <font color="#990000">z:row</font>
                      </span>
                      <span class="t">
                        <font color="#990000">ows_SelectedFlag</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>0</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_DocIcon</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_NameOrTitle</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>London01.jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_ImageSize</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>180</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_FileSizeDisplay</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>10587</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_RequiredField</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>Flash
Test/London01.jpg</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m"> /&gt;</span>
                      </font>
                    </div>
                  </div>
                  <div class="e">
                    <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <span class="b">
                        <strong>
                          <font face="Courier New" color="#ff0000"> </font>
                        </strong>
                      </span>
                      <span class="m">
                        <font color="#0000ff">&lt;</font>
                      </span>
                      <span class="t">
                        <font color="#990000">z:row</font>
                      </span>
                      <span class="t">
                        <font color="#990000">ows_SelectedFlag</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>0</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_DocIcon</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_NameOrTitle</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>London02.jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_ImageSize</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>180</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_FileSizeDisplay</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>7675</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_RequiredField</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>Flash
Test/London02.jpg</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m"> /&gt;</span>
                      </font>
                    </div>
                  </div>
                  <div class="e">
                    <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <span class="b">
                        <strong>
                          <font face="Courier New" color="#ff0000"> </font>
                        </strong>
                      </span>
                      <span class="m">
                        <font color="#0000ff">&lt;</font>
                      </span>
                      <span class="t">
                        <font color="#990000">z:row</font>
                      </span>
                      <span class="t">
                        <font color="#990000">ows_SelectedFlag</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>0</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_DocIcon</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_NameOrTitle</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>London03.jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_ImageSize</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>180</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_FileSizeDisplay</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>14242</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_RequiredField</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>Flash
Test/London03.jpg</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m"> /&gt;</span>
                      </font>
                    </div>
                  </div>
                  <div class="e">
                    <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <span class="b">
                        <strong>
                          <font face="Courier New" color="#ff0000"> </font>
                        </strong>
                      </span>
                      <span class="m">
                        <font color="#0000ff">&lt;</font>
                      </span>
                      <span class="t">
                        <font color="#990000">z:row</font>
                      </span>
                      <span class="t">
                        <font color="#990000">ows_SelectedFlag</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>0</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_DocIcon</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_NameOrTitle</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>London04.jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_ImageSize</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>180</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_FileSizeDisplay</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>6755</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_RequiredField</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>Flash
Test/London04.jpg</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m"> /&gt;</span>
                      </font>
                    </div>
                  </div>
                  <div class="e">
                    <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <span class="b">
                        <strong>
                          <font face="Courier New" color="#ff0000"> </font>
                        </strong>
                      </span>
                      <span class="m">
                        <font color="#0000ff">&lt;</font>
                      </span>
                      <span class="t">
                        <font color="#990000">z:row</font>
                      </span>
                      <span class="t">
                        <font color="#990000">ows_SelectedFlag</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>0</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_DocIcon</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_NameOrTitle</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>London05.jpg</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_ImageSize</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>180</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_FileSizeDisplay</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>19926</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_RequiredField</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>Flash
Test/London05.jpg</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m"> /&gt;</span>
                      </font>
                    </div>
                  </div>
                  <div class="e">
                    <div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em">
                      <span class="b">
                        <strong>
                          <font face="Courier New" color="#ff0000"> </font>
                        </strong>
                      </span>
                      <span class="t">
                        <font color="#990000">:row</font>
                      </span>
                      <span class="t">
                        <font color="#990000">ows_SelectedFlag</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>1</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_NameOrTitle</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>SubFolder1</b>
                      <span class="m">
                        <font color="#0000ff">"</font>
                      </span>
                      <span class="t">
                        <font color="#990000"> ows_RequiredField</font>
                      </span>
                      <span class="m">
                        <font color="#0000ff">="</font>
                      </span>
                      <b>Flash
Test/SubFolder1</b>
                      <font color="#0000ff">
                        <span class="m">"</span>
                        <span class="m"> /&gt;</span>
                      </font>
                    </div>
                  </div>
                  <div>
                    <span class="b">
                      <strong>
                        <font face="Courier New" color="#ff0000"> </font>
                      </strong>
                    </span>
                    <span class="m">
                      <font color="#0000ff">&lt;/</font>
                    </span>
                    <span class="t">
                      <font color="#990000">rs:data</font>
                    </span>
                    <span class="m">
                      <font color="#0000ff">&gt;</font>
                    </span>
                  </div>
                </div>
              </div>
              <div>
                <span class="b">
                  <strong>
                    <font face="Courier New" color="#ff0000"> </font>
                  </strong>
                </span>
                <span class="m">
                  <font color="#0000ff">&lt;/</font>
                </span>
                <span class="t">
                  <font color="#990000">xml</font>
                </span>
                <span class="m">
                  <font color="#0000ff">&gt;</font>
                </span>
              </div>
              <div>
                <span class="m">
                  <font color="#0000ff">
                  </font>
                </span> 
</div>
              <div>
                <span class="m">
                  <font color="#0000ff">
                  </font>
                </span> 
</div>
              <div>
                <span class="m">
                  <font color="#000000">As you can see the data holds information
such as the filesize and the subfolders, this could be used to recurse into the sub
folders if you wanted.</font>
                </span>
              </div>
              <div>
                <span class="m">
                  <font color="#000000">
                  </font>
                </span> 
</div>
              <div>
                <span class="m">
                  <font color="#000000">This format is exactly what we need as Flash
has a XML object that can load XML data from a URL. </font>
                </span>
              </div>
              <div>
                <span class="m">
                  <font color="#000000">Example code for this would be </font>
                </span>
              </div>
              <div>
                <span class="m">
                  <p>
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">var
x=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XML();<br />
x.ignoreWhiteSpace <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>;<br />
x.onLoad <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> LoadDocs;<br />
x.Load("<font color="#008000">http:</font><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><font color="#008000">//</font>sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;Cmd=Display&amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;XMLDATA=TRUE"<font color="#000000">);</font></span><br /></span>
                  </p>
                </span>
                <span class="m">
                  <font color="#000000">
                  </font>
                </span>
              </div>
              <div>
                <span class="m">
                  <font color="#000000">The XML object will call the LoadDocs function
when it has completed the data download.</font>
                </span>
              </div>
              <div>
                <span class="m">
                  <font color="#000000">
                  </font>
                </span> 
</div>
              <div>
                <span class="m">
                  <font color="#000000">All thats left is to iterate the XML nodes
and extract the picture names</font>
                </span> from the attribute <font color="#990000">ows_RequiredField</font></div>
              <div> 
</div>
              <div>
                <span class="m">
                  <font color="#000000">
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">function
LoadDocs(success)<br />
{<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   if</span> (success){<br />
   var eXmlRoot <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.firstChild;<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   //
allow for /r/n in the XML stream</span><br />
   var eXmlSchema= eXmlRoot.childNodes[1];<br />
   var eXmlData= eXmlRoot.childNodes[3];<br />
   var eRows= eXmlData.childNodes;<br /><br />
   arrImages=<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Array();<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   for</span> (i=0;
i&lt; eRows.length; i++){<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">      if</span> (eRows[i].nodeType==1
&amp;&amp; eRows[i].nodeName.toLowerCase()==<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"z:row"</span>){<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">         //Skip
subfolders and only show jpgs</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">         //
to only show jpgs use (eRows[i].attributes.ows_DocIcon == 'jpg')</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">         if</span>(eRows[i].attributes.ows_SelectedFlag==<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0"</span> ) <br />
         {<br />
            arrImages.push(eRows[i].attributes.ows_RequiredField);<br />
         }<br />
      }<br />
   }</span>
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                      <br />
   }<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
The list of pictures are now loaded </span></span>
                  </font>
                </span>
              </div>
              <div>
                <span class="m">
                  <font color="#000000">
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                      <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                      </span>}<br /></span>
                  </font>
                </span>
              </div>
            </div>
          </div>
        </font>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <div>
          <span class="m">
            <font color="#000000">Now that we have the list of pictures we
can then use ActionScript to rotate through them.</font>
          </span>
        </div>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <div>
          <span class="m">
            <font color="#000000">Once you have created your Flash SWF the
final thing that needs to be done is to render out the OBJECT tag that will host the
Flash file in the <font size="2">RenderWebPart event</font>, this will look like
this on the SharePoint page:</font>
          </span>
        </div>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <div>
          <span class="m">
            <font color="#000000">&lt;OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="<a href="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0</a>"
WIDTH=180 HEIGHT=120 id="FlexnetSlides_WPQ4" ALIGN=""&gt;<br />
&lt;PARAM NAME=movie VALUE="<a href="http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf">http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf</a>"&gt; 
<br />
&lt;PARAM NAME=FlashVars VALUE="ServerBase=http%3a%2f%2fsharepoint%3a80&amp;SiteURL=http%3a%2f%2fsharepoint&amp;PicLib=dcebbba5-5e94-49a1-88b7-03f7625dd8e4&amp;RootFolder=&amp;Transition=Fade&amp;Displaytime=5&amp;Transitiontime=3&amp;ScaleMode=0&amp;MaxCachedImages=30"&gt;<br />
&lt;PARAM NAME=menu VALUE=false&gt; 
<br />
&lt;PARAM NAME=quality VALUE=high&gt; 
<br />
&lt;PARAM NAME=scale VALUE=noscale&gt;<br />
&lt;PARAM NAME=bgcolor VALUE=#FFFFFF&gt;<br />
&lt;EMBED src="<a href="http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf">http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf</a>"
menu=false scale=noscale quality=high bgcolor=#ffffff FlashVars="ServerBase=http%3a%2f%2fsharepoint%3a80&amp;SiteURL=http%3a%2f%2fsharepoint&amp;PicLib=dcebbba5-5e94-49a1-88b7-03f7625dd8e4&amp;RootFolder=&amp;Transition=Fade&amp;Displaytime=5&amp;Transitiontime=3&amp;ScaleMode=0&amp;MaxCachedImages=30"
WIDTH="180" HEIGHT="120" NAME="FlexnetSlides_WPQ4" ALIGN=""TYPE="application/x-shockwave-flash"
PLUGINSPAGE="<a href="http://www.macromedia.com/go/getflashplayer">http://www.macromedia.com/go/getflashplayer</a>"&gt;<br />
&lt;/EMBED&gt;<br />
&lt;/OBJECT&gt;</font>
          </span>
        </div>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <div>
          <span class="m">
            <font color="#000000">The FlashVars method allow you to reference
parameters as variables in the ActionScript code e.g. _root.ServerBase and _root.SiteURL</font>
          </span>
        </div>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <div>
          <span class="m">
            <font color="#000000">Future Web Parts in the pipeline are an
improved Slideshow, a PhotoStrip with dynamic pictures (like the Flikr badge) and
a analog/digital clock.</font>
          </span>
        </div>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <div>
          <span class="m">
            <font color="#000000">
            </font>
          </span> 
</div>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=e530371f-bd74-434b-9237-f208a039c647" />
      </body>
      <title>Getting Macromedia Flash to talk to Sharepoint</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,e530371f-bd74-434b-9237-f208a039c647.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/01/22/GettingMacromediaFlashToTalkToSharepoint.aspx</link>
      <pubDate>Sun, 22 Jan 2006 16:52:53 GMT</pubDate>
      <description>&lt;font size=2&gt; 
&lt;p&gt;
Towards the end of last year our company Flexnet Consultants decided to release a
set of free Web Parts that we thought might be useful to have installed in WSS/SPS
sites. The first of these was a Flash slideshow based on the pictures held in a SharePoint
picture library &lt;a href="http://www.flexnetconsult.co.uk/WebParts/FlashSlideShow.htm"&gt;http://www.flexnetconsult.co.uk/WebParts/FlashSlideShow.htm&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
We like Flash a lot as its a great way to liven up dull static pages and the content
can be a lot more than 'eye-candy'
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/FlashSlideshow-Settings.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The first thing you need is some way to create the swf file that Flash is compiled
into, in-house we use Flash MX. The actual slideshow view of the pictures wasn't a
real problem as that's exactly the kind of thing Flash is good at. We use ActionScript
to control the action on the Flash stage.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
The main issue was how to get a list of the pictures held in the library. 
&lt;/p&gt;
&lt;p&gt;
We looked at a few possible ways, one would be&amp;nbsp;to pass a list of pictures to
Flash using its URL or the FlashVars property, not pretty and not scaleable, the next
idea was to talk to the SharePoint Web Services, this would have been ideal except
Flash only really got proper support for talking to generic Web Services with the
recent version 8 and we wanted to support Flash players version 6 and upwards to allow
for the widest audience. We will probably create a version that supports 8 later. 
&lt;/p&gt;
&lt;p&gt;
That left us with one final method and it turns out to be a very easy one, the old
SharePoint URL protocol available since version 1. The docs for these calls are here &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spsdk11/Client_API/spURLProtocol.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spsdk11/Client_API/spURLProtocol.asp&lt;/a&gt;&amp;nbsp;,
there's a lack of useful examples but its pretty easy to use.
&lt;/p&gt;
&lt;p&gt;
You pass parameters via URL to the SharePoint ISAPI&amp;nbsp;DLL called owssvr.dll in
the _vti_bin directory and it returns xml information either formated in a CAML style
or raw data rowset style. We want raw Data so we put XMLDATA=true in the URL
&lt;/p&gt;
&lt;p&gt;
As an example if you pass &lt;a href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE"&gt;http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE&lt;/a&gt;&amp;nbsp;then
you get this XML data back
&lt;/p&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;xml&lt;/font&gt;&lt;/span&gt;&lt;span class=ns&gt;&lt;font color=#ff0000&gt; xmlns:s&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=ns&gt;&lt;font color=#ff0000&gt;uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=ns&gt;&lt;font color=#ff0000&gt; xmlns:dt&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=ns&gt;&lt;font color=#ff0000&gt;uuid:C2F41010-65B3-11d1-A29F-00AA00C14882&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=ns&gt;&lt;font color=#ff0000&gt; xmlns:rs&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=ns&gt;&lt;font color=#ff0000&gt;urn:schemas-microsoft-com:rowset&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=ns&gt;&lt;font color=#ff0000&gt; xmlns:z&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=ns&gt;&lt;font color=#ff0000&gt;#RowsetSchema&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:Schema&lt;/span&gt;&lt;span class=t&gt; id&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;RowsetSchema&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:ElementType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;row&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; content&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;eltOnly&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:CommandTimeout&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;30&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:AttributeType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;ows_SelectedFlag&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:name&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Selection
Checkbox&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:number&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;1&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:datatype&lt;/font&gt;&lt;/span&gt; &lt;span class=dt&gt;&lt;font color=#008000&gt;dt:type&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;ui1&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=dt&gt;&lt;font color=#008000&gt; dt:maxLength&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;1&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:AttributeType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:AttributeType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;ows_DocIcon&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:name&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Type&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:number&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;2&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:datatype&lt;/font&gt;&lt;/span&gt; &lt;span class=dt&gt;&lt;font color=#008000&gt;dt:type&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;string&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=dt&gt;&lt;font color=#008000&gt; dt:maxLength&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;512&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:AttributeType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:AttributeType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;ows_NameOrTitle&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:name&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Name&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:number&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;3&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:datatype&lt;/font&gt;&lt;/span&gt; &lt;span class=dt&gt;&lt;font color=#008000&gt;dt:type&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;string&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=dt&gt;&lt;font color=#008000&gt; dt:maxLength&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;512&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:AttributeType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:AttributeType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;ows_ImageSize&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:name&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Picture
Size&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:number&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;4&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:datatype&lt;/font&gt;&lt;/span&gt; &lt;span class=dt&gt;&lt;font color=#008000&gt;dt:type&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;i4&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=dt&gt;&lt;font color=#008000&gt; dt:maxLength&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;4&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:AttributeType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:AttributeType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;ows_FileSizeDisplay&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:name&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;File
Size&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:number&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;5&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:datatype&lt;/font&gt;&lt;/span&gt; &lt;span class=dt&gt;&lt;font color=#008000&gt;dt:type&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;i4&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=dt&gt;&lt;font color=#008000&gt; dt:maxLength&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;4&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:AttributeType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#990000&gt;&lt;span class=t&gt;s:AttributeType&lt;/span&gt;&lt;span class=t&gt; name&lt;/span&gt;&lt;/font&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;ows_RequiredField&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:name&lt;/font&gt;&lt;/span&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;="&lt;/span&gt;&lt;b&gt;&lt;/b&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;/font&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; rs:number&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;6&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:datatype&lt;/font&gt;&lt;/span&gt; &lt;span class=dt&gt;&lt;font color=#008000&gt;dt:type&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;string&lt;/font&gt;&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=dt&gt;&lt;font color=#008000&gt; dt:maxLength&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b class=dt&gt;&lt;font color=#008000&gt;1073741823&lt;/font&gt;&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:AttributeType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:ElementType&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;s:Schema&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;a class=b onfocus=h() onclick="return false" href="http://sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE#"&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;-&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;rs:data&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;z:row&lt;/font&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;ows_SelectedFlag&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;0&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_DocIcon&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_NameOrTitle&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;London01.jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_ImageSize&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;180&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_FileSizeDisplay&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;10587&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_RequiredField&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Flash
Test/London01.jpg&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;z:row&lt;/font&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;ows_SelectedFlag&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;0&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_DocIcon&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_NameOrTitle&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;London02.jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_ImageSize&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;180&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_FileSizeDisplay&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;7675&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_RequiredField&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Flash
Test/London02.jpg&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;z:row&lt;/font&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;ows_SelectedFlag&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;0&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_DocIcon&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_NameOrTitle&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;London03.jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_ImageSize&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;180&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_FileSizeDisplay&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;14242&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_RequiredField&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Flash
Test/London03.jpg&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;z:row&lt;/font&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;ows_SelectedFlag&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;0&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_DocIcon&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_NameOrTitle&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;London04.jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_ImageSize&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;180&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_FileSizeDisplay&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;6755&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_RequiredField&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Flash
Test/London04.jpg&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;z:row&lt;/font&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;ows_SelectedFlag&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;0&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_DocIcon&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_NameOrTitle&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;London05.jpg&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_ImageSize&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;180&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_FileSizeDisplay&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;19926&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_RequiredField&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Flash
Test/London05.jpg&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=e&gt;
&lt;div style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;:row&lt;/font&gt;&lt;/span&gt; &lt;span class=t&gt;&lt;font color=#990000&gt;ows_SelectedFlag&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;1&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_NameOrTitle&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;SubFolder1&lt;/b&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;"&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt; ows_RequiredField&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;="&lt;/font&gt;&lt;/span&gt;&lt;b&gt;Flash
Test/SubFolder1&lt;/b&gt;&lt;font color=#0000ff&gt;&lt;span class=m&gt;"&lt;/span&gt;&lt;span class=m&gt; /&amp;gt;&lt;/span&gt;&lt;/font&gt; 
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;rs:data&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=b&gt;&lt;strong&gt;&lt;font face="Courier New" color=#ff0000&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span class=t&gt;&lt;font color=#990000&gt;xml&lt;/font&gt;&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#0000ff&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;As you can see the data holds information such
as the filesize and the subfolders, this could be used to recurse into the sub folders
if you wanted.&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;This format is exactly what we need as&amp;nbsp;Flash
has a XML object that can load XML data from a URL. &lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;Example code for this would be &lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;var
x=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; XML();&lt;br&gt;
x.ignoreWhiteSpace &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;;&lt;br&gt;
x.onLoad &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; LoadDocs;&lt;br&gt;
x.Load("&lt;font color=#008000&gt;http:&lt;/font&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#008000&gt;//&lt;/font&gt;sharepoint.flexnet.ds/_vti_bin/owssvr.dll?CS=109&amp;amp;Cmd=Display&amp;amp;List={89ECD870-30EE-4E6E-B39B-B2C8CC548213}&amp;amp;XMLDATA=TRUE"&lt;font color=#000000&gt;);&lt;/font&gt;&lt;/span&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;The XML object will call the LoadDocs function
when it has completed the data download.&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;All thats left is to iterate the XML nodes
and extract the picture names&lt;/font&gt;&lt;/span&gt; from the attribute &lt;font color=#990000&gt;ows_RequiredField&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;function
LoadDocs(success)&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (success){&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var eXmlRoot &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.firstChild;&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
allow for /r/n in the XML stream&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var eXmlSchema= eXmlRoot.childNodes[1];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var eXmlData= eXmlRoot.childNodes[3];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var eRows= eXmlData.childNodes;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;arrImages=&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Array();&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&lt;/span&gt; (i=0;
i&amp;lt; eRows.length; i++){&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (eRows[i].nodeType==1
&amp;amp;&amp;amp; eRows[i].nodeName.toLowerCase()==&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"z:row"&lt;/span&gt;){&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Skip
subfolders and only show jpgs&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
to only show jpgs use (eRows[i].attributes.ows_DocIcon == 'jpg')&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt;(eRows[i].attributes.ows_SelectedFlag==&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"0"&lt;/span&gt; )&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arrImages.push(eRows[i].attributes.ows_RequiredField);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
The list of pictures are now loaded &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;}&lt;br&gt;
&lt;/div&gt;
&gt;
&lt;/font&gt;&gt; 
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;Now that we have the list of pictures we can
then use ActionScript to rotate through them.&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;Once you have created your Flash SWF the final
thing that needs to be done is to render out the OBJECT tag that will host the Flash
file in the&amp;nbsp;&lt;font size=2&gt;RenderWebPart event&lt;/font&gt;, this will look like this
on the SharePoint page:&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&amp;lt;OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="&lt;a href="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"&gt;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&lt;/a&gt;"
WIDTH=180 HEIGHT=120 id="FlexnetSlides_WPQ4" ALIGN=""&amp;gt;&lt;br&gt;
&amp;lt;PARAM NAME=movie VALUE="&lt;a href="http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf"&gt;http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf&lt;/a&gt;"&amp;gt; 
&lt;br&gt;
&amp;lt;PARAM NAME=FlashVars VALUE="ServerBase=http%3a%2f%2fsharepoint%3a80&amp;amp;SiteURL=http%3a%2f%2fsharepoint&amp;amp;PicLib=dcebbba5-5e94-49a1-88b7-03f7625dd8e4&amp;amp;RootFolder=&amp;amp;Transition=Fade&amp;amp;Displaytime=5&amp;amp;Transitiontime=3&amp;amp;ScaleMode=0&amp;amp;MaxCachedImages=30"&amp;gt;&lt;br&gt;
&amp;lt;PARAM NAME=menu VALUE=false&amp;gt; 
&lt;br&gt;
&amp;lt;PARAM NAME=quality VALUE=high&amp;gt; 
&lt;br&gt;
&amp;lt;PARAM NAME=scale VALUE=noscale&amp;gt;&lt;br&gt;
&amp;lt;PARAM NAME=bgcolor VALUE=#FFFFFF&amp;gt;&lt;br&gt;
&amp;lt;EMBED src="&lt;a href="http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf"&gt;http://sharepoint/wpresources/FlexnetConsultants.Slideshow/Flexnet-SlideShow1_2.swf&lt;/a&gt;"
menu=false scale=noscale quality=high bgcolor=#ffffff FlashVars="ServerBase=http%3a%2f%2fsharepoint%3a80&amp;amp;SiteURL=http%3a%2f%2fsharepoint&amp;amp;PicLib=dcebbba5-5e94-49a1-88b7-03f7625dd8e4&amp;amp;RootFolder=&amp;amp;Transition=Fade&amp;amp;Displaytime=5&amp;amp;Transitiontime=3&amp;amp;ScaleMode=0&amp;amp;MaxCachedImages=30"
WIDTH="180" HEIGHT="120" NAME="FlexnetSlides_WPQ4" ALIGN=""TYPE="application/x-shockwave-flash"
PLUGINSPAGE="&lt;a href="http://www.macromedia.com/go/getflashplayer"&gt;http://www.macromedia.com/go/getflashplayer&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;lt;/EMBED&amp;gt;&lt;br&gt;
&amp;lt;/OBJECT&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;The FlashVars method allow you to reference
parameters as variables in the ActionScript code e.g. _root.ServerBase and _root.SiteURL&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;Future Web Parts in the pipeline are an improved
Slideshow, a PhotoStrip with dynamic pictures (like the Flikr badge) and a analog/digital
clock.&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=m&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&gt;
&gt;
&gt;&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=e530371f-bd74-434b-9237-f208a039c647" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,e530371f-bd74-434b-9237-f208a039c647.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=dc8ad09b-c478-4a0c-859f-83e8e7c080ed</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,dc8ad09b-c478-4a0c-859f-83e8e7c080ed.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,dc8ad09b-c478-4a0c-859f-83e8e7c080ed.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=dc8ad09b-c478-4a0c-859f-83e8e7c080ed</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've just been going through the process of upgrading my development SharePoint sites
to run on ASP.NET 2.0 and SQL server 2005.
</p>
        <p>
First I installed the WSS Service Pack 2. No problems there.
</p>
        <p>
Then I upgraded one of my sites to run on ASP.NET 2.0 using the nice new IIS property
tab and running the stsadm -o upgrade -forceupgrade -url <a href="http://portalsiteurl">http://portalsiteurl</a> command
. The ststadm command updates the web.config in the IIS root directory and it also
runs the contents of Web Server Extensions\60\TEMPLATE\SQL\STOREUP.SQL. This adds
some new fields to tables and updates a lot of the core stored procedures.
</p>
        <p>
An IISRESET later and I could browse to the WSS sites running on ASP.NET 2.0 with
no problems.
</p>
        <p>
The real problem came when I try to access another set of WSS sites that were running
on a different IIS virtual server that gave me the dreaded Server Application Unavailable
error
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr1.PNG" border="0" />
        </p>
        <p>
No panic as I knew from previous experience this is almost always a problem with Web.Config
parsing or Application Pool configuration/identity .
</p>
        <p>
Checking the Event Log gave me this
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr21.png" border="0" />
        </p>
        <p>
 
</p>
        <p>
 
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr3.PNG" border="0" />
        </p>
        <p>
Fantastic, a helpful error message, it pointed me straight to the fact that the same
Application Pool was in use by both Virtual Server applications and ASP.NET doesn't
support loading a second version of .NET in the same worker process.
</p>
        <p>
The fix is to create a new App Pool for the applications you want to run under ASP.NET
2.0. This would include any .Net applications that share an AppPool not just SharePoint.
</p>
        <p>
 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr4.PNG" border="0" />
        </p>
        <p>
 
</p>
        <p>
Create a new App Pool based on the existing SharePoint one, give it a meaningful name
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr5.PNG" border="0" />
        </p>
        <p>
 
</p>
        <p>
Assign it to the Virtual Server running SharePoint 
</p>
        <p>
          <img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr6.PNG" border="0" />
        </p>
        <p>
an iisreset later and you should be good to go.
</p>
        <p>
I'm so glad I don't try this stuff out on live servers, anymore.
</p>
        <p>
        </p>
        <p>
        </p>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=dc8ad09b-c478-4a0c-859f-83e8e7c080ed" />
      </body>
      <title>Running both versions of ASP.NET with WSS </title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,dc8ad09b-c478-4a0c-859f-83e8e7c080ed.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/01/16/RunningBothVersionsOfASPNETWithWSS.aspx</link>
      <pubDate>Mon, 16 Jan 2006 11:43:12 GMT</pubDate>
      <description>&lt;p&gt;
I've just been going through the process of upgrading my development SharePoint sites
to run on ASP.NET 2.0 and SQL server 2005.
&lt;/p&gt;
&lt;p&gt;
First I installed the WSS Service Pack 2. No problems there.
&lt;/p&gt;
&lt;p&gt;
Then I upgraded one of my sites to run on ASP.NET 2.0 using the nice new IIS property
tab and running the stsadm -o upgrade -forceupgrade -url &lt;a href="http://portalsiteurl"&gt;http://portalsiteurl&lt;/a&gt; command
. The ststadm command updates the web.config in the IIS root directory and it also
runs the contents of Web Server Extensions\60\TEMPLATE\SQL\STOREUP.SQL. This adds
some new fields to tables and updates a lot of the core stored procedures.
&lt;/p&gt;
&lt;p&gt;
An IISRESET later and I could browse to the WSS sites running on ASP.NET 2.0 with
no problems.
&lt;/p&gt;
&lt;p&gt;
The real problem came when I try to access another set of WSS sites that were running
on a different IIS virtual server that gave me the dreaded Server Application Unavailable
error
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr1.PNG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
No panic as I knew from previous experience this is almost always a problem with Web.Config
parsing or Application Pool configuration/identity&amp;nbsp;.
&lt;/p&gt;
&lt;p&gt;
Checking the Event Log gave me this
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr21.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr3.PNG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Fantastic, a helpful error message, it pointed me straight to the fact that the same
Application Pool was in use by both Virtual Server applications and ASP.NET doesn't
support loading a second version of .NET in the same worker process.
&lt;/p&gt;
&lt;p&gt;
The fix is to create a new App Pool for the applications you want to run under ASP.NET
2.0. This would include any .Net applications that share an AppPool not just SharePoint.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr4.PNG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Create a new App Pool based on the existing SharePoint one, give it a meaningful name
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr5.PNG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Assign it to the Virtual Server running SharePoint 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/Scr6.PNG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
an iisreset later and you should be good to go.
&lt;/p&gt;
&lt;p&gt;
I'm so glad I don't try this stuff out on live servers, anymore.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=dc8ad09b-c478-4a0c-859f-83e8e7c080ed" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,dc8ad09b-c478-4a0c-859f-83e8e7c080ed.aspx</comments>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://blogs.flexnetconsult.co.uk/colinbyrne/Trackback.aspx?guid=7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c</trackback:ping>
      <pingback:server>http://blogs.flexnetconsult.co.uk/colinbyrne/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c.aspx</pingback:target>
      <dc:creator>Colin Byrne</dc:creator>
      <wfw:comment>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.flexnetconsult.co.uk/colinbyrne/SyndicationService.asmx/GetEntryCommentsRss?guid=7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c</wfw:commentRss>
      <slash:comments>6</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One Click Minimize/Restore for WebParts
</p>
        <p>
One anoyance I have with WebPart pages that have a lot of WebParts is the need to
click the WebPart menu to select Minimize or Restore when you want a little more screen
real estate or you need to expand a previously minimized WebPart. 
</p>
        <p>
To solve this niggle I've developed a simple WebPart that using client side Javascript
that traps the double click on a WebPart title and toggles the state of the WebPart.
It integrates with the SharePoint client side object model so any changes are saved
to the site and persists across sessions.
</p>
        <p>
Unzip the DoubleClick WebPart Minimize/Restore DWP file to a directory of your choice
</p>
        <p>
Browse to the SharePoint WebPart page - Click the 'Modify My Page' - 'Add Web Parts'
- 'Import menu' option
</p>
        <p>
Click the Browse button and select the DWP file.
</p>
        <p>
Click the upload button - once uploaded you can drag the WebPart to anywhere on the
page.
</p>
        <p>
 
</p>
        <hr />
        <p>
Here's a little more detail of the SharePoint client side scripting.
</p>
        <p>
First I needed to get a list of WebParts on a page. Thats easy - every WebPart page
that holds WebParts has a global object WPSC that is initialized like this <font color="#0000ff">WPSC.Init(document). </font><font color="#000000">The
object WPSC is defined in IE55up.js/IE50.js/NonIe.js depending on browser. </font>This
is the Web Part Page Services Component which handles the client side WebPart infrastructure,
it provides services such as loading/saving properties and handles page events see <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/wpscaOverview_SV01098760.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/wpscaOverview_SV01098760.asp</a> 
for more details.
</p>
        <p>
OnPage javascript adds every WebPart on the page to its WebPartPage.Parts collection
e.g.
</p>
        <p>
          <font color="#0000ff">WPSC.WebPartPage.Parts.Register('WPQ1','8db7d8d8-b1e0-4e9d-84ff-0b266b8c0beb',document.all.item('WebPartWPQ1'))</font>
        </p>
        <p>
To get a list of all the WebParts on the Page you can do this
</p>
        <p>
for(var i=0; i&lt; WPSC.WebPartPage.Parts.Count;i++)<br />
  {<br />
    wp=WPSC.WebPartPage.Parts.Item(i);<br />
}
</p>
        <p>
What we really need is the WebPartQualifierproperty of the WebPart which is the unique
ID for each WebPart on the Page, various parts of the WebPart are then suffixed with
this identifier e.g WebPartTitleWPQ2 for the title div and WebPartWPQ2 for the actual
serverside rendered HTML div container.
</p>
        <p>
So to hook the DblClick event we can modify the inner loop like so
</p>
        <p>
    wpq=WPSC.WebPartPage.Parts.Item(i).WebPartQualifier;<br />
    var oTitle=document.getElementById('WebPartTitle' + wpq);<br />
   
<br />
    if (oTitle) 
<br />
    {  
<br />
       oTitle.attachEvent('ondblclick',MinRestoreWP);<br />
    }
</p>
        <p>
Here we're setting the double click event to fire the MinRestoreWP function. this
is defined as 
</p>
        <p>
function MinRestoreWP()<br />
{<br />
var WPQId, WPObject;<br />
var titleid,  WPQPos;
</p>
        <p>
// Clear the selection the double click produces<br />
document.selection.empty(); 
<br />
window.event.cancelBubble = true; 
<br />
window.event.returnValue = false; 
</p>
        <p>
titleid=window.event.srcElement.parentNode.id;<br />
WPQPos=titleid.lastIndexOf("WPQ");<br />
if (WPQPos&gt;0) 
<br />
{<br />
   WPQId='WebPart' + titleid.substring(WPQPos, titleid.length);<br />
   WPObject=document.getElementById(WPQId);<br />
   // call the MSO api to do the work<br />
   if (WPObject) MSOLayout_MinimizeRestore(WPObject);<br />
}<br />
  
<br />
return false;<br />
}
</p>
        <p>
Here we get the WebPart to collapse or expand by going to the parent element of the
Title bar which holds the WebPart title id which we can parse to get the WPQ id. This
allows us to get the WebPart object we need.
</p>
        <p>
The expand collapse is handled by a SharePoint function MSOLayout_MinimizeRestore
which simply takes a WebPart object and does the hard work of hidding or showing the
webpart by changing the WebPart.style.display CSS property. It also logs the change
so the property is saved back to the WebPartPages webservice and is remembered if
you close the browser and revisit the page.
</p>
        <a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/DoubleClickWebPartMinimizeRestore.zip">DoubleClickWebPartMinimizeRestore.zip
(1.35 KB)</a>
        <img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c" />
      </body>
      <title>DoubleClick Minimise/Restore for WebParts</title>
      <guid isPermaLink="false">http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c.aspx</guid>
      <link>http://blogs.flexnetconsult.co.uk/colinbyrne/2006/01/15/DoubleClickMinimiseRestoreForWebParts.aspx</link>
      <pubDate>Sun, 15 Jan 2006 18:21:03 GMT</pubDate>
      <description>&lt;p&gt;
One Click Minimize/Restore for WebParts
&lt;/p&gt;
&lt;p&gt;
One anoyance I have with WebPart pages that have a lot of WebParts is the need to
click the WebPart menu to select Minimize or Restore when you want a little more screen
real estate or you need to expand a previously minimized WebPart. 
&lt;/p&gt;
&lt;p&gt;
To solve this niggle I've developed a simple WebPart that using client side Javascript
that traps the double click on a WebPart title and toggles the state of the WebPart.
It integrates with the SharePoint client side object model so any changes are saved
to the site and persists across sessions.
&lt;/p&gt;
&lt;p&gt;
Unzip the DoubleClick WebPart Minimize/Restore DWP file to a directory of your choice
&lt;/p&gt;
&lt;p&gt;
Browse to the SharePoint WebPart page - Click the 'Modify My Page' - 'Add Web Parts'
- 'Import menu' option
&lt;/p&gt;
&lt;p&gt;
Click the Browse button and select the DWP file.
&lt;/p&gt;
&lt;p&gt;
Click the upload button - once uploaded you can drag the WebPart to anywhere on the
page.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;
Here's a little more detail of the SharePoint client side scripting.
&lt;/p&gt;
&lt;p&gt;
First I needed to get a list of WebParts on a page. Thats easy - every WebPart page
that holds WebParts has a global object WPSC that is initialized like this &lt;font color=#0000ff&gt;WPSC.Init(document). &lt;/font&gt;&lt;font color=#000000&gt;The
object WPSC is defined in IE55up.js/IE50.js/NonIe.js depending on browser. &lt;/font&gt;This
is the Web Part Page Services Component which handles the client side WebPart infrastructure,
it provides services such as loading/saving properties and handles page events see &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/wpscaOverview_SV01098760.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/wpscaOverview_SV01098760.asp&lt;/a&gt;&amp;nbsp;
for more details.
&lt;/p&gt;
&lt;p&gt;
OnPage javascript adds every WebPart on the page to its WebPartPage.Parts collection
e.g.
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#0000ff&gt;WPSC.WebPartPage.Parts.Register('WPQ1','8db7d8d8-b1e0-4e9d-84ff-0b266b8c0beb',document.all.item('WebPartWPQ1'))&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
To get a list of all the WebParts on the Page you can do this
&lt;/p&gt;
&lt;p&gt;
for(var i=0; i&amp;lt; WPSC.WebPartPage.Parts.Count;i++)&lt;br&gt;
&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; wp=WPSC.WebPartPage.Parts.Item(i);&lt;br&gt;
}
&lt;/p&gt;
&lt;p&gt;
What we really need is the WebPartQualifierproperty of the WebPart which is the unique
ID for each WebPart on the Page, various parts of the WebPart are then suffixed with
this identifier e.g WebPartTitleWPQ2 for the title div and WebPartWPQ2 for the actual
serverside rendered HTML div&amp;nbsp;container.
&lt;/p&gt;
&lt;p&gt;
So to hook the DblClick event we can modify the inner loop like so
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; wpq=WPSC.WebPartPage.Parts.Item(i).WebPartQualifier;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var oTitle=document.getElementById('WebPartTitle' + wpq);&lt;br&gt;
&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (oTitle) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oTitle.attachEvent('ondblclick',MinRestoreWP);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p&gt;
Here we're setting the double click event to fire the MinRestoreWP function. this
is defined as 
&lt;/p&gt;
&lt;p&gt;
function MinRestoreWP()&lt;br&gt;
{&lt;br&gt;
var WPQId, WPObject;&lt;br&gt;
var titleid,&amp;nbsp; WPQPos;
&lt;/p&gt;
&lt;p&gt;
// Clear the selection the double click produces&lt;br&gt;
document.selection.empty(); 
&lt;br&gt;
window.event.cancelBubble = true; 
&lt;br&gt;
window.event.returnValue = false; 
&lt;/p&gt;
&lt;p&gt;
titleid=window.event.srcElement.parentNode.id;&lt;br&gt;
WPQPos=titleid.lastIndexOf("WPQ");&lt;br&gt;
if (WPQPos&amp;gt;0) 
&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; WPQId='WebPart' + titleid.substring(WPQPos, titleid.length);&lt;br&gt;
&amp;nbsp;&amp;nbsp; WPObject=document.getElementById(WPQId);&lt;br&gt;
&amp;nbsp;&amp;nbsp; // call the MSO api to do the work&lt;br&gt;
&amp;nbsp;&amp;nbsp; if (WPObject) MSOLayout_MinimizeRestore(WPObject);&lt;br&gt;
}&lt;br&gt;
&amp;nbsp; 
&lt;br&gt;
return false;&lt;br&gt;
}
&lt;/p&gt;
&lt;p&gt;
Here we get the WebPart to collapse or expand by going to the parent element of the
Title bar which holds the WebPart title id which we can parse to get the WPQ id. This
allows us to get the WebPart object we need.
&lt;/p&gt;
&lt;p&gt;
The expand collapse is handled by a SharePoint function MSOLayout_MinimizeRestore
which simply takes a WebPart object and does the hard work of hidding or showing the
webpart by changing the WebPart.style.display CSS property. It also logs the change
so the property is saved back to the WebPartPages webservice and is remembered if
you close the browser and revisit the page.
&lt;/p&gt;
&lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/content/binary/DoubleClickWebPartMinimizeRestore.zip"&gt;DoubleClickWebPartMinimizeRestore.zip
(1.35 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://blogs.flexnetconsult.co.uk/colinbyrne/aggbug.ashx?id=7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c" /&gt;</description>
      <comments>http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,7aaebe95-ec8e-4df1-a4fa-4dd8dd78256c.aspx</comments>
      <category>SharePoint</category>
    </item>
  </channel>
</rss>