Change the global SharePoint 2013 Label

Hi All,

Something I find very useful when working with clients is to help them distinguish each environment between development (DEV), testing (TEST), Staging (STAGE) and Production (PROD). Some clients may have even more environments.  Lets take a look at the change in the UI first…

This is the Out of the Box label (Before):

SharePoint Label Out of the Box

 

This is the customized label (After):

SharePoint Label modified

 

So how do we do it, we use PowerShell to change the label at the web application level:

Add-PSSnapin *share*
$webapp = Get-SPWebApplication http://bcdevsp2013
$webapp.SuiteBarBrandingElementHtml = “SharePoint DEV”;
$webapp.Update();

I hope this comes in handy.  It is a subtle thing, but very helpful throughout the application lifecycle.

Cheers,

Brian

PS – Happy New Years to everyone.

Add Farm Administrator via Powershell

I cant say how many times I’ve had to add myself or another account as a Farm Administrator, and I keep misplacing my scripts.  So lets try my blog, and now it helpful to everyone 🙂

Adding a user to the “Farm Administrators” group effectively will add you to the local machine group WSS_ADMIN_WPG on every server of the SharePoint farm and assigns the SharePoint_Shell_Access role in the SharePoint Configuration database and the Central Administration database.

#################################################
# Add a new Farm Administrator
#################################################
Add-PSSnapin *SharePoint* -erroraction SilentlyContinue
Write-Host
$newFarmAdmin = Read-Host -Prompt 'Enter the new Farm Administrator (i.e. DOMAIN\Username): '
Write-Host
$webApp = Get-SPWebApplication -IncludeCentralAdministration | where-object {$_.DisplayName -eq "SharePoint Central Administration v4"}
$site = $webApp.Sites[0];
$Web = $site.RootWeb;
$farmAdministrators = $web.SiteGroups["Farm Administrators"];
try {
   $farmAdministrators.AddUser($newFarmAdmin, "", $newFarmAdmin, "");
   $contentDB = Get-SPContentDatabase -WebApplication $webApp
   Add-SPShellAdmin -Database $contentDB -Username $newFarmAdmin
   Write-Host "Completed Succesfully!"
} catch {
   Write-Host 'Error: Failed to add user.' -ForegroundColor Red
   Write-Host ('Reason: ' + $_)  -ForegroundColor Red
}
$web.Dispose();
$site.Dispose();

Cheers!