Thursday, November 5, 2015

IIS: Can't change Host Name

I was trying to change ports on some IIS sites and was facing this issue:

I tried to select different certificates and found that only certificates starting with "*" would allow me to change the host name. Instead of changing the required certificates I simply used this command:

Basically: If you are not using a wildcard certificate, f.ex. you are using a SAN cert, than IIS will not allow to change any values, especially not the host name. In SharePoint you might stumble upon host names, f.ex. MySite tend to use those, and might run into this issue.

Tuesday, November 3, 2015

SharePoint 2013: The Managed Metadata Service or Connection is currently not available

So I got this error:
The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator.
I already tried a server reboot and an IIS reset, usually those worked like a charm. But not in this case. I also didn't want to rebuild the Managed Metadata Service.
I checked the WSS_ADMIN_WPG on my server just to see if my app pool account was part of this group. The account needs this group to be able to write on local files, directory, whatnot. After adding my app pool account to this group I ran a PowerShell cmdlet:
After this my Managed Metadata Service worked again.

Saturday, October 24, 2015

SharePoint 2013: Config Wizard doesn't recognize certain updates

I installed a couple of updates for SharePoint and tried to run the Config Wizard. Well, it didn't go so well, because some updates were missing on some servers, even after I installed them. I found this little PowerShell cmd:
Get-SPProduct -local
So, now: What does this do?
As far as I know, this will check the registry for required farm wide updates and also I think it is checking different MSI-Package Installation information. After that it will run a stored procedure on SQL Server which will update the product version. This might sound a bit sketchy, but if I find more detailed information out there I will link it below.
It is important to note that you can run this with "-local", to get only the information of the server you are on, but also without "-local" which will return the products installed on the farm.

Source: Technet
As promised: I found more information on that command -> The Magic of Get-SPProduct -Local by Trevor Seward

Thursday, October 22, 2015

Windows Server 2003 / 2008: Lack of sufficient buffer space or queue was full

So users had issues with connections to SharePoint 2010 on a Windows Server 2008. The only thing they were able to tell we was a Correlation ID, which still is the best starting point you can imagine. The log, of course, was a mess with errors, the most interesting was this one:
System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.)
And also:
SqlError: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.)' Source: '.Net SqlClient Data Provider' Number: 10055 State: 0 Class: 20 Procedure: '' LineNumber: 0 Server: ''

Also some issues with a connection string.
ConnectionString: 'Data Source=SERVERNAME\INSTANCE,PORT;Initial Catalog=DATABASE;Integrated Security=True;Enlist=False;Asynchronous Processing=False;Connect Timeout=15' ConnectionState: Closed ConnectionTimeout: 15

Now that we got that error: How do we fix it? And what went wrong?
First you have to take a look at the available dynamic ports:

The output will look something like this:
Depending on the system you are running and the amount of users you have to support, well: this might not be enough and will explain the errors above.
Let's fix this:

"start=" defines the first dynamicport that could be used. The "num=" defines the range, in my case I got 1000 Ports available, starting with 49152. That's a lot more and should allow more users to connect. If you still get the error, but not as often as you used to, just set the range higher, I think the range is up to 16384, because that's the range of dynamic, private and ephemeral ports.

As a little knowledge nugget: How to do this on Windows Server 2003 and older?
Go to the registry HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters, check if there is a "MaxUserPort" entry there. If not, create a DWORD, the standard value is 5000 (decimal) oder 0x1388 (hex), you can enter values up to 65534 (decimal). This will define the highest available TCP/IP port, starting with the first port 1024. So: "MaxUserPort" - 1024 = available dynamic ports.

Wednesday, July 22, 2015

SharePoint: Get, add and remove site collection administrators

I wrote 3 simple scripts to get, add or remove site collection administrators.

Get Site Collection Administrators:
This script will run through every site collection on a web application (as long as you have the permission for that) and store the list of all site collection administrators in a .txt.

Add Site Collection Administrators:
This script will add users from an array to all site collections as admins. The result will be stored in a .txt.

Remove Site Collection Administrators:
This script will remove admins from all site collections. The result will be stored in a .txt.

Tuesday, July 14, 2015

SharePoint: Activate alternate languages

This script will go through every site collection within a web app and it will activate other supported ui cultures if multi language is supported. To support multi language on all site collections just use line #19, this will activate multilingual support.
You only have to edit line #15 "$webApp = WEBAPP". Change "WEBAPP" to the actual web application you want to crawl through.

Monday, July 6, 2015

IIS: Change the Application Pool Identity

