Who’s the Man Blog


Slow folder access each click in RDP Redirected Drives
May 21, 2009, 12:22 am
Filed under: Uncategorized | Tags: ,

At my place of business we use alot of MS Terminal Services 2003 coupled with a commercial linux distro that runs rDesktop called 2x. Alot of our ends users specifically needed to take pictures with their digital camera and upload them to the server(the camera is configured to display as a usb disk drive). This was working fairly well up until recently when all of a sudden the user would go to access the camera as a RDP redirected drive and it would wait and wait and wait about 30 seconds then show you the folder and it was the same for each click into a sub folder on the drive. We tried everything  uninstall antivirus, different service packs, different client(including a custom linux distro I built years ago with thinstation.org), no luck.

So I worked on something else for a week, to be honest I thought: Wow, what a weird issue hope somebody else has seen it and written something up. I came back to it today and thought it had to be failing out somewhere on what I assumed to be a file type access so I ran filemon utility from Microsoft.   To be honest never run this utility on a box that is in production it generates alot of crap I mean output. Sure enough within two minutes I figured out the issue, and why it came up just recently. The explorer process was trying to access a network share called \\tsclient\hotplug (this is what usb drives are redirected under from linux) and getting back a ”path not found” error. While I have seen the explorer bar read \\tsclient\C numbers of times on redirected drives I never gave it much thought. I thought it was a Microsoft cute way of integrating the RDP into the explorer. Well in a normal network this works fine the system puts a request out to DNS/hosts/WINS and fails out nearly instantly, and then some peice of code must then point the name to the server itself. Our systems were resolving tsclient to an actual IP via the DNS upstream provider we started using OPENDNS. OPENDNS has a couple of nice features our ISP doesn’t provide DNS STATS, DNS Blacklisting, Typo correction, and guided search so if a user types a incorrect web address it will try and correct or bring you to a search page with that as a search keyword. The way this works is for unresolvable names it returns the IP address of OPENDNS server and your webbrowser goes to their servers and they serve up a search page using the host header you requested. So on our terminal server when our users would click into the \\tsclient\hotplug , the system would resolve the name tsclient and it receive a IP to OPENDNS servers that would then need to failout, and then go about its normal rendering of the tsclient shares. The best solution I figured out was to create a DNS entry for “tsclient ” on our internal DNS servers and have it resolve to 127.0.0.1. This solved the speed issue instantly.

Hope this helps someone else!



HowTo: Adding an editable footer to Sharepoint
May 16, 2009, 3:18 am
Filed under: Uncategorized

 As I have worked with Sharepoint project I tried to ensure one thing: that a user should be able to customize and update any image, text, etc from within the browser easily. Well, What isn’t available for editing in the browser pretty much nothing. But do you want a end user updating something in a master page. For example if you created a footer globally in a master page and applied it across all sites do you want a end user coming in and trying to edit the one page that can break the entire site? Answer add a web part to a master page specifically a dataview webpart like in http://whostheman.wordpress.com/2009/05/09/adding-customized-webparts-to-masterpage/ . By linking this to a list it will allow a end user to update using the Sharepoint list item. To begin create a custom list by going to Site Actions -> Create and choosing Custom List call it Footer. Once that is done create

 a column called Body

 column for footer

Now create a new list item:

listitem

Now comes the interesting part open up Sharepoint Designer (the best free CMS designing tool I’ve found) and open your master page.

Find the very bottom of your page I recommend following the table tags for instance the ms-main table add the following after the last </TR> tag:

<tr><td><div class=”footer”>TEST</div></td></tr>

edt master page

Now we can insert the data view web part click in the table row where the word test appears: Insert->Sharepoint Controls->Data View. This will open the data sources library pane to the right hand right of the screen. Right click the footer list to the right and select Show Data. Drag the Body row into the web part. It should look like this:

added body row

Now right click the left hand side where is says Body choose Delete->Delete Columns. This should should make your footer text the only column shown. Go into the code view windows and got the following line <xsl:value-of select=”@Body” disable-output-escaping=”yes” /></td> and delete the class and width tag above this line in the TD tag. Select the body area and right click and choose Format Item as->Rich Text.  The last thing is to add a peice of code to ensure the webpart displays properly on subsites:

<WebPartPages:DataFormParameter ParameterKey=”WebURL” PropertyName=”ParameterValues” DefaultValue=”/” Name=”WebURL”></WebPartPages:DataFormParameter>

This needs to be added before each of the following:

</SelectParameters>

</DeleteParameters>

</UpdateParameters>

</InsertParameters>

 

and delete the word test we added in the beginning,

 

You should be able to save andhave something that looks like this, remember that it can be completely stylized with the footer CSS tag:

footerfinal



WSS 3.0 Configuration Exam
March 12, 2009, 12:10 am
Filed under: Certification, Sharepoint, Uncategorized

