Wednesday, August 27, 2014

Setting up windows store account

I was tasked with creating a corporate account today and wanted to capture the steps required to get the account set up.

Basically you will need to do the following

1.) Sign up for an outlook account.
2.) Now sign into the windows dev center using the account you created.
You will  be asked to set the account up as a individual ($19) or corporate ($99).


This article from msdn describes the entire process in detail
http://msdn.microsoft.com/en-us/library/windows/apps/hh868184.aspx

Error 3355 Cannot connect to SQL Server. SQL Server not found.

Problem:
I ran into this issue due to a SQL being configured on a port other than 1433.
The configuration wizard kept failing with this error and this was even after
I had specified the correct path in the wizard to the SQL server.

Solution:
What was missing was the SQL alias on the WFE.
How do you get this?

1.) Open command prompt as administrator
2.) Type cliconfg
3.) Add server alias.


Thursday, August 14, 2014

Sharepoint 2010 Configuration Wizard error address is invalid or loopback address

I ran into this error due to the wizard not correctly creating the SharePoint_Config database.
This was due to the incorrect syntax on the first screen of the wizard.  The path you must use is


Server.FQDN\SQLServerInstance, Port

Example:
A sql instance dumpty running on server humpty running on port 2010 would be

humpty.xyz.com\dumpty, 2010




Source:
http://blogs.msdn.com/b/psssql/archive/2013/10/04/invalid-or-loopback-address-when-configuring-sharepoint-against-a-sql-server.aspx

Wednesday, August 13, 2014

SharePoint 2010/2013 Prequisites

New task today required me to grab the bits for a 2010 install. We are building out 2 Frontends and so I grabbed the MSDN bits. Next I was looking at the the whole update and prereq issue. This can be a real pain until I found this great project on Codeplex. The Autospsourcebuilder project does all this work for you.  You just get the powershell script and the SharePoint iso and go this script will create a slipstream installer for you.

Sample:

.\AutoSpSourceBuilder.pas1 -SourceLocation "d:\SP2010" -Destination "d:\SPSlipstream" -GetPrerequisites $true

The Script will prompt you for the name of the update which can be found at the sharepoint updates site.



Source:
  1. http://autospsourcebuilder.codeplex.com/
  2. List of all Cumulatives Updates

Powershell cannot be loaded because execution of scripts is disabled on this system.

Everytime I need to run a powershell script I forget to set the ExecutionPolicy

Set-ExecutionPolicy Unrestricted

This will let you run the script without the error. Be warned you do this at the risk of it not being from a trusted source.

Get-ExecutionPolicy

This will tell you what your current session is running at.

Source:
http://technet.microsoft.com/en-us/library/ee176949.aspx

Move Inetpub off of c drive

The inetpub folder is installed by default on the c drive. We often are asked to move this default folder onto an application drive (i.e. d, f, g drive). It is a convenient practice as it gets the files off of the c drive which can get clogged up with all kinds of system level files. Here is the script which will move an existing c:\inetpub install to the drive of your choice. Save it as inetpub.bat and then execute as c:\inetpub.bat f where f is the name of the target drive you want to run inetpub from. REM PLEASE BE AWARE: SERVICING (I.E. HOTFIXES AND SERVICE PACKS) WILL STILL REPLACE FILES REM IN THE ORIGINAL DIRECTORIES. THE LIKELIHOOD THAT FILES IN THE INETPUB DIRECTORIES HAVE REM TO BE REPLACED BY SERVICING IS LOW BUT FOR THIS REASON DELETING THE ORIGINAL DIRECTORIES REM IS NOT POSSIBLE. @echo off IF "%1" == "" goto err setlocal set MOVETO=%1:\ REM simple error handling if drive does not exist or argument is wrong IF NOT EXIST %MOVETO% goto err REM Backup IIS config before we start changing config to point to the new path %windir%\system32\inetsrv\appcmd add backup beforeRootMove REM Stop all IIS services iisreset /stop REM Copy all content REM /O - copy ACLs REM /E - copy sub directories including empty ones REM /I - assume destination is a directory REM /Q - quiet REM echo on, because user will be prompted if content already exists. echo on xcopy %systemdrive%\inetpub %MOVETO%inetpub /O /E /I /Q @echo off REM Move AppPool isolation directory reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d %MOVETO%inetpub\temp\appPools /f REM Move logfile directories %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"%MOVETO%inetpub\logs \FailedReqLogFiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.ftpServer.logFile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.ftpServer/log -centralLogFile.directory:"%MOVETO%inetpub\logs\logfiles" REM Move config history location, temporary files, the path for the Default Web Site and the custom error locations %windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:%MOVETO%inetpub\history %windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"%MOVETO%inetpub\temp\ASP Compiled Templates" %windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"%MOVETO%inetpub\temp\IIS Temporary Compressed Files" %windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:%MOVETO%inetpub\wwwroot %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:%MOVETO%inetpub\custerr REM Make sure Service Pack and Hotfix Installers know where the IIS root directories are reg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d %MOVETO%inetpub\wwwroot /f reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d %MOVETO%inetpub\ftproot /f REM Do the same for x64 directories if not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathWWWRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\wwwroot /f if not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathFTPRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\ftproot /f REM Restart all IIS services iisreset /start echo. echo. echo =============================================================================== echo Moved IIS7 root directory from %systemdrive%\ to %MOVETO%. echo. echo Please verify if the move worked. echo If something went wrong you can restore the old settings via echo "APPCMD restore backup beforeRootMove" echo and echo "REG delete HKLM\System\CurrentControlSet\Services\WAS\Parameters\ConfigIsolationPath" echo You also have to reset the PathWWWRoot and PathFTPRoot registry values echo in HKEY_LOCAL_MACHINE\Software\Microsoft\InetStp. echo =============================================================================== echo. echo. endlocal goto success REM error message if no argument or drive does not exist :err echo. echo New root drive letter required. echo Here an example how to move the IIS root to the F:\ drive: echo. echo MOVEIISROOT.BAT F echo. echo. :success

Tuesday, August 12, 2014

Adding listener to MessageBox ok button in Windows Phone

I was updating my phone application and needed to provide a response to a user prompt. This is called adding a listener to the message box. This is easily done by adding the following code block into the location where you will be running the messagebox. This SDK supported messagebox control only supports the OK and Cancel buttons. If you want more control then you will need to use the XNAFramework messagebox which supports more customization. Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBoxResult result = MessageBox.Show("Show next message?", "Question", MessageBoxButton.OKCancel); // code after user click if (result == MessageBoxResult.OK) MessageBox.Show("Yeah"); }); Source: http://stackoverflow.com/questions/21773730/adding-listener-to-messagebox-ok-button-in-windows-phone