Programmatically Get Disk Usage Of SPWeb Object In Sharepoint 2010 C# - sharepoint-2010

I am trying to figure out how to get the disk space used on a SharePoint Site(SPWeb). I have seen solutions that involve PowerShell or going through all of the libraries and iterating through all of the files to get the total size.
However, given the size of our SharePoint Sites, we can't iterate through all of the files. Also, we are unable to use PowerShell given the program we are trying to write.
Is there another way to get the disk space of a Sharepoint Site(SPWeb Object)?

Related

Visio Hyperlinks query

The users have documents in Sharepoint document library. I need to be able to get the urls of these documents easy within Visio. Would I need to write something in VBA which gets the urls of these documents from Sharepoint, or is there an easier option ?
I have looked at the net use command so they can map a drive but that does not give the url.
anyone done anything like this before ?
SharePoint exposes XML interfaces that you can use to determine elements in a table or items in a library (which is a known and static location in SharePoint).
What you can use and how you access it will depend on your version of SharePoint and how it is configured on your network. However, there are plenty of examples on the internet that you can search in your favourite search engine (Alta Vista anyone?) which will get you started with some code. I expect you will have some specific questions once you start coding.
It has been a while since I did this.

When to use the Registry

One of my VB.net applications started off to be fairly simple and (surprise) has grown significantly. I was using the Registry to save my limited number of settings, however that has now grown to where I felt I was abusing the Registry. I have converted most of my saved settings to XML files that have been working well. I would appreciate thoughts on saving the following to the Registry, I have been looking through threads on this and still am not sure if I should use files or the Registry:
Paths to the user settings files. Currently the application looks for an
XML file in a specific sub-folder of the users Documents folder for
an XML file containing the paths.
Window positions and sizes for forms (over 50 forms).
Licensing data (licensing per machine).
Application version.

Getting Search Server to ignore sharepoint document data, and speed up crawl times

Background:
I have a Sharepoint Foundation 2010 installation that is being used to store scanned images of paper documents, making an electronic version of paper file folders we keep for each of our company's Clients. All of the documents are all stored as PDF files.
The configuration includes a web-server housing Sharepoint and the Search Server 2010 Express service, as well as separate database server housing the content data as well as the search crawl store. Both the Sharepoint/Search box, and the SQL box are VMware VMs running on shared hosts (including a shared SAN) with our other production servers.
Each file added to sharepoint must be added through a custom interface, including metadata tags for client information (a site content type with a set of site columns defines this extra metadata). We then expose this client identifying data with the search server by setting Managed Properties so we can do queries against the search webservice specifying WHERE CustomClientID = X.
Our data currently resides in two large document libraries, one for each arm of the company.
After a few years of operation our server now has some 250,000 documents and we are having issues with full crawls (running weekly off hours) sometimes crashing part way through, and our incrementals (running every 5 min during work hours) take 7-8 minutes to pick up 2-3 new files.
Question:
I was wondering if there was a way to get the search server crawler to only pick up the metadata we are supplying and ignore the document contents entirely, which I assume would speed up the crawl process by orders of magnitude. I believe this feature is described as full text search, but have not been successful in finding anything that explains if this is something that can be turned off.
If not, is there an alternative option for speeding up crawl times that anyone would advise?

Sharepoint 2010 Subsite/Document Library/Lists Storage Data

Basically all I want to do is to get the total storage space of subsites, document libraries and lists within a site collection. There does not seem to be a possible way to do it besides:
using site.StorageManagementInformation which is currently Obsolete
SPSite.UsageInfo this can only work for site collection:
SPSite.UsageInfo usageInfo = spSite.Usage;
long storageUsed = usageInfo.Storage;
SPWeb.GetUsageData which only gets the current day(and up to the last 31 days) usage data.
finding the database table where Site Collection Administration > Storage Metrics is querying from (which I could not find even with using a .NET Reflector for the assembly)
If anyone has any other way or idea on how to achieve this it would be very much appreciated!
my suggestion is to try opening the site you are accessing via SharePoint Designer and right click any those collections then click properties. The size of the objects should be shown there as well. :)

Sharepoint Workspace 2010 Local Store Location

When setting up local synchronization with a Sharepoint 2010 site using Sharepoint Workspace, where are the local files stored? More importantly, how can I change the storage location?
There is a folder-like object created under username\Workspaces, but when checking the path in the explorer address bar, it shows simply username\Workspaces, unlike other folders that show as C:\Users\username\xxxx. Right clicking the folder only provides the option to open in new window - it can't even be deleted! There are no options for setting storage location within the Workspace application itself.
Using an SSD system drive, I don't have the space to put all this data on C:. Only part of my user profile has been relocated to other drives, so the default for new items is still C:. Without a knowledge of the real path where this is stored, I can't even use junction points to redirect.
Much web searching has revealed nothing on this subject. Your help is appreciated.
the data is stored within the users profile. I don't think taht you're able to relocated the synched database. The synchronized data isn't encrypted or password protected. So you should consider to activate profile encryption within your organization.
In addition to the location you aren't able to activate any kind of OOB protection for the local SQL CE which is responsible for storing the synched data!
The default location is %localappdata%\Microsoft\Office\14.0\OfficeFileCache.
The files in this location don't look like the actual files, and contain a lot of metadata.
Per Microsoft KB 2020636, you can change the location of the OfficeFileCache by adding an Expandable String Value named OfficeCacheLocation to registry subkey HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Internet with the new path. (This key is for Office 2010 only.)
In my organization, we reviewed the option of using Workspace for making files available offline, but in the end opted for a third party SharePoint add-on.
Since all of out users have Outlook and use it on daily basis, it made sense to have an Outlook sidebar available with all the users' relevant files. It also can synchronize a SharePoint library or folder and makes its items available offline using Microsoft Outlook, so we opted to use it instead of the OOB feature, which was too limited and had various security problems.
Just came across this and I think this will do the trick: How to change the default location of the Office 2010 Document Cache (NB: I haven't actually done it myself yet).
I don't have enough "reputation" on this site to post additional links, but if you search on the following, you can find more background:
OfficeFileCache Folder Size 3-4x Larger than Actual Content (SharePoint Workspace 2010)
Sharepoint Workspace Fills Hard Drive – WTF?