Showing posts from July, 2013

Fixed Width SharePoint

Fixed-Width SharePoint 2010 Master Page with Centered Content I have been working on a project to create a sharepoint site collection that looks like Adobe Labs, for announcing and displaying software products under development across the company. CSS CSS is the key here, the following will create the fixed width, centered, with scrollbars: html{background-color:#444444;overflow/**/:auto;} body.v4master {width:950px;margin:0px auto;overflow:visible;background-color: transparent !important;} .ms-dialog body.v4master {height: 100%;overflow: hidden;width: 100%;}   body #s4-workspace {left: 0;overflow: auto !important;overflow/**/: visible !important;position: relative;width: 100% !important;display:table;border-spacing:0px;} .ms-dialog body #s4-workspace{display:block !important;overflow/**/: auto !important;} CSS for the welcome text: .WelcomeArea {padding-top:6px;} .WelcomeText {color:#FFFFFF;font-size:11px;float:right;} CSS for the navigation

Connect SharePoint 2010 Search to File Shares

Use SharePoint Enterprise Search to Index and Query Windows File Shares 1.  I created a service account to use as the content access account.  Example: 2.  Ensure file types are correct. Note: By Default SharePoint search does not include all file types.  I ran a PowerShell command to query the set: Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchCrawlExtension | Sort-Object FileExtension Then I ran this command to add new file types: $FileExt     = "jpg" Get-SPEnterpriseSearchServiceApplication | New-SPEnterpriseSearchCrawlExtension -Name $FileExt 3.  Ensure the default content access account in Search has Share Permissions of: Read.  Security Permissions of: Read & execute, List folder contents, and Read. 4.  I created a new content source so that I can set a different schedule for indexing.  Our corporate file shares are very large so the indexing takes 160+ hours for an incremental.

Upgrade to SharePoint 2010 Service Pack 2

Service Pack 2 for SharePoint 2010 Time to do some testing on my development server prior to upgrading the production system.  I will be doing the In Place upgrade with no rollback.  This will require a server restart and interruption of services intermittently. First determine the version you need to install.  Technet doesn't expose all of the installs on their page, thankfully Todd Klindt keeps his SharePoint version page up to date. Install the SharePoint Server with Project Server installer (KB2687452). In my case owstimer.exe threw lots of errors with the Visual Studio Just-In-Time debugger popup. I click cancel on debugging for each error. Reboot server after install complete. Install the Office Web Apps installer (KB2687470). Again more owstimer.exe issues that I cancel through. Open Powershell and run this command: psconfig.exe -cmd upgrade -inplace b2b This fails the first time, I have rea

Read Current User with JavaScript and use in Button

Grab the currently Logged In User Using JavaScript The Javascript: Place this inside this section: <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server"> <script type="text/ecmascript">     var context = null;       var web = null;       var currentUser = null;       var currentUserId=''      function getUserData() { context = new SP.ClientContext.get_current();   web = context.get_web();   currentUser = web.get_currentUser();   currentUser.retrieve();   context.load(web);  context.executeQueryAsync(onSuccessMethod, onFailureMethod);        }                function onSuccessMethod()     { var userObject = web.get_currentUser(); var loginName = userObject.get_loginName(); var userAccount = loginName.replace("DOMAIN\\",""); var Url = ("https://[]?sso_key=[somekey]&user_name=" + userAccount + &

SQL Server Rename Database and Filenames

Rename a SQL Server Database and the Filenames to Match Many times I have a need to rename a SharePoint content database or a Team Foundation Server Team Project Collection database name in SQL Server.  The reasons vary, but usually it is because originally the naming of the database is horrible or the purpose of the data has changed and I want all of the references to it to be updated in all systems within the farm. SQL Commands: Detach Database using sp_detach_db --Note: Change MyDatabase to the database name you want to detach. USE [master] ALTER DATABASE [MyDatabase] SET SINGLE_USER WITH ROLLBACK IMMEDIATE   EXEC master.dbo.sp_detach_db @dbname = N'MyDatabase' Attach Database --Note: Change SqlAndMe to the database name you want to detach. USE [master] CREATE DATABASE [SqlAndMe] ON  ( FILENAME = N'C:\…\SqlAndMe.mdf'), ( FILENAME = N'C:\…\SqlAndMe_log.LDF') FOR ATTACH Rename Logical Filenames --Note: Change SqlA