Joseph Michael Pesch
VP Programming

SharePoint Deploy Workflow Feature to Server Farm

by 11. January 2012 13:24

This post covers steps used to deploy the workflow feature to a SharePoint site (or sub-site as shown in this example URL: http://ServerNameHere/sites/SubSiteNameHere).  Attached is a sample SharePoint workflow feature that can configured to perform a daily refresh of an Excel file from a SharePoint site (i.e. refreshing the data connections to update data from external sources).

To setup the Visual Studio Solution, you will need to change the URL located in the three areas shown below:

  1. Project -> Site URL -> http://ServerNameHere/sites/SubSiteNameHere
  2. Web References -> ExcelWebService -> Web Reference URL -> http://ServerNameHere/sites/SubSiteNameHere/_vti_bin/excelservice.asmx
  3. Web References -> ListService -> Web Reference URL -> http://ServerNameHere/sites/SubSiteNameHere/_vti_bin/lists.asmx

When deploying the workflow feature on the server (either through Visual Studio right-click and “Deploy”; or, via Power Shell script shown below) I received the following error message:

Error occurred in deployment step 'Activate Features': Feature with Id '{GUID}' is not installed in this farm, and cannot be added to this scope.

Power Shell Deployment Script:

rem NOTE: Make sure the "Sharepoint 2010 Administration" service is NOT running.
rem We are using the execadmsvcjobs to execute rather than letting th Timer service run them.
rem ADDING...
cd "c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"
stsadm -o addsolution -filename "C:\VSS\ExcelRefreshWorkflow\bin\Debug\ExcelRefreshWorkflow.wsp"
stsadm -o deploysolution -name "ExcelRefreshWorkflow.wsp" -immediate -allowgacdeployment -allowcaspolicies
stsadm -o execadmsvcjobs
stsadm -o activatefeature -name "ExcelRefreshWorkflow_Feature1" -url http://ServerNameHere/sites/SubSiteNameHere

NOTE: This feature is being deployed to “Scope = Site”, not Farm, Web or Web Application scope.

image

If you are running a single server instance of Sharepoint this should not happen (i.e. your deployment should be completed successfully). In the case of a Sharepoint server farm you will need to perform the following steps manually to complete the installation.

  1. From the “SharePoint 2010 Central Administration” site:
    • Navigate to: “System Settings” -> “Manage farm solutions”
    • Click on “excelrefreshworkflow.wsp”
    • Click on “Deploy Solution” and complete the deployment screen (schedule or run immediately).
    • Refresh the farm solutions screen until the solution management screen until the status column shows “Deployed” (note, the “Deployed To” column should show “Globally deployed.”).
    • NOTE: Make sure the “SharePoint 2010 Timer” service is running; otherwise, this step will not complete.
  2. Open the normal SharePoint site and from the top level site:
    • Navigate to: “Site Actions” -> “Site Settings” -> “Site Collection Administration” -> “Site collection features”
    • Click the “Activate” button associated with the “ExcelRefreshWorkflow” item in the list.
    • NOTE: Repeat this step on every sub-site that you want to use the workflow in.
  3. At this point the installation is complete. You can now navigate to the sub-site and configure the workflow on the appropriate Library and activate it on the appropriate documents in the library.
    • From the sub-site home page, navigate to: “Library Tools” -> “Library” -> “Library Settings” -> “Workflow Settings”.
    • From this screen you should see the “ExcelRefreshWorkflow” item in the “Select a workflow template:” list. Select that item, complete the remaining configuration settings and click “OK”.
    • For each document desired, click on the document dropdown and select “Workflows”.
    • Click on the “ExcelRefreshWorkflow”
    • Setup the appropriate configuration settings and click the “Start Workflow” button.
    • NOTE: All activity related to the workflow (including the execution history) will be stored in the associated “Workflow History”.

Attached is a sample workflow that will open an Excel file in document library, refresh the data connection and save the file as a new version in the document library on a scheduled interval.

ExcelRefreshWorkflow.zip (422.11 kb)

Tags:

Sharepoint | Workflow Foundation

Deploying SharePoint Workflow Feature to Server Farm

by 11. January 2012 11:52

 

Assume you are trying to deploy the workflow feature to a sub-site:

(http://ServerNameHere/sites/SubSiteNameHere)

 

To setup the Visual Studio Solution, change the URL located in three areas:

1.       Project -> Site URL -> http://ServerNameHere/sites/SubSiteNameHere

2.       Web References -> ExcelWebService -> Web Reference URL -> http://ServerNameHere/sites/SubSiteNameHere/_vti_bin/excelservice.asmx

3.       Web References -> ListService -> Web Reference URL -> http://ServerNameHere/sites/SubSiteNameHere/_vti_bin/lists.asmx

 

When deploying the workflow feature on the server (either through Visual Studio right-click and “Deploy”; or, via Power Shell script shown below) I received the following error message:

 

Error occurred in deployment step 'Activate Features': Feature with Id '{GUID}' is not installed in this farm, and cannot be added to this scope.

 

Power Shell Deployment Script:

rem NOTE: Make sure the "Sharepoint 2010 Administration" service is NOT running.

rem We are using the execadmsvcjobs to execute rather than letting th Timer service run them.

 

rem ADDING...

cd "c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"

stsadm -o addsolution -filename "C:\VSS\ExcelRefreshWorkflow\bin\Debug\ExcelRefreshWorkflow.wsp"

stsadm -o deploysolution -name "ExcelRefreshWorkflow.wsp" -immediate -allowgacdeployment -allowcaspolicies

stsadm -o execadmsvcjobs

stsadm -o activatefeature -name "ExcelRefreshWorkflow_Feature1" -url http://ServerNameHere/sites/SubSiteNameHere

 

NOTE: This feature is being deployed to “Scope = Site”, not Farm, Web or Web Application scope.

 

If you are running a single server instance of Sharepoint this should not happen (i.e. your deployment should be completed successfully).  In the case of a Sharepoint server farm you will need to perform the following steps manually to complete the installation.

 

1.       From the “SharePoint 2010 Central Administration” site:

a.       Navigate to: “System Settings” -> “Manage farm solutions”

b.      Click on “excelrefreshworkflow.wsp”

c.       Click on “Deploy Solution” and complete the deployment screen (schedule or run immediately).

d.      Refresh the farm solutions screen until the solution management screen until the status column shows “Deployed” (note, the “Deployed To” column should show “Globally deployed.”).

e.      NOTE: Make sure the “SharePoint 2010 Timer” service is running; otherwise, this step will not complete.

2.       Open the normal SharePoint site and from the top level site:

a.       Navigate to: “Site Actions” -> “Site Settings” -> “Site Collection Administration” -> “Site collection features”

b.      Click the “Activate” button associated with the “ExcelRefreshWorkflow” item in the list.

c.       NOTE: Repeat this step on every sub-site that you want to use the workflow in.

3.       At this point the installation is complete.  You can now navigate to the sub-site and configure the workflow on the appropriate Library and activate it on the appropriate documents in the library.

a.       From the sub-site home page, navigate to: “Library Tools” -> “Library” -> “Library Settings” -> “Workflow Settings”.

b.      From this screen you should see the “ExcelRefreshWorkflow” item in the “Select a workflow template:” list.  Select that item, complete the remaining configuration settings and click “OK”.

c.       For each document desired, click on the document dropdown and select “Workflows”.

                                                   i.      Click on the “ExcelRefreshWorkflow”

                                                 ii.      Setup the appropriate configuration settings and click the “Start Workflow” button.

                                                iii.      NOTE: All activity related to the workflow (including the execution history) will be stored in the associated “Workflow History”.

Tags:

Sharepoint

SQL Server Get First and Last Day's of Previous, Current and Next Month

by 10. January 2012 09:55

 

select

  [First Day of Previous Month] =

  convert(varchar(25)

  , dateadd(dd, -(day(getdate())-1)

  , dateadd(mm, -1, getdate()))

  , 101)

, [Last Day of Previous Month] =

  convert(varchar(25)

  , dateadd(dd, -(day(getdate()))

  , getdate())

  ,101)

, [First Day of Current Month] =

  convert(varchar(25)

  , dateadd(dd, -(day(getdate())-1)

  , getdate())

  , 101)

, [Last Day of Current Month] =

  convert(varchar(25)

  , dateadd(dd, -(day(dateadd(mm, 1, getdate())))

  , dateadd(mm, 1, getdate()))

  , 101)

, [First Day of Next Month] =

  convert(varchar(25)

  , dateadd(dd, -(day(dateadd(mm, 1, getdate()))-1)

  , dateadd(mm, 1, getdate()))

  , 101)

, [Last Day of Next Month] =

  convert(varchar(25)

  , dateadd(dd, -(day(dateadd(mm, 1, getdate())))

  , dateadd(mm, 2, getdate()))

  , 101)

 

Tags:

SQL Server

ASP.Net Compile File System Website

by 6. January 2012 16:10

Below is an example of command program to compile an ASP.Net file system web using .Net framework v4 (the rem comment lines show the value for compiling as v2 as well).

rem v2.0.50727
rem v4.0.30319
set frmwk=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

set src=C:\vss\MyWebSiteFolder
set dest=C:\vss\MyCompiledWebSiteFolder

del /F /Q %dest%\*.*

%frmwk%\aspnet_compiler -v /VwdSite -p %src% %dest% -c

Tags:

ASP.Net

ASP.Net Compile File System Website

by 6. January 2012 15:53

Below is an example of command program to compile an ASP.Net file system web using .Net framework v4 (the rem comment lines show the value for compiling as v2 as well).

rem v2.0.50727
rem v4.0.30319
set frmwk=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

set src=C:\vss\MyWebSiteFolder
set dest=C:\vss\MyCompiledWebSiteFolder

del /F /Q %dest%\*.*

%frmwk%\aspnet_compiler -v /VwdSite -p %src% %dest% -c

Tags:

ASP.Net

Excel Calculated Cell Expecting 0 and Getting Scientific Exponential Notation Instead (e.g. 1.23E+10)

by 5. January 2012 14:38

When adding up several cells of positive and negative decimals (that total 0) I was instead getting a scientific exponential notation like 1.23E+10.  To solve this problem I changed the "Number Format" property on the calculated cell from "General" to "Number" with a fixed set of decimal places and the issue went away.

Tags:

Excel

CheckSum Utility

by 2. January 2012 16:32

Below is a C# implementation of two CheckSum utilities, the SHA256Managed uses the native .Net Security.Cryptography; while the Md5SumByProcess uses a windows implementation of Unix MD5Sum.exe (zip file attached to this blog can be downloaded from SourceForge at: http://sourceforge.net/projects/unxutils/files/unxutils/current/UnxUtils.zip/download). 

using System;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;

  class CheckSumUtil
  {
    public static string Md5SumByProcess(string file)
    {
      var p = new Process();
      p.StartInfo.FileName = "md5sum.exe";
      p.StartInfo.Arguments = file;
      p.StartInfo.UseShellExecute = false;
      p.StartInfo.RedirectStandardOutput = true;
      p.Start();
      p.WaitForExit();
      string output = p.StandardOutput.ReadToEnd();
      return output.Split(' ')[0].Substring(1).ToUpper();
    }

    public static string SHA256Managed(string file)
    {
      using(var stream = new BufferedStream(File.OpenRead(file), 1200000))
      {     
        SHA256Managed sha = new SHA256Managed();
        byte[] checksum = sha.ComputeHash(stream);
        return BitConverter.ToString(checksum).Replace("-", String.Empty);
      }
    }

  }
}

UnxUtils.zip (3.21 mb)

Tags:

C#

LINQ to Entities does not recognize the method 'System.String ToString(System.String)' method, and this method cannot be translated into a store expression.

by 27. December 2011 15:54

LINQ to Entities does not recognize the method 'System.String ToString(System.String)' method, and this method cannot be translated into a store expression.

One workaround for this is to convert the LINQ to Entities object to a LINQ to Objects object by adding .AsEnumerable() as in the sample below.

var qry = from itm in obj.Booksheets.AsEnumerable()
          where bks.Purchases.FirstOrDefault() == null
          select new
          {
            FormattedPrice = bks.WebPrice.ToString("#,###"),
          };

Tags:

LINQ | LINQ to Entities

Windows Automation Service to Refresh Excel Workbook Data and Email PDF Export

by 12. December 2011 08:33

This was built to refresh an Excel file that has pivot tables built agains SSAS cube, format the spreadsheet, export it to PDF and email the PDF file. 

IMPORTANT NOTE: See this blog entry for potential issue when running Excel Automation code inside of a Windows Service: http://blog.tutorem.com/post/2011/12/12/Excel-Automation-Issue-Access-File-When-Running-as-a-Windows-Service.aspx

using System;
using System.ComponentModel;
using System.Configuration;
using System.ServiceProcess;
using Microsoft.Office.Interop.Excel;

namespace AutomationService
{
  public partial class AutomationServiceInstance : ServiceBase
  {

    string path = @"C:\ExcelAutomation";
    // Go back one day so we run on start...
    DateTime lastRun = DateTime.Now.AddDays(-1);
    Application excel = new ApplicationClass();

    public AutomationServiceInstance()
    {
      InitializeComponent();
    }

    protected override void OnStart(string[] args)
    {
      System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
        , Char.ToString('\r') + Char.ToString('\n') 
        + "Starting service ... " + DateTime.Now.ToString());
      if(System.IO.File.Exists(path + @"\LastRun.txt"))
      {
        // If last run time file exists load the date/time
        lastRun = Convert.ToDateTime(
          System.IO.File.ReadAllText(path + @"\LastRun.txt").Trim());
      }
      BackgroundWorker wkr = new BackgroundWorker();
      wkr.DoWork += TimeCycle;
      wkr.RunWorkerAsync();
    }

    protected override void OnStop()
    {
      System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
        , Char.ToString('\r') + Char.ToString('\n')
        + "Stopping service ... " + DateTime.Now.ToString());
    }


    protected void TimeCycle(object sender, DoWorkEventArgs e)
    {
      excel.DisplayAlerts = false;
      do
      {
        if (!lastRun.DayOfYear.Equals(DateTime.Now.DayOfYear) 
          && DateTime.Now.TimeOfDay >= new TimeSpan(8,15,0)) ProcessIt();
        System.Threading.Thread.Sleep(60 * 1000);
      } while (true);
    }

    protected void ProcessIt()
    {
      try
      {
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "Begin processing ... " + DateTime.Now.ToString());
        string srcFile = path + @"\SourceFile.xlsx";
        string outFile = path + @"\OutputFile.pdf";
        Workbook wkb = excel.Workbooks.Open(srcFile, false, true);
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "     workbook open: " + DateTime.Now.ToString());
        wkb.EnableConnections();
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "     connections enabled: " + DateTime.Now.ToString());
        wkb.RefreshAll();
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "     workbook refreshed: " + DateTime.Now.ToString());
        Worksheet sht = wkb.Worksheets["Pipeline Totals"] as Worksheet;
        // Format column A to a fixed width
        sht.get_Range("A1").EntireColumn.ColumnWidth = 20;
        // Format columns B through Z to auto fit width
        sht.get_Range("B1", "Z1").EntireColumn.AutoFit();
        // Navigate to first cell
        sht.get_Range("A1").Select();
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "     formatting complete: " + DateTime.Now.ToString());
        sht.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF
          , outFile, Microsoft.Office.Interop.Excel.XlFixedFormatQuality.xlQualityStandard
          , true, false, Type.Missing, Type.Missing, false, Type.Missing);
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "     export complete: " + DateTime.Now.ToString());
        wkb.Close(false, Type.Missing, Type.Missing);
        excel.Quit();
        MailUtil.SendMail("sender@domain.com", "Sender Name"
          , ConfigurationManager.AppSettings["EmailDistributionListTo"]
          , ConfigurationManager.AppSettings["EmailDistributionListCC"]
          , ConfigurationManager.AppSettings["EmailDistributionListBCC"]
          , "Excel Automation Report", false, "", outFile);
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "     mail sent: " + DateTime.Now.ToString());
        sht = null;
        wkb = null;
        lastRun = DateTime.Now;
        System.IO.File.WriteAllText(path + @"\LastRun.txt", lastRun.ToString());
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "Processing complete ... " + DateTime.Now.ToString());
      }
      catch (Exception ex)
      {
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') 
          + "Exception occurred ... " + DateTime.Now.ToString());
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') + ex.Message);
        System.IO.File.AppendAllText(path + @"\AutomationServiceLog.txt"
          , Char.ToString('\r') + Char.ToString('\n') + ex.StackTrace);
      }
    }

  }
}

