Issues with SharePoint Search

On one of my SharePoint installations, I was having a ton of issues with SharePoint Search.  I had created a SharePoint Search Application post-install with a different service account.  The search application starting adding an additional 10 MB to the individual log files.  I would reset the IIS application pool, but would see the search application continuing to run.

Read more


SharePoint People Picker Searching Accounts Across External Active Directory Trusts

In instances where your network administrator has created an external trust with another domain, you may want the SharePoint People Picker to find users in the external AD.

According to Microsoft’s TechNet, “The People Picker automatically issues queries to all two-way trusted domains when it uses the application pool account to search for users and groups. When you select a secondary account in the People Picker, the primary account information will be returned.”  Therefore, by default two-way trusts are automatically searched.

Read more


Counting the Factors of a Number

By definition, a factor is one of two or more positive numbers that when multiplied together produce a given product.  For example, given the integer 24, the count of factors 8.

The below algorithm tests the range of numbers from 1 to a given integer.  If the given interger divided by the current number returns a remainder of 0, then the current number is a factor of the given integer.

 

 

Get the source control, including unit tests: GetFactorsCount.zip (9.43 kb)


Getting All Factors for a Number

By definition, a factor is one of two or more positive numbers that when multiplied together produce a given product.  For example, given the integer 24, the factors are [1, 2, 3, 4, 6, 8, 12, 24].

The below algorithm tests the range of numbers from 1 to a given integer.  If the given integer divided by the current number returns a remainder of 0, then the current number is a factor of the given integer.

 

Get the source control, including unit tests: GetFactors.zip (9.85 kb)


Restore Database from a Network Path in SQL Management Studio

There’s a lot of times when people need to restore databases from a network (UNC) path.  There are two ways of doing this:

  • By giving the path in the RESTORE DATABASE command like:
    RESTORE DATABASE FROM DISK = \\server_name\shared_drive\backup_file_name.bak
  • By giving the path of the file (\\server_name\shared_drive\backup_file_name.bak) in the management studio restore wizard

Read more


How to Programmatically Impersonate Users in SharePoint

There are times when developing custom web parts and other SharePoint solutions, you need to impersonate a user and view SharePoint from within their context.

Impersonating a user in SharePoint requires a few things:

  • the account that the web or console application users that has privileges to impersonate other users (typically this would be the system account)
  • specific users’ user tokens

Read more


Testing LINQ Statements Using LINQPad

The other day I was needing a way to test some LINQ statements from an application which rebuilds a database while performing some calculations.  The rebuilding process is just shy of 24 hours.

Besides, there have been numerous other times in which I needed to test LINQ statements.

Troubleshooting LINQ can be difficult at times due to it deferred execution – the statement is executed as the last possible moment.  I wanted a tool similar to SQL Management Studio in which I could run LINQ queries against a database.  Thus, I stumbled upon (actually, it wasn’t very hard to find) LINQPad.

Since, finding it, LINQPad has allowed me to test my queries prior to implementation in the application.  Therefore, I can better predict the result instead of waiting through a long process and/or waiting for QA to troubleshoot.

LINQPad allows the user to run C#, VB.NET, F# and SQL statements/expressions against the database – very flexible and extremely helpful.  LINQPad’s flexibility allows the connection’s data context to be LINQ to SQL, Entity Framework and WCF (OData).

Take a look at LINQPad at www.linqpad.net.


Granting Users Access to TFS Analysis Cube

I was asked to take over a TFS installation.  Apparently, there was no one, previously, knowledgeable in administering Team Foundation Server because there were many installation and configuration issues – it was a mess.

tfs-administrators-consoleOne such issue was misassignment of user permissions.  For instance, the business needed multiple users to have access to the TFS analysis cube in order to generate reports and pivot tables in Excel. The business’s solution to granting users “read” access to the cube was to grant them TFS Administrator privileges. In fact, there were over 20 users who were authorized as Team Foundation Administration Console Users.

By doing this, not only does the user have incredibly insane permissions around TFS, but they have administrative privileges (Read/Write) to the analysis cube – they would be added as a member of theTfsWarehouseAdministrator role group on the analysis server.
Read more


Atalasoft Image Viewer with Silverlight in SharePoint

I was working on a Silverlight-based BI Dashboard in SharePoint for Pfizer.  Pfizer allows the consumers of its animal products to upload receipts and Proof of Purchases in order to qualify for rebates.  The business required the ability for Silverlight to process an array of image types, including PDFs, that the consumer may upload.  Processing included not only viewing the image, but also zoom, crop and rotate.

Since Silverlight can only process JPGs or PNGs natively, I needed a third-party provider to satisfy the business requirements.  There are many libraries that render different image formats and PDFs, but I needed a single solution to handle as many formats, again, including PDFs, as possible and accomplish the image manipulation requirements.  Therefore, we decided on Atalasoft DotImage.

Read more