Using PowerShell to set ULS logging level to “extra verbose” to catch all the events in the logs

Stock photo from pixabay.com

This blog post describes how set the SharePoint’s ULS level to “Extra Verbose” (VerboseEx) using PowerShell. This is not possible using the browser UI.

Description of the solution

By default, ULS logging is somewhat non-detailed, and a lot of data that could be used to debug issues is omitted. The UI cannot be used to set this level of logging – it is limited to verbose. In case you really, REALLY need to get all the data logged to ULS, you can use PowerShell to enable verboseex -level tracing, using the following command:

Beware, though: this will generate a lot of data, and it’s likely you won’t be able to do anything with the log files using notepad++ or similar tool, as a single file can be hundreds of megabytes, and handling that might get a little tricky.

You can always reset this setting to default (medium-level tracing) by running the following command:

 

More info about the trace levels:

Powershell Error: Cannot uninstall the LanguagePack 0 because it is not deployed.

Powershell: languagepack 0

Thi s post offers a solution to the very non-descriptive SharePoint error message “Cannot uninstall the LanguagePack 0 because it is not deployed”, which might appear while trying to update a wsp solution.

Symptoms

Assume you’re trying to install, update or uninstall a SharePoint solution (.wsp package) using PowerShell-commands Install-SPSolution, Update-SPSolution or Uninstall-SPSolution (respectively). Operation fails with the following (or similar) error:

I have actually seen this also in the form of “Cannot uninstall Language Pack 0 because it is not deployed”, but I think the other form of the error is the one that pops up in the PowerShell.

Powershell: languagepack 0

In Central Admin the solution is in Error state.

151117_ca

Solution

You can find quite a lot of solutions online, but they weren’t really working for me. I tried restarting services, removing the package and meddling with the dll-files, but to no avail. However, the actual “last operation details” on the CA page hinted that the problem was in fact in one of the features. The feature in question included some content types, and toying around with them is like playing baseball with hand grenades, so you have to tread carefully in cases like these.

Continue reading

Quickest way to download all the wsp-packages in a SharePoint farm

PowerShell logo

Downloading all deployed farm solutions (wsp-packages) from a SharePoint farm is pretty simple using PowerShell. No need to download individual packages through cumbersome interfaces!

Solution

Got this one from the cool guys at C-Sharp Corner.

Programmatically creating SPFields with readable internal names

SharePoint Field Name Problems

This post is about a small programmatic workaround to creating new SPFields for SPLists in SharePoint with human-readable internal names. This is mainly an usability improvement for your editors, but they’ll probably appreciate it!

Problem: non-readable internal names for SharePoint list fields

When you create a new field on SharePoint, SharePoint accepts the following syntax:

However, this will result in the internal name to be something like “Field_x0020_name_x0020__x002d__x” which is hardly readable, but rather quite horrible to look at, or use anywhere at all.

Luckily, there’s a nice and straightforward way to solve this issue and produce nice and readable internal names for SharePoint list fields!

Solution

If you need to get readable internal names (like when your editors actually use the internal names for something) for your fields, you can use a code similar to this:

Continue reading

SharePoint Windows Authentication fails on other addresses than localhost

SharePoint Authentication prompt

This post describes how to fix Windows Authentication on a SharePoint server failing on other addresses than localhost.

Symptoms

You get the standard Windows/Basic Authentication prompt when accessing your SharePoint site, but the site won’t accept your credentials when your accessing the site using an address like http://website. However, using address like http://localhost works fine (but of course may cause other problems).

You also get event log entries like this (most likely in System -category):

The program w3wp.exe, with the assigned process ID, could not authenticate locally by using the target name HTTP/WEBSITENAME.

Continue reading