Tags:

C# | Excel

Excel Automation Issue Access File When Running as a Windows Service

by 12. December 2011 07:30

I wrote an Excel automation process that worked fine as a Console Application, then I converted it to a Windows Service and it would error out at the point of trying to open the file with the following file access error shown below. 

To see a copy of the complete Windows Service code view this blog entry: http://blog.tutorem.com/post/2011/12/12/Windows-Automation-Service-to-Refresh-Excel-Workbook-Data-and-Email-PDF-Export.aspx

--------------------------------------------------------------------------------------------------
SOURCE: Microsoft Office Excel
MESSAGE: Microsoft Office Excel cannot access the file 'C:\PathToFile\File.xlsx'.

There are several possible reasons:

• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
--------------------------------------------------------------------------------------------------

This did not make sense as nothing changed between the Console Application code and the Windows Service code.  So, I assumed it was a permission issue.  Tried all sorts of permissions tests with folders/file, as well as the windows service login account, etc.  Still no luck.  Then found a post with a simple solution shown below:

http://social.msdn.microsoft.com/For...?prof=required

For 64-bit (x64), create this folder:
C:\Windows\SysWOW64\config\systemprofile\Desktop

For 32-bit (x86), create this folder:
C:\Windows\System32\config\systemprofile\Desktop

