if you want to administer your farm using PowerShell but don’t want to log on using the farm account all the time, then, starting the you might encounter the following error:
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
This occurs even when you right click the Management Shell’s icon and run it using “Run as Administrator”. There is a way of getting past this, and the solution is quick.
You need to run the “runas” command from cmd.exe, specifying an account with sufficient rights. You should use the following flags:
- /user:yourdomain\youruser (specification of the correct account)
- /savecred (ensures you only have to enter the password once)
The part with specifying the .ps1 file, which is located in the hive folder, is a bit tricky: Since it contains whitespaces in the most cases (C:\Program Files), you need to quote it the right way so runas, and subsequently PowerShell.exe can find the sharepoint.ps1 registration script. The full command looks like this:
runas /user:yourdomain\youruser /savecred "C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1^’"
As usual, before running any script, evaluate well. The script will not run unless you modify and adapt it to your needs. Do always execute on a test environment first in order to avoid unwanted side effects. I will not take responsibility for any damages done to your environments, be it developer’s, testing or productive environments.
Link to Script:
You can download the script from SkyDrive, contained in a zip file. It is better than copying from a website, where the quotes are always messed up.
Hope this was of help!
Posted in Automation, Configuration, PowerShell, SharePoint 2010, tips | Tagged 14, Accessibility, Administration, Administrator, farm account, FeatureDependencyId, hive, local famr is not accessible, registration, rights management, runas cmd.exe SharePoint Management Shell, savecred, Script, sharepoint.ps1, user | 1 Comment »
it’s a celebration day: angler.wordpress.com has reached a 50,000 hits!
It’s about time to say thanks to all of you out there!
Numbers are still increasing, and currently we have about 3,000 views per month on average.
We will continue to contribute as much as we can about SharePoint Server!
Posted in News, Opinion, SharePoint 2010, tips | Tagged 50000, angler.wordpress.com, celebration, hits, jubilee, page views, SharePoint 2010, thanks | 2 Comments »
For teamsites and collaborations, sometimes it can be useful to upload big file size documents – which is allowed only partially by SharePoint and IIS. They both have different default settings for the maximum upload file size of a single document or file. They are:
- SharePoint Server 2010: 50 MB
- IIS7: ~30 MB
So, when trying to upload a big document, this results in the following error:
85 MB is simply too much for the above mentioned settings. Now, the solution section will show you how to fix this.
The good news is: This can be custom tailored to your needs, by simply following 3 steps. Here comes the first step:
1. Increase the SharePoint Upload Limit via Central Administration
First, you must increase the SharePoint 2010 upload limit.
- Central Administration
- “Manage Web Applications”
- Select desired web application row (don’t click on the title, just select)
- “General Settings” in the ribbon
- Under Maximum Upload Size, change the setting to the desired value (e.g. 200 MB in our example)
Now, the web app is equipped for receiving large files, but IIS7 will still prohibit it, resulting in the same error message as above. So, let’s move on to step 2.
2. Increase the IIS7 request length
Use the following command on the machine you are running the IIS 7:
%windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:valueInBytes
In our case, we’ll simply put 200x1024x1024=209715200 bytes.
You will receive a confirmation message after applying the command. Please bear in mind that you will need to run the cmd.exe in administrator mode.
3. Increase the IIS7 connection timeout length (optional)
One more thing to keep in mind is the connection timeout settings: When you upload large files, depending on your connection speed it can happen that the connection times out. If you want, you can increase the connection timeout to a larger value. The standard is 120 seconds. This step is optional, but can become required if you have users with low speed internet connections.
- Open IIS
- Select the Web Application
- Click on Advanced Settings
- Expand Connection Limits
- Set the new value for Connection Time-out (seconds)
This is it – all done!
You users will now be able to upload larger files:
As usual, test any commands, configuration and settings on a test environment before applying them in production. Applying request lengths bears also some security implications to keep in mind. Use any advices and configurations at your own risk and evaluate risks before applying them.
Have a nice day and best regards!
Posted in Configuration, SharePoint 2010, tips, Troublshooting, Tutorial, Web Application | Tagged appcmd.exe, Central Administration, File size limit, General Settings, IIS, IIS 7, increase, Internet Information Systems, Manage Web Applications, Request, SharePoint 2010, SharePoint Server 2010, Upload | 7 Comments »
I encountered a problem during the installation of the prerequisites of SharePoint 2010 Enterprise. The installation of KB976462 failed, and so would eventually the whole prerequisites installer. The error message pointed me to the log file.
Here is an excerpt from the installation log:
2012-01-11 16:07:21 – Beginning download of Hotfix for Microsoft Windows (KB976462)
2012-01-11 16:07:21 – http://go.microsoft.com/fwlink/?LinkID=166369
2012-01-11 16:07:23 – Size of download of "Hotfix for Microsoft Windows (KB976462)" in bytes is "4331740"
2012-01-11 16:07:23 – Download of "Hotfix for Microsoft Windows (KB976462)" completed successfully
2012-01-11 16:07:23 – Installing Hotfix for Microsoft Windows (KB976462)
2012-01-11 16:07:23 – "C:\Windows\system32\wusa.exe" "C:\Users\xxx~1\AppData\Local\Temp\KB926A2.tmp.msu" /quiet /norestart
2012-01-11 16:07:26 – Install process returned (-2145124329)
2012-01-11 16:07:26 – [In HRESULT format] (-2145124329)
2012-01-11 16:07:26 – Last return code (-2145124329)
2012-01-11 16:07:26 – Error: The tool was unable to install Hotfix for Microsoft Windows (KB976462).
2012-01-11 16:07:26 – Last return code (-2145124329)
2012-01-11 16:07:26 – Options for further diagnostics: 1. Look up the return code value 2. Download the prerequisite manually and verify size downloaded by the prerequisite installer. 3. Install the prerequisite manually from the given location without any command line options.
2012-01-11 16:07:26 – Cannot retry
So, the solution is quite simple: You must download, extract and install the hotfix manually. The following 3 steps show how it works:
1. Download the KB976462 manually from here:
Choose the “x64” version of the msu file. Save it to a local directory: I used here C:\Installation\KB976462.
2. Open a command prompt and expand the msu file (make sure you open cmd with administrator rights)
expand -f:* "C:\Installation\KB976462\Windows6.1-KB976462-v2-x64.msu" %TEMP%
3. install using:
All done! Re-run the prerequisites installer – it should finish with success, as expected.
Hope this was of some help!
Thanks and best regards,
Posted in Configuration, Installation, Installation, SharePoint 2010, tips, Troublshooting | Tagged Administrator, cmd, command prompt, error, Hotfix, Installation Log, KB976472, Log, microsoft, msdn, Prerequisite Installer, Prerequisites, SharePoint 2010, SharePoint Shared Services Roll-up, Windows6.1-KB976462, x64 | 13 Comments »
if you are searching for the already installed MOSS 2007 language packs and don’t know where to find them, open the Registry Editor and search for the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\InstalledLanguages
It will give you a list with the installed languages, providing the corresponding LCIDs (e.g. 1033 for “English”).
Fig. 1: RegEd reporting three installed language packs for MOSS 2007.
Make sure not to change any settings in this place, as MOSS 2007 will manipulate these settings automatically upon installation/uninstallation of a language pack.
Enjoy and have a good time!
Posted in Customization, MOSS 2007, tips, Tutorial, Upgrade | Tagged 1031, 1033, 1040, InstalledLanguages, Language Pack, LCID, microsoft, MOSS 2007, Registry Editor, SharePoint 2007, Web Server Extensions | 1 Comment »
UPDATED: Find the new Youtube Link below!
episode 4 of SP5 is ready! This time it is dealing with the topic of moving site collections from one content database to another. Click below to watch the video (UPDATED):
Remark: If you want to create a new site collection using a specific content database, you need to use PowerShell, specifically the New-SPSite cmdlet:
New-SPSite –ContentDatabase <DBName>
This cannot be done from within Central Administration.
The involved cmdlets are:
Get-SPSite (lists site collections)
Get-SPContentDatabase (list content databases)
Move-SPSite (list content databases)
New-SPSite (create new site collection, specify content DB)
Important: After moving a site collection from one content DB to another, an iisreset is required. Be aware that this will cause a service disruption for some time (depending on your server’s configuration). Be sure to execute this only if you are fully aware that this will cause all websites to be inaccessible for some time.
Disclaimer: All tutorials are provided as is. You are responsible for any changes undergoing your system that derive from following this tutorial. It is hence recommended to consult your administrators and verify that the changes cannot harm your IT environment in any way.
Stay tuned till the next time!
Posted in Automation, PowerShell, Productivity, SharePoint 2010, SharePointFive, Snippet, tips, Tutorial | Tagged cmdlet, get-spsite, Move-SPSite, new-spsite, PowerShell, SharePointFive, site collection, URL | 3 Comments »