PowerShell Profiles and Processor Architectures

I’m using PowerShell profiles quite extensively, especially because I’m typically working on several (virtual) machines and profiles are definitely easy to keep settings in sync.

Profiles are independent from the Processor Architecture, which means that you should be careful when loading snap-ins or invoking features that rely on a specific architecture.

One way to ensure that your profile scripts run smoothly on both x86 and x64 processes is to apply conditional logics based on the PROCESSOR_ARCHITECTURE environment variable ($env:PROCESSOR_ARCHITECTURE).

I would suggest you to perform this check even if you think that you will only be executing scripts with the x64 Shell.

You may think “no, I’ll never be using the x86 version of PowerShell”… you’re probably right, until you try to launch a script from within the Visual Studio IDE 🙁

Uffa

Moving SharePoint 2013 databases – Issue with different SQL Server Editions

If you are a SharePoint Administrator it’s possible that sometimes you need to move all SharePoint database (i.e. the configuration database, the content databases, the service application databases, etc.) to a completely different SQL Server box.

Well, it’s not something that you do on a daily basis, but you may need to perform this task in at least a couple of circumstances:

  • You are revamping the infrastructure and you have a super-powerful, brand new SQL Server cluster
  • You are performing a SQL Server consolidation (reducing the number of servers/instances)
  • You need to replicate a production environment back into the staging farm (sometimes the opposite is possible as well)

The technique is definitely feasible and is well documented in a number of places (see, for example, this page on Technet: http://technet.microsoft.com/en-us/library/cc512725.aspx).

In a nutshell, you use SQL aliases as a way of indirection.

SharePoint does not resolve the SQL instance by IP address or servername/port, but through a generic name (the alias).

You can modify the alias so that the connection is redirected to another instance, without affecting the SharePoint configuration (a part from the service interruption, of course).

That said (and coming back to the reason for this post) pay a lot of attention to the Edition of your SQL Server Box, even if you have the very same level of upgrades at the source and the target (for example, you move the databases from a SQL Server 2008 R2 + sp1 box to another SQL Server 2008 R2 + sp1 box).

SharePoint does not require the Enteprise Edition of SQL Server, but it leverages Enterpise features if these features are available!!

So if you are trying to move a database from Enterprise to Standard, you may be lucky or not according to whether any enterprise specific configuration has been applied.

Just to make an example, SQL Server Enterprise supports data compression for tables and indexes.

Some SharePoint databases make use of data compression, if it is available (for example, I verified this on the Links Store db used by the Search Service Application on a SP2013 farm).

You can revert to an uncompressed database (table/index), but I guess you will end up completely out of support (you are modifying a database directly).

So… be careful and always perform all verifications beforehand J

SEO Toolkit and disk usage

Short introduction, for those of you who do not know the SEO Toolkit.

In a nutshell, it’s the Search Engine Optimization toolkit that you can download and install over your IIS setup.

It adds a new feature that allows you to run a spider over a web site (typicaly, a public, anonymous site, although the tool is not limited to anonymous authentication) and get back a ton of results.

The tool itself is able to read these results, aggregate them and provide you some report.

You get reports about SEO rules that are not fulfilled (pages without the title tag, images without the alt attribute, and several other, sometimes complex rules).

You also get reports about pages performance (which page/resource took more time to be downloaded?)

You get tons, tons of interesting stuff in the form of reports.

But nothing comes for free.

I was running out of disk space a couple of days ago on one of my development machines, I tried to find out where the causes reside, and… bingo! I had 19 GB (19,000+ MB, yes) occupied by the SEO Toolkit results.

Wooooo!

TreeSize – A useful tool for reporting and statistics about File System Usage

Some days ago a stumbled upon this tool: http://www.jam-software.com/treesize/

A free version is available for download, with limited capabilities.

The commercial version adds more powerful reporting features as well as allows connecting and getting information from a network share.

You can perform several type of analysis, and get back an output in different formats (Excel, Csv, Html, etc…)

I strongly encourage you to give it a try.

I’m using it mainly in two different scenarios.

First and foremost, which may seem obvious, when I need to free some disk space (I always run out of disk space…).

Then, and this is happening more and more frequently, as a way to discover permissions and storage usage on shared drives and folders.

Cool 🙂