Tags:

C# | Excel

CMD Script Backup Folders to Alternate Location with Dated Folder Structure

by 9. December 2011 23:52

CMD script to backup file folder (with sub-folders) to an alternate location with dated folder structure:

set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
echo hour=%hour%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
echo min=%min%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
echo secs=%secs%

set year=%date:~-4%
echo year=%year%
set month=%date:~4,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
echo month=%month%
set day=%date:~7,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%
echo day=%day%

set datetimef=%year%%month%%day%_%hour%%min%%secs%

echo datetimef=%datetimef%

mkdir d:\backup\d_inetpub_%datetimef%

xcopy d:\inetpub d:\backup\d_inetpub_%datetimef% /S /H /Y /C

Tags:

HP Photosmart C6100 All In One Printer/Scanner/Fax

by 28. November 2011 06:51

Tags:

SQL Date Manipulation

by 25. October 2011 09:35

Here is a query to get the previous quater:

select
  dateadd(qq, datediff(qq, 0, getdate())-1, 0) 
, dateadd(ms, -3, dateadd(qq, datediff(qq, 0, getdate()), 0))

Tags:

SQL Server

ASP.Net .ASMX WebService Invocation Test Page Remote Access

by 18. October 2011 07:32

The ASP.Net .ASMX webservice page comes with an automatic invocation test page for each of the available operations defined in the service.  By default the invocation is limited to the service running on a local machine (e.g. if you are running the service on your local machine and browse to it you can invoke it;).  However, if the service is running on a server and you browse from your local machine you will probably see this message "The test form is only available for requests from the local machine" in the spot where the invocation button would normally be.  To enable remote invocation, make sure to add the web config section shown below.