I recently took the Microsoft 70-631 WSS Configuration exam and passed it. I have this bit of info for those attempting to pass the exam: know both deployment scenarios around using publishing ISA Server 2004/2006 and Network Load Balancing (Unicast versus Multicast) nearly half the questions were focused on this and not on Sharepoint.



RSS Yahoo Weather Feed and Sharepoint WSS 3.0 / MOSS 2007
June 17, 2008, 2:00 am
Filed under: Sharepoint, Uncategorized | Tags: , , , ,

As part of my recent Sharepoint work I worked on finding a good Weather webpart the best that I could find was the following from http://blogs.msdn.com/ketaanhs/archive/2008/03/22/showing-weather-web-part-using-rss-weather-yahoo-com-in-sharepoint-2007.aspx

The RSS feed I used was:

http://weather.yahooapis.com/forecastrss?p=01541

And used the following XSL Spreadsheet:

<?xml version=”1.0″ encoding=”ISO-8859-1″?>

<xsl:stylesheet version=”1.0″
xmlns:xsl=”
http://www.w3.org/1999/XSL/Transform” xmlns:yweather=”http://xml.weather.yahoo.com/ns/rss/1.0” xmlns:geo=”http://www.w3.org/2003/01/geo/wgs84_pos#”>
<xsl:output method=”html” indent=”yes”/>

<xsl:template match=”/”>

<xsl:variable name=”scale”>
    <xsl:value-of select=”rss/channel/yweather:units/@temperature”/>
</xsl:variable>

<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”3″ class=”Normal”>
  <tr bgcolor=”#075C70″>
    <td colspan=”2″><strong><font color=”white”>Weather Report – <xsl:value-of select=”rss/channel/item/title”/></font></strong></td>
  </tr>
  <tr>
    <td><strong><font size=”4″><xsl:value-of select=”rss/channel/item/yweather:condition/@temp”/><xsl:text>°</xsl:text><xsl:copy-of select=”$scale” /></font></strong><br/>
      High <xsl:value-of select=”rss/channel/item/yweather:forecast/@high”/> <xsl:text>°</xsl:text><xsl:copy-of select=”$scale” /> <br/>
      Low <xsl:value-of select=”rss/channel/item/yweather:forecast/@low”/> <xsl:text>°</xsl:text><xsl:copy-of select=”$scale” /> </td>
    <td>
      <xsl:text disable-output-escaping=”yes”><img src=”
http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:text>
      <xsl:value-of select=”rss/channel/item/yweather:condition/@code”/>
      <xsl:text disable-output-escaping=”yes”>.gif”/></xsl:text>
      <br/>
      <xsl:value-of select=”rss/channel/item/yweather:condition/@text”/></td>
  </tr>
  <tr bgcolor=”#075C70″>
    <td colspan=”2″><strong><font color=”white”>2 Day Forecast</font></strong></td>
  </tr>
  <tr>
    <td colspan=”2″><table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”3″ class=”Normal”>
      <xsl:for-each select=”(rss/channel/item/yweather:forecast)[position() < 3]“>
        <tr>
          <td><xsl:value-of select=”@day”/></td>
          <td>
            <xsl:text disable-output-escaping=”yes”><img src=”
http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:text>
        <xsl:value-of select=”@code”/>
        <xsl:text disable-output-escaping=”yes”>.gif”/></xsl:text>
          </td>
          <td><xsl:value-of select=”@text”/><br/>High: <xsl:value-of select=”@high”/>
            <xsl:text>°</xsl:text><xsl:copy-of select=”$scale” />
             Low: <xsl:value-of select=”@low”/><xsl:text>°</xsl:text><xsl:copy-of select=”$scale” />
          </td>
        </tr>
       </xsl:for-each>
      </table></td>
  </tr>
 
</table>

</xsl:template>

</xsl:stylesheet>

 

And you end up with this:

 

 weatherpart

 Both WSS and MOSS versions of the webpart are uploaded to http://10235.freesharepoint2007.com/Downloads/Forms/AllItems.aspx



Sharepoint 3.0/MOSS 2007 and Whats Up Professional w/ MSDE or SQL 2005 Express
June 17, 2008, 1:43 am
Filed under: Uncategorized | Tags: , , , , ,

 As part of a implementation at work I have been trying to integrate applications (mainly SQL backend) applications into Windows Sharepoint Services 3.0 and MOSS 2007. While What’s Up uses SQL it comes with either MSDE 2000 or SQL 2005 Express in order to access it via the network you will need t enable TCP/IP access. I used Sharepoint Designer 2007 and created a data view on a test page and then exported the web part and imported into our layout based main page(a good way to get a custom web part into a ghosted/attached layout page). The problem was finding the correct SQL query to generate a table of down devices from Whats Up Gold here is the query I used at first which just gives the device and how long it has been down which is just the default query from What’sUp Dynamic Groups.