How do you change the identity? It's really easy:
Select your Application Pool und click on Advanced Settings:
After that, simply scroll to "Process Model". Here you can select a different account. You will also need the password for this account!

JavaScript, React, Node.js and NPM - What? How to get started

So I started to look a bit into React, keep in mind that I'm actually not that good when it comes to coding, but React sounded interesting. So why not? Well... Getting started isn't as easy as in jQuery for example. I will cover some hurdles I had while I was only trying to get something up and running. You know: Hello World and stuff.

There are a couple of things you need before you can get started, first of all of course you will need React. This will come with all the basics Facebook delivers. Simply download the "Starterkit".
Other things you might need is Node.js, it comes with NPM, which you also might need. Or to put it in another way: Install Node.js to get NPM. Download the .msi if you want to use Node.js under Windows. After this is done, simply get the React tool with this command in your command-line:
npm install -g react-tools
Fun fact: You will run into some issues if you have a (corporate) proxy, but this can be solved via:
npm config set proxy
npm config set https-proxy
As I said I'm just starting with this and found those links interesting:

I'll take a further look into this and might write a little tutorial for anything interesting.

Monday, June 8, 2015

AWS: Copy all files from S3 Bucket to Instance / Destination

I was facing a small problem: How to get files from a S3 Bucket into my instance to install software. I did the same thing, I always do and wrote a PowerShell script:

You can also find the link in my Github repository: Link.

Wednesday, April 29, 2015

SharePoint 2013, SQL 2014 & PerformancePoint: Could not load file or assembly 'Microsoft.AnalysisServices.SharePoint.Integration, Version='

So I got this shiny error when trying to connect via Dashboard Designer to an Excel file, which also includes a data connection to a SQL server:

The Unattended Service Account "" does not have access to the server specified by the data source connection string.

Data source location:
Data source name:

Exception details:
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A connection cannot be made. Ensure that the server is running. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AnalysisServices.SharePoint.Integration, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.WCFConnect(String dataSource, String dataSourceVersion, String& timeLastModified, String& databaseId, String& databaseName, String& loginName, String& serverEndpointAddress)
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenWcfConnection(ConnectionInfo connectionInfo)
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)
--- End of inner exception stack trace ---
at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect(Boolean toIXMLA)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open()
at Microsoft.PerformancePoint.Scorecards.DataSourceProviders.AdomdConnectionPool`1.c__DisplayClass4.b__2()
at Microsoft.SharePoint.SPSecurity.c__DisplayClass5.b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.PerformancePoint.Scorecards.DataSourceProviders.AdomdConnectionPool`1.GetConnection(String connectionString, ConnectionContext connectionCtx, String effectiveUserName, CultureInfo culture, NewConnectionHandler newConnectionHandler, TestConnectionHandler testConnectionHandler, String targetAppId)

But how do you fix something like this?
Well, in this case it was pretty easy because the error message is clear about what is missing. SharePoint tries to use an older version of "Microsoft.AnalysisServices.SharePoint.Integration", in this case, which is the SQL Server 2008 R2 version (I think). All you have to do is change the needed version in the web.config under "C:\Program Files\Microsoft Office Servers\15.0\WebServices\PpsMonitoringServer".
At the end of the file you should find something like that:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Microsoft.AnalysisServices.AdomdClient" culture="neutral" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="" newVersion="" />

For SQL Server 2012 change it to something like this:

For SQL Server 2014 change "<bindingRedirect oldVersion="" newVersion="" />" to this "<bindingRedirect oldVersion="" newVersion="" />".

Tuesday, March 31, 2015

SharePoint: Remove User from Site Collection

That's an easy one. I wanted to remove a certain User from a SC, because it seems that the profile didn't get an update.

1) Head over to Site Permissions
2) Choose any group you want, click on it. The address is something like /_layouts/people.aspx?MembershipGroupID=1
3) Change the ID to 0

Now you will see a list of all Users in that particular SC. You can now remove the Users.

Thursday, March 26, 2015

Sharepoint: Get a list of all Site Collections & Libraries

Here's a little script which will help you get every Site Collection in a WebApp.
It will also go through every Web you have in a Site Collection and give you a summary of the found document libraries at the end.
You will also get a transcript stored in the same directory as the script is started from.
The filename is the title of your WebApp.

Friday, March 6, 2015

AWS: Get all running instances across all regions

I got something new and shiny to play with: Amazon Web Services, or AWS. I made a little script on how to get every running instance in every region. I think it might be usefull if you got a lot of systems in different regions. This script will only show you the running instances. You would have to add another line to automatically shut them down.
You will need the AWS Tools for PowerShell to run this script.