<configuration>
  <system.web>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
  </system.web>
</configuration>

Tags:

ASP.Net | Web Service

MDX Query in C#

by 17. October 2011 08:46

 

Requires the AdomdClient, which is included in Microsoft SQL Server 2008 Feature Pack, October 2008, found here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=228DE03F-3B5A-428A-923F-58A033D316E1&displaylang=en

Download "Microsoft ADOMD.NET " from the link above and after running msi file you will get
Microsoft.AnalysisServices.AdomdClient.dll under folder
C:\Program Files\Microsoft.NET\ADOMD.NET\100.

Tags:

C# | SSAS

ASP.Net Security Issue FormsAuthentication.Authenticate Always Returns false

by 14. October 2011 09:42

I was trying to create a custom authentication screen without using any of the standard ASP.Net security controls (i.e. Login control).  So, I created my custom form and was calling the System.Web.Security.FormsAuthentication.Authenticate(UserName, Password) method.  However, it was always returning false and in fact did not appear to even be hitting my SQL database (which contained the security) as the failed login attempts, etc. were all unaltered.  Furthermore, I changed my connection string to be a bogus reference and the Authenticate still simple returned false (I was expecting it to error).  I then found out that the System.Web.Security.FormsAuthentication.Authenticate(UserName, Password) method is for user information stored in the web.config file.  Instead, I used the System.Web.Security.Membership.ValidateUser(UserName, Password) method which is for the user information stored in the SQL database.