SELECT DISTINCT Device.nDeviceID FROM Device JOIN MonitorState ON Device.nWorstStateID = MonitorState.nMonitorStateID WHERE Device.bRemoved = 0 AND MonitorState.nInternalMonitorState = 1

Here is the webpart it displays the time down is different colors yellow for currently down, orange for 2 mins, and red for 5 mins or more to customize to your enviroment replace whatsupserver with your server name and username and password with yours:

<webParts>
  <webPart xmlns=”http://schemas.microsoft.com/WebPart/v3“>
    <metaData>
      <type name=”Microsoft.SharePoint.WebPartPages.DataFormWebPart, Microsoft.SharePoint,

Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name=”PageSize” type=”int”>-1</property>
        <property name=”HelpMode” type=”helpmode”>Modeless</property>
        <property name=”Height” type=”string” />
        <property name=”SampleData” type=”string” null=”true” />
        <property name=”AllowConnect” type=”bool”>True</property>
        <property name=”CatalogIconImageUrl” type=”string” />
        <property name=”XslLink” type=”string” null=”true” />
        <property name=”AllowClose” type=”bool”>True</property>
        <property name=”Hidden” type=”bool”>False</property>
        <property name=”MissingAssembly” type=”string”>Cannot import this Web Part.</property>
        <property name=”TitleIconImageUrl” type=”string” />
        <property name=”ChromeState” type=”chromestate”>Normal</property>
        <property name=”FireInitialRow” type=”bool”>True</property>
        <property name=”Description” type=”string” />
        <property name=”AllowMinimize” type=”bool”>True</property>
        <property name=”Xsl” type=”string”>

<xsl:stylesheet xmlns:xs=”http://www.w3.org/2001/XMLSchema

xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata” version=”1.0″ exclude-result-prefixes=”xsl

msxsl ddwrt” xmlns:ddwrt=”http://schemas.microsoft.com/WebParts/v2/DataView/runtime

xmlns:asp=”http://schemas.microsoft.com/ASPNET/20

xmlns:__designer=”http://schemas.microsoft.com/WebParts/v2/DataView/designer

xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:msxsl=”urn:schemas-microsoft-com:xslt”

xmlns:SharePoint=”Microsoft.SharePoint.WebControls” xmlns:ddwrt2=”urn:frontpage:internal”>
 <xsl:output method=”html” indent=”no”/>
 <xsl:decimal-format NaN=”"/>
 <xsl:param name=”dvt_apos”>’</xsl:param>
 <xsl:variable name=”dvt_1_automode”>0</xsl:variable>
 
 <xsl:template match=”/” xmlns:xs=”
http://www.w3.org/2001/XMLSchema

xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata”

xmlns:asp=”http://schemas.microsoft.com/ASPNET/20

xmlns:__designer=”http://schemas.microsoft.com/WebParts/v2/DataView/designer

xmlns:SharePoint=”Microsoft.SharePoint.WebControls”>
  <xsl:call-template name=”dvt_1″/>
 </xsl:template>
 
 <xsl:template name=”dvt_1″>
  <xsl:variable name=”dvt_StyleName”>RepForm1</xsl:variable>
  <xsl:variable name=”Rows” select=”/dsQueryResponse/NewDataSet/Row” />
  <xsl:variable name=”dvt_RowCount” select=”count($Rows)” />
  <xsl:variable name=”IsEmpty” select=”$dvt_RowCount = 0″ />
  <table border=”0″ width=”100%”>
   <xsl:call-template name=”dvt_1.body”>
    <xsl:with-param name=”Rows” select=”$Rows” />
    
    </xsl:call-template>
  </table>
  </xsl:template>
 <xsl:template name=”dvt_1.body”>
  <xsl:param name=”Rows” />
  <xsl:for-each select=”$Rows”>
     <xsl:call-template name=”dvt_1.rowview”

/></xsl:for-each>
 </xsl:template>
 <xsl:template name=”dvt_1.rowview”>
  <tr>
   <td width=”100%” colspan=”2″ class=”ms-vb”>
    
   </td>
  </tr>
  <tr>
   <td width=”100%” colspan=”2″ class=”ms-vb”>
    <a

href=”http://whatsupserver/NmConsole/Workspace/DeviceStatus/DeviceStatus.asp?nDeviceID={@nDeviceID

}”><xsl:value-of select=”@sDisplayName” /></a>
    <xsl:text

xmlns:ddwrt=”http://schemas.microsoft.com/WebParts/v2/DataView/runtime

ddwrt:nbsp-preserve=”yes” disable-output-escaping=”yes”>&amp;nbsp;
    
    </xsl:text>- <span>
    <xsl:attribute name=”style”>
     <xsl:if test=”normalize-space(@sStateName) =