NOTE: When doing this I also then set the authorization cookie by calling:

System.Web.Security.FormsAuthentication.SetAuthCookie(UserName, true);

Here is some sample code:

static public string Login(string UserName, string Password)
{
  if (System.Web.Security.Membership.ValidateUser(UserName, Password))
  {
    System.Web.Security.FormsAuthentication.SetAuthCookie(UserName, true);
    return "1|" + DateTime.Now.ToString();
  }
  else
    return "0|Login failed!";
}

Tags:

ASP.Net | C#

Excel Number Format for Millions

by 12. October 2011 15:24

Here are a couple of custom number formats that allow formatting Excel for Millions.

Sample Number: 1,598,999

Use this format string: $#,##0.0,, ;[Red](#,##0.0,,);- ;

To display this: $1.6

Use this format string: $#,##0.0,,\M ;[Red](#,##0.0,,\M);- ;

To display this: $1.6M

Tags:

Excel

Sharepoint 2010 Registry Entries

by 5. October 2011 12:38

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\LauncherSettings\LoadBalancerUrl
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\c0e071e1-533e-457a-8a61-8a86a6b78dcd\Gather\Portal_Content\ContentSources\0\StartPages\0\URL
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\c0e071e1-533e-457a-8a61-8a86a6b78dcd\Gather\Portal_Content\ContentSources\0\StartPages\1\URL
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\c0e071e1-533e-457a-8a61-8a86a6b78dcd\ResourceManager\ (several entries)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Applications\fd2e5092-25e3-46cf-8fc6-d62c85334b3d\Gather\Search\ContentSources\0\StartPages\0\URL
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Applications\fd2e5092-25e3-46cf-8fc6-d62c85334b3d\ResourceManager\ (several entries)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB\dsn
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\CentralAdministrationURL

Tags:

Restart Machine via Remote Desktop Connection

by 5. October 2011 12:36

From Commandline: "shutdown /r /t 0"

Alternatively, CTRL+ALT+END on the keyboard to get the Windows screen where you have shutdown/restart options.

Tags:

Sharepoint 2010 Database Connection Strings in Registry

by 5. October 2011 08:28

I recently installed a new development environment on a virtual machine that was being used as the basis of a new virtual desktop pool for several developers.  My Sharepoint environment was broken once the virtual desktops were created because the installation put the machine name in the SQL connection strings and each of the virtual desktop instances has a unique machine name.  When I attempted to browse to the local sharepoint site I simply received the following error message: "Cannot connect to the configuration database.".  Researching the log file (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Logs\...) I saw the original machine name in the connection string of the failed connections.  Next I looked at the web.config of the root site as well as the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Config\web.config and was unable to find any connection information.  Finally, I found the following registry entries and changed them from the specific machine name to the "localhost" alias.  NOTE: The first entry is the database connection and the other entries are various URL's.

My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB\

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\LauncherSettings\LoadBalancerUrl

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\c0e071e1-533e-457a-8a61-8a86a6b78dcd\Gather\Portal_Content\ContentSources\0\StartPages\0\URL

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\c0e071e1-533e-457a-8a61-8a86a6b78dcd\Gather\Portal_Content\ContentSources\0\StartPages\1\URL

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\c0e071e1-533e-457a-8a61-8a86a6b78dcd\ResourceManager\ (several urls are located in this section)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Applications\fd2e5092-25e3-46cf-8fc6-d62c85334b3d\Gather\Search\ContentSources\0\StartPages\0\URL

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Applications\fd2e5092-25e3-46cf-8fc6-d62c85334b3d\ResourceManager\ (several urls are located in this section)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\CentralAdministrationURL

 

Tags:

Sharepoint