‘Down’”>color: #FFFF00;</xsl:if>
     <xsl:if test=”normalize-space(@sStateName) = ‘Down at

least 2 min’”>color: #FF9900;</xsl:if>
     <xsl:if test=”normalize-space(@sStateName) = ‘Down at

least 5 min’ or normalize-space(@sStateName) = ‘Down at least 20 min’”>color: #FF0000;

font-size: inherit;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select=”@sStateName”

disable-output-escaping=”yes” />
    </span><br /></td>
  </tr>
  <xsl:if test=”$dvt_1_automode = ‘1′” ddwrt:cf_ignore=”1″>
   <tr>
    <td width=”100%” colspan=”2″ class=”ms-vb”>
     <span ddwrt:amkeyfield=”nDeviceID,nMonitorStateID”

ddwrt:amkeyvalue=”concat(ddwrt:EscapeDelims(string(@nDeviceID)),’,',ddwrt:EscapeDelims(string(@n

MonitorStateID)))” ddwrt:ammode=”view” />
    </td>
   </tr>
  </xsl:if>
 </xsl:template>
 </xsl:stylesheet> </property>
        <property name=”ListName” type=”string” null=”true” />
        <property name=”ChromeType” type=”chrometype”>Default</property>
        <property name=”AllowEdit” type=”bool”>True</property>
        <property name=”ShowWithSampleData” type=”bool”>False</property>
        <property name=”Direction” type=”direction”>NotSet</property>
        <property name=”DataFields”

type=”string”>@nDeviceID,nDeviceID;@sDisplayName,sDisplayName;@nMonitorStateID,nMonitorStateID;@

sStateName,sStateName;@nInternalMonitorState,nInternalMonitorState;@nInternalStateTime,nInternal

StateTime;@nStateFillColor,nStateFillColor;@nStateLineColor,nStateLineColor;@nShapePoints,nShape

Points;@nShapeInnerRadius,nShapeInnerRadius;@nShapeOuterRadius,nShapeOuterRadius;@nShapeDirectio

n,nShapeDirection;@bSystemType,bSystemType;</property>
        <property name=”ViewContentTypeId” type=”string” />
        <property name=”Width” type=”string” />
        <property name=”CacheXslTimeOut” type=”int”>86400</property>
        <property name=”TitleUrl” type=”string” />
        <property name=”DataSourceID” type=”string” />
        <property name=”HelpUrl” type=”string” />
        <property name=”CacheXslStorage” type=”bool”>True</property>
        <property name=”DataSourcesString” type=”string”><%@ Register TagPrefix=”sharepoint”

Namespace=”Microsoft.SharePoint.WebControls” Assembly=”Microsoft.SharePoint, Version=12.0.0.0,

Culture=neutral, PublicKeyToken=71e9bce111e9429c” %><sharepoint:SPSqlDataSource

runat=”server” AllowIntegratedSecurity=”False” ConnectionString=”Data

Source=whatsupserver\whatsup;User ID=username;Password=password;Initial Catalog=WhatsUp;”

ProviderName=”System.Data.SqlClient” SelectCommand=”SELECT DISTINCT Device.nDeviceID,

Device.sDisplayName, MonitorState.*  FROM         Device INNER JOIN                       

MonitorState ON Device.nWorstStateID = MonitorState.nMonitorStateID  WHERE     (Device.bRemoved

= 0) AND (MonitorState.nInternalMonitorState = 1)”

ID=”WhatsUp_x0020_Server_x0020_Down_x0020_Devices1″></sharepoint:SPSqlDataSource>
</property>
        <property name=”ExportMode” type=”exportmode”>All</property>
        <property name=”AllowZoneChange” type=”bool”>True</property>
        <property name=”Default” type=”string” />
        <property name=”UseSQLDataSourcePaging” type=”bool”>True</property>
        <property name=”ParameterBindings” type=”string”>
       <ParameterBinding Name=”dvt_apos”

Location=”Postback;Connection”/>
       <ParameterBinding Name=”UserID”

Location=”CAMLVariable” DefaultValue=”CurrentUserName”/>
       <ParameterBinding Name=”Today”

Location=”CAMLVariable” DefaultValue=”CurrentDate”/>
      </property>
        <property name=”DisplayName” type=”string” />
        <property name=”NoDefaultStyle” type=”string”>TRUE</property>
        <property name=”Title” type=”string”>WhatsUp Server Down Devices</property>
        <property name=”AllowHide” type=”bool”>True</property>
        <property name=”ViewFlag” type=”string”>0</property>
      </properties>
    </data>
  </webPart>
</webParts>

And you end up with something that looks like this:

 

whatsupwebpart

 I hope this helps someone besides myself.