Tampilkan postingan dengan label SharePoint. Tampilkan semua postingan
Tampilkan postingan dengan label SharePoint. Tampilkan semua postingan

29 Agu 2022

Why SharePoint Can't Be Hosted on Azure App Service?

I've been working with SharePoint in more than half of my entire career since SharePoint 2003, that is now after the Online version is getting more recognized by organizations, sometimes we get questions from those who are very much expert in the on-premises version but unaware of the features of Online one. This is understandable because some organizations still want to keep their data on-premises and possibly not ready to move to the cloud becoming unaware of Microsoft cloud environment.

Now, a question in particular was about whether or not SharePoint can be migrated to Azure App Service, and if not, is there any particular documentation from Microsoft that clearly states that it can't be done.

This post hope to help anyone trying to understand why it can’t be done, in my personal opinion.

I did my little research - which I know it can't be done - to find any explicit statement from Microsoft docs that says so. Unfortunately, as I thought before, I couldn't find any. Or maybe somewhere under the rock. Okay, so I have to explain on what is Azure App Service and what are needed in order to run SharePoint any where.

In a nutshell, SharePoint can’t run on Azure App Service because of the complex services it serves, as most of these services aren’t just simply HTTP just like a web application/web service.

Azure App Service essentially is exactly the same like your typical web application sitting in your IIS in Windows Server or Apache in Linux. It serves files stored under IIS folder such as HTML, JavaScript, or compiled .NET code as DLL to be served via HTTP/S protocol. From the infrastructure perspective, Azure App Service basically same like your Windows Server, or Linux. One big advantage of using the App Service is that you don’t need to care the server configuration, setting up join domain, authentication provider, ports, so you can focus on building the application you like and serve it directly. Just like staying in a hotel, you just come, pay, and lie down literally.

Of course come to the disadvantage, you can’t roam freely to the kitchen where the chefs work, you can’t force the hotel appearance and ambience you like, or sleeping in the reception area much like your living room, much towards altering the entire hotel itself. App Service doesn’t allow you to install Window Service, dictate how many IIS sites you need to add, or connect to other servers you want. Your space is only that little tiny folder assigned to you via Azure App Service.

To take on the same analogy, SharePoint on the other hand, is not just you moving in but also your furniture, electronics, appliances, cupboard, and kitchen area that has a very specific requirements to operate it.

For instance, SharePoint User Profiles that is used to crawl users in your Active Directory, Timer Jobs that runs essential scheduled job for SharePoint, not to mention SharePoint Search to crawl the content of this SharePoint. These are under Window Service and served via particular ports and consumed by other SharePoint servers in the same farm.

For SharePoint SQL Server database however, you have the option to use Azure SQL Managed Instance (MI), with caveats. Forget about Azure SQL MI if your SharePoint farm was configured using Windows Authentication, but you can if it’s SQL Authentication. I saw some articles too that you can convert SharePoint database from Windows authentication to SQL, but let’s not talk about this for now.

What’s feasible then if you ask? SharePoint on Azure is the answer, not via App Service but the traditional Virtual Machine (VM). Lift and shift, load your existing VM to Azure (require downtime), then set your networking properly and make sure the servers can communicate each other, and ensure connection to Domain Controller is also established.

With this explanation, you will not get any complain from the hotel for bringing your own fridge and kitchen appliances down to hotel because you can’t do so. 😉

References:

13 Jun 2017

PowerShell Script: Upload Large File to SharePoint in Chunks

Get back to the business again! Just wanted to share another great things in SharePoint (although to user is not fun at all).

According to MSDN, there are a few options to upload files to SharePoint.

3 Apr 2017

SharePoint CAML Query through jQuery

I was just digging into my code snippet, and I thought this worth to share. I got the sample code where we can query using CAML in jQuery.

After a few tests, it’s still valid to be used. Here it is!


var DocLibName = "Shared Documents";
var camlQry = 
	"<View Scope='RecursiveAll'>" +
		"<Query>" +
			"<Where>" +
				"<And>" +
					"<Leq>" +
						"<FieldRef Name='Created'/>" +
						"<Value Type='DateTime'><Today /></Value>" +
					"</Leq>" +
					"<Eq>" +
						"<FieldRef Name='FSObjType'/>" +
						"<Value Type='Integer'>0</Value>" +
					"</Eq>" +
				"</And>" + 
			"</Where>" +
		"</Query>" +
	"</View>";
var requestData = { "query" :
	{ "__metadata" :
		{ "type" : "SP.CamlQuery" },
		"ViewXml" : camlQry
	}
};
$.ajax({
	url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('" + DocLibName + "')/GetItems?$expand=FieldValuesAsText",
	method: "POST",
	async: false,
	data: JSON.stringify(requestData),
	headers: {
		"X-RequestDigest": $("#__REQUESTDIGEST").val(),
		"Accept": "application/json; odata=verbose",
		"Content-Type": "application/json; odata=verbose"
	},
	success : function(d) {
		$.each(d.d.results, function (iRow, vRow) {
			//do your own processing here
		});
	}, error : function(a, b, c) {
		console.log(a);
		console.log(b);
		console.log(c);
	}
});

Enjoy!

22 Mar 2017

PowerShell Script to Iterate All Documents (including sub-folders)

Seems like I want to dump again an old script to you. This PowerShell Script is commonly used to list down all documents in the Document Library regardless of their location, whether it’s in the root or sub-folders.

No need to explain in detail again, here’s the script.

Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.WorkflowServices.dll"
$Siteurl = "https://consotoayam.com/sites/EPRG" #you can replace this url with your own
$ListName = "Shared Documents" #replace this with your own Document Library name
$credential = Get-Credential #to prompt for credential

if ($SiteUrl -ne $null)
{
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
    if ($ctx -ne $null)
    {
        $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credential.UserName, $credential.Password)

        $st = $ctx.Site
        $wb = $ctx.Web
        $DocsLib = $wb.Lists.GetByTitle($ListName)

        $q = New-Object Microsoft.SharePoint.Client.CamlQuery
        $q.ViewXml = '0'

        $items = $DocsLib.GetItems($q)
        $ctx.Load($st)
        $ctx.Load($wb)
        $ctx.Load($DocsLib)
        $ctx.Load($items)
        $ctx.ExecuteQuery()
        foreach($item in $items)
        {
	    #if necessary, you can load the item
            $ctx.Load($item)
            $ctx.ExecuteQuery()
        }
    }
}

Enjoy!


19 Agu 2016

Simple Workaround for Content Editor Webpart in Another Site Collection

Guess what? You have created a HTML script stored somewhere in SharePoint, and you want to use it somewhere in another Site Collection. But you are stuck with this error, “Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator”.

image

There are a few workarounds you can try.

Using Page Viewer or IFRAME

To use the page viewer, the solution is quite straight-forward and can be described in a few sentences.

Firstly, you know that you have created the HTML script, now create a page in the same Site Collection, then add Content Editor Webpart that links to the HTML script.

Then you can go to the other Site Collection, create a page with Page Viewer, or direct HTML with IFRAME which links to the page created in previous step. Remember, the SharePoint top links bar and left navigation will still be displayed. To overcome that, you can add query string “IsDlg=1” at the end of the URL.

If your URL is like: http://contoso.com/Pages/cewp.aspx, then it should be like http://contoso.com/Pages/cewp.aspx?IsDlg=1.

Using jQuery

If your masterpage is attached with jQuery, you can re-use the following code.

<div class="pp-container">
</div>
<script type="text/javascript">
 $.ajax({
  url: "/SiteAssets/common/thescripts.txt",
  method: "GET",
  success: function (data) {
   $('div.pp-container').append(data);
  },
  error: function (data) {
   console.log("Error:");
   console.log(data);
  }
 });
</script>

Where "/SiteAssets/common/thescripts.txt" is the URL of your HTML script.

8 Agu 2016

Tips: Open Office Document Online (Web Version) in SharePoint

In SharePoint, there are 2 ways of setting a link to an Office Document. The most common way we’ve always seen is by direct link, which will download the Office document to your local storage.

Now, there’s another way to link to an Office document and force it to open in Online viewer such as Excel Online, PowerPoint Online, or Word Online. The most possible way is to copy the URL by clicking on the ellipsis next to the filename.

image

Now, you’ll see something similar to this, which will force-open the file in Excel Online:
https://www.contoso.com/Shared%20Documents/Essential%20Regulatory%20Documents%20Inventory%20List%20Template.xlsx?d=we035ad79215c4e82ba32d989b66bacfd

Or at any point of time if you know the direct URL to the file but unsure what is the number or code next to d=, you can just put the link as below.

https://www.contoso.com/Shared%20Documents/Essential%20Regulatory%20Documents%20Inventory%20List%20Template.xlsx?web=1

This way, it will forcefully open the excel (or essentially any Office document) in Online Viewer.

 

WAIT, there’s more! I know that you’re going to complain!

27 Jul 2016

Using jQuery to Send Email from SharePoint

I’ve been outside of this blog so far and never post anything in this blog. But let me share a small code snippet that can be used. Below is the code to send email from SharePoint.


var EmailInfo = {
  To : { Address : 'radityo.ardi@gmx.com' },
  Subject : 'This is the subject',
  Body : 'This is the <b>Body</b>'
};

$.ajax({
 url: _spPageContextInfo.webServerRelativeUrl +
   '/_api/SP.Utilities.Utility.SendEmail',
 contentType: 'application/json',
 type: "POST",
 headers: {
  "Accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose",
  "X-RequestDigest": $("#__REQUESTDIGEST").val()
 },
 data: JSON.stringify({
  'properties': {
   '__metadata': { 'type': 'SP.Utilities.EmailProperties' },
   'From': 'Radityo Ardi',
   'To': { 'results': [EmailInfo.To.Address] },
   'CC': [],
   'Subject': EmailInfo.Subject,
   'Body': EmailInfo.Body
  }
 }),
 success: function(dataSendEmail) {
  alert('Email successfully sent.');
 },
 error: function(err) {
  console.log(err);
 }
});

13 Mar 2013

Assign a User to Manage SharePoint User Profile

Maybe in some of particular scenario, we found that the user wanted to manage user profile alone without using Farm Administrator Account and to keep the user with a minimal security access.

That way, we can configure User Profile Service Application to have particular user granted as User Profile Manager. So they can go to Central Administration website without touching other configuration.

How we can do this?

28 Feb 2013

Visual 2010 Macro: Automate “Attach to Process” to IIS Worker Process (w3wp.exe)

If you take a look at my post a few months ago about my own development environment, maybe you didn’t notice that I posted a link to a macro. This macro I’ve created myself to help me build SharePoint solutions faster than normally we do, rather than we do an “Attach to Process” on the menu and search which w3wp, or even worse, by attaching it to all w3wp which we don’t need.

So, in the code below, I put 2 functions, AttachW3WP(string AppPoolName) and AttachProcess(string ProcessName). Same way, you can create another function, call that function to attach to particular w3wp process with specific Application Pool Name.

This should work with IIS 7.0 above, as IIS 6.0 (or even IIS 5.1) I’ve never tested it out.

Attach To Process
  1. Imports System
  2. Imports EnvDTE
  3. Imports EnvDTE80
  4. Imports EnvDTE90
  5. Imports EnvDTE90a
  6. Imports EnvDTE100
  7. Imports System.Diagnostics
  8. Imports System.Linq
  9. Imports System.ComponentModel
  10. Imports System.Collections
  11. Imports System.Collections.Generic
  12. Imports System.Management
  13.  
  14.  
  15. Public Module RdzMacros
  16.     Dim DebugPanel As String = "Debug"
  17.     Dim Ow As OutputWindow = DTE.ToolWindows.OutputWindow
  18.     Dim Owp As OutputWindowPane
  19.     Dim SetName As String = "ApplicationPoolName"
  20.     Dim Titl As String = "AttachW3WP"
  21.  
  22.  
  23.     Private Sub PanelInit()
  24.         Try
  25.             Owp = Ow.OutputWindowPanes(DebugPanel)
  26.         Catch ex As Exception
  27.             If Owp Is Nothing Then
  28.                 Owp = Ow.OutputWindowPanes.Add(DebugPanel)
  29.             End If
  30.         End Try
  31.     End Sub
  32.  
  33.     Private Function GetAppPoolName() As String
  34.         Dim sRet As String = ""
  35.         Try
  36.             sRet = DTE.Solution.Globals(SetName)
  37.         Catch ex As Exception
  38.         End Try
  39.         Return sRet
  40.     End Function
  41.  
  42.     Private Sub AttachW3WP(ByVal AppPoolName As String)
  43.         PanelInit()
  44.         Dim attached As Boolean = False
  45.         Dim proc As EnvDTE.Process
  46.         Dim ProcessName As String = "w3wp.exe"
  47.         Dim PID As Integer = 0
  48.         Dim CmdLine As String = AppPoolName 'GetAppPoolName()
  49.         If String.IsNullOrEmpty(CmdLine) Then
  50.             MsgBox("Set Application Pool Name first via 'SetApplicationPoolName' macro.", MsgBoxStyle.Critical, Titl)
  51.             Exit Sub
  52.         End If
  53.  
  54.         Owp.OutputString(String.Format("Search for IIS Worker Processes with AppPool '{0}'...", CmdLine))
  55.         Dim wmiQuery As String = "select CommandLine,ProcessID from Win32_Process where Name='" + ProcessName + "'"
  56.         Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(wmiQuery)
  57.         Dim retObjectCollection As ManagementObjectCollection = searcher.Get
  58.         For Each retObject As ManagementObject In retObjectCollection
  59.             If retObject("CommandLine").ToString().ToLower().Contains("\" + CmdLine.ToLower() + "\") = True Then
  60.                 PID = Convert.ToInt32(retObject("ProcessID").ToString())
  61.                 Owp.OutputString(String.Format("Found the ProcessID: {0}...", PID.ToString))
  62.                 Exit For
  63.             End If
  64.         Next
  65.  
  66.         If PID > 0 Then
  67.             For Each proc In DTE.Debugger.LocalProcesses
  68.                 If proc.ProcessID = PID Then
  69.                     proc.Attach()
  70.                     attached = True
  71.                     Exit For
  72.                 End If
  73.             Next
  74.         End If
  75.         If Not attached Then
  76.             MsgBox("w3wp.exe with Argument '" + CmdLine + "' is not running!", MsgBoxStyle.Exclamation, "MiKrosok Pisual Studio 2010")
  77.         Else
  78.             Owp.OutputString(String.Format("ProcessID {0} already attached to VS debugger!", PID.ToString))
  79.             Owp.Activate()
  80.         End If
  81.     End Sub
  82.  
  83.     Private Sub AttachProcess(ByVal ProcessName As String)
  84.         PanelInit()
  85.         Dim attached As Boolean = False
  86.         Dim proc As EnvDTE.Process
  87.  
  88.         For Each proc In DTE.Debugger.LocalProcesses
  89.             If proc.Name.ToLower().Contains(ProcessName.ToLower()) Then
  90.                 proc.Attach()
  91.                 attached = True
  92.                 Exit For
  93.             End If
  94.         Next
  95.         If Not attached Then
  96.             MsgBox("'" + ProcessName + "' is not running!", MsgBoxStyle.Exclamation, "MiKrosok Pisual Studio 2010")
  97.         Else
  98.             Owp.OutputString(String.Format("ProcessName {0} already attached to VS debugger!", ProcessName))
  99.             Owp.Activate()
  100.         End If
  101.     End Sub
  102.  
  103.     Public Sub AttachOWSTimer()
  104.         AttachProcess("owstimer.exe")
  105.     End Sub
  106.  
  107.     Public Sub AttachOSCAR()
  108.         AttachW3WP("SharePoint - 80")
  109.     End Sub
  110.  
  111.     Public Sub AttachK2WorklistService()
  112.         AttachW3WP("K2WorklistService")
  113.     End Sub
  114.  
  115.     Public Sub AttachCommonWorkflowServices()
  116.         AttachW3WP("CommonWorkflowServices")
  117.     End Sub
  118.  
  119.     Public Sub AttachEIS()
  120.         AttachW3WP("SharePoint - 80 - EIS")
  121.     End Sub
  122. End Module

Hope it helps you.

16 Feb 2013

Backup-Restore Content of SharePoint 2010 Problems

So, I see a different issues coming up when we try to backup-restore content of SharePoint from one server to another. Most commonly issues that I found is that we will stuck on this message:

“Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '4.0.145.0' or later.”

Sometimes it says exact version like above, sometimes with another number of version. To resolve it, there’s more approach that Microsoft has provided.

There are 2 approaches to do a backup-restore of SharePoint content itself:

  1. SharePoint Site Collection backup.
  2. SharePoint Content Database backup.

First approach and always be the best approach (I’ve done this many times never fails):
Make sure both destination and source server have to be the exact same version, both in the SharePoint version or SharePoint build number.

With that approach, both solution can be applied. But of course, sometimes we happen to find a different version both on source or destination for some reason. Again, you could compare both versions, which one is higher. If the source is higher than destination, definitely you can’t just do a backup-restore the content straightaway. You need to make destination at least the same version as source. But if the source is lower than destination, on most cases it will just restored without problem.

But, if you notice my last sentence, that doesn’t mean totally without problem. Say you have SharePoint pre-SP1 as a source, and SharePoint with SP1 as a destination. This scenario can’t be done! But why?

That’s a logical question, because normally if the destination is higher version than source, it’ll do just straightaway, but this is not. The reason behind this is just as simple as this, pre-SP1 and SP1 content database structure has a big change and no backward compatibility.

How we are gonna do this? So, there are 2 approaches.

If you do a content-database backup as I said above, your approach will be easier as 1-2-3:

  1. Attach the pre-SP1 Content Database to an SP1 Farm. This can be done by adding the content database to the specific web application in SharePoint Central Administration.
  2. You have to run SharePoint Configuration Wizard to update the content database to SP1 version. Or if it’s failed, try run PSConfig command to upgrade it (PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures).
  3. Detach the upgraded Content Database from that SP1 Farm. This can be done by removing the content database from specific web application in SharePoint Central Administration.
  4. Recover content as unattached database by running PowerShell command (Get-SPContentDatabase -ConnectAsUnattachedDatabase  -DatabaseName <DatabaseName> -DatabaseServer <DatabaseServer>).

But if you only “able” to get the site collection backup file from stsadm or PowerShell (because say some companies are restricting us to do a database backup or it has to go with some crazy procedures), here’s what you need to do (which is painful):

  1. Restore pre-SP1 site collection backup file to a new test pre-SP1 farm.
  2. Upgrade the test farm to SP1 until you finished running SharePoint Configuration Wizard.
  3. Perform a site collection backup from test farm.
  4. Perform a site collection restore to destination farm.

Any other way would be:

  1. Restore pre-SP1 site collection backup file to a new test pre-SP1 farm.
  2. Without upgrading, detach Content Database of test pre-SP1 farm.
  3. Attach pre-SP1 Content Database to an SP1 Farm.
  4. Upgrade it by using SharePoint Configuration Wizard or PSConfig as I mentioned above.
  5. Detach the upgraded Content Database.
  6. Recover content as unattached Content Database.

Hope it helps, guys…. Winking smile

 

reference: http://technet.microsoft.com/en-us/library/hh344831(v=office.14).aspx

6 Feb 2013

List of SharePoint Service Accounts

Hi guys,
Long time no blog since Aug 2012. Just want to share a little bit about SharePoint installation, List of SharePoint Service Accounts. These service accounts are grabbed from Microsoft Technet, and hope it useful for you.

Account Category Account Name Purpose Requirements
SQL Server Service Account SQL Server   The SQL Server service account is used to run SQL Server. It is the service account to run SQL Server service, MSSQLSERVER. > Domain user account.
SQL Server Setup User Account SQL Server   The Setup user account is used to run SQL Server Setup. > Domain user account.
> Member of the Administrators group on each SQL Server on which Setup is run.
SQL Server Agent Service Account SQL Server   The SQL Server service account is used to run SQL Server. It is the service account to run SQL Server Agent service, SQLSERVERAGENT. > Domain user account.
Application Pool Account SharePoint   The application pool account is used for application pool identity.
Recommended action is to make this account specific to each SharePoint Web Application.
> Domain user account.
> Registered Managed Accounts in Central Administration.
> This account must not be a member of the Farm Administrators group.
Content Access Account SharePoint   Content access accounts are configured to access content by using the Search administration crawl rules feature. This type of account is optional and you can configure it when you create a new crawl rule. For example, external content (such as a file share) might require this separate content access account. > Domain user account.
> The content access account must have read access to external or secure content sources that this account is configured to access.
> For SharePoint Server sites that are not part of the server farm, you have to explicitly grant this account full read permissions to the web applications that host the sites.
> This account must not be a member of the Farm Administrators group.
Default Content Access Account SharePoint   The default content access account is used within a specific service application to crawl content, unless a different authentication method is specified by a crawl rule for a URL or URL pattern. > Domain user account.
> The content access account must have read access to external or secure content sources that this account is configured to access.
> For SharePoint Server sites that are not part of the server farm, you have to explicitly grant this account full read permissions to the web applications that host the sites.
> This account must not be a member of the Farm Administrators group.
Excel Services Unattended Service Account SharePoint   Excel Services uses the Excel Services unattended service account to connect to external data sources that require a user name and password that are based on operating systems other than Windows for authentication. If this account is not configured, Excel Services will not attempt to connect to these types of data sources. Although account credentials are used to connect to data sources of operating systems other than Windows, if the account is not a member of the domain, Excel Services cannot access them. > Domain user account.
My Sites Application Pool Account SharePoint   The application pool account is used for My Site application pool identity.
Recommended action is to make this account specific to each SharePoint Web Application.
> Domain user account.
> Registered Managed Accounts in Central Administration.
> This account must not be a member of the Farm Administrators group.
Server farm account or database access account SharePoint   The server farm account is used to perform the following tasks: Configure and manage the server farm, act as the application pool identity for the SharePoint Central Administration Web site, run the Microsoft SharePoint Foundation Workflow Timer Service. > Domain user account.
> Additional permissions are automatically granted for the server farm account on Web servers and application servers that are joined to a server farm.
> The server farm account is automatically added as a SQL Server login on the computer that runs SQL Server. The account is added to the following SQL Server security roles: 'dbcreator' fixed server role, 'securityadmin' fixed server role, 'db_owner' fixed database role for all SharePoint databases in the server farm.
Service Application Application Pool Account SharePoint   The application pool account is used for service application application pool identity.
Recommended action is to make this account to be used in all SharePoint Service Application across farm.
> Domain user account.
> Registered Managed Accounts in Central Administration.
SharePoint Setup User Account SharePoint   The Setup user account is used to run the following, SharePoint Setup and SharePoint Products Configuration Wizard. > Domain user account.
> Member of the Administrators group on each SharePoint server on which Setup is run.
> SQL Server login on the computer that runs SQL Server.
> Member of the following SQL Server roles: 'securityadmin' fixed server role and 'dbcreator' fixed server role.
SharePoint User Profile Service Account SharePoint   The user account is used to run the User Profile Synchronization service. Configured under User Profile Service Application for a connection to Active Directory. > Domain user account.
> Registered Managed Accounts in Central Administration.
> Replicating Directory Changes rights in Active Directory security management.
SharePoint Search Service Account SharePoint   The user account is used to run the Search Service Application. > Domain user account.
> Registered Managed Accounts in Central Administration.


Maybe you wonder why we must separate service account to several accounts. The exact reason behind is, I don't know. But from what I have heard from Microsoft's employee when I was doing some troubleshooting, is that easier for them to do debugging if something goes wrong. SharePoint is the most crazy product that I've ever know! Integrating with so many softwares and services such as FAST Search, Performance Point, Forefront Identity Manager, and any type of Directories (Active Directory). Any type of users they trying to grab and make love with them. And now what they're trying to do is to make love with "many type" of developers. And, maybe we don't know exactly which one causing error, but they do know. So, doing this thing is quite important at the time they need it. Trust me, its hard to track while debugging some code issue without isolating the case!

6 Jun 2012

Issue for Download File Prompt in SharePoint 2010

OK, so you have the SharePoint 2010, and now you got HTML or HTM file, but when you tried to open the URL to that file, you got a Download File dialog box.

Follow these steps to fix.

Open the SharePoint 2010 Central Administration and then go to Application Management and click Manage web applications.

image

Highlight the web application you want to fix, and click General Settings.

image

Change this to Permissive and click OK.

image

Set Maximum Upload File Size in SharePoint

Simple question, how to set maximum upload file size in SharePoint? Here’s how….

19 Mar 2012

Automatic IIS Configuration Script for SharePoint 2010

Just found out this batch script from Microsoft. Maybe you ever found this solution, but better to share piece by piece than just share the link from Microsoft.

IC399585

15 Feb 2012

Forefront Identity Manager Service Failed to Start in SharePoint 2010

Did you ever got this when restarting your SharePoint 2010 machine?
image

Too bad that this thing is always happening every time you restart your SharePoint 2010 machine. Got the answer from a buddy in internet (thanks Michael Hanes, this is really helping me a lot!). I got to tell you, this thing happens after I’ve upgraded my SharePoint development box to Service Pack 1.

This is the simple fix, I hope you’ll find this thing helpful to you by looking at the series of images below. Please ask me anything if it not clear to you. Thanks! Winking smile

26 Jan 2012

Problems in SharePoint 2010, “The service was unable to start because the version of the database does not match the version of the product.”

Lately, I’ve updated my SharePoint 2010 development engine to SharePoint 2010 Service Pack 1, and after updating SharePoint 2010 to Service Pack 1, and starting all services, there’s one service won’t run, Forefront Identity Manager Synchronization Service. When looked at the Event Viewer log, it says The service was unable to start because the version of the database does not match the version of the product.

19 Jan 2012

How to Query SharePoint Web Analytics Reports from SQL Server

This time, I want to show you on how you can query the SharePoint Web Analytics Reports from your SharePoint 2010. It seems that some people still confused because on my previous post, I didn’t give any examples or anything to proof this. I need to apologize, and in this post, I’ll write about how to Query it first, so you can get what I ‘m trying to explain.

21 Okt 2011

Get All Items including inside SharePoint Folder Programmatically using SPQuery

Just sharing the knowledge, I want to share about how to get all items / documents programmatically without getting inside the folder and querying it again. So, without folders, all items whether inside a folder or not, will be shown upon your query result.

Awwww, I’m not in Windows 2008 mode to copy my code in here and show some screenshots, but that’s just fine.

Using RecursiveAll in SPQuery
  1. SPQuery Q = new SPQuery();
  2. Q.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>BOOK</Value></Eq></Where>";
  3. Q.ViewFields = "<FieldRef Name='Name' /><FieldRef Name='ID' />";
  4. Q.ViewAttributes = "Scope='RecursiveAll'";

After you code your query, then you can add ViewAttributes and add Scope=’RecursiveAll’ to the SPQuery object.

Done, and all items whether inside a folder or not, will be shown upon your query result.

18 Okt 2011

Tools to Get SPSite and SPWeb Aggregation ID for SharePoint 2010

It’s been a busy months for me, I can’t write anything on my spare time. But I tell you what, I’ve created a little tools to generate Aggregation ID so you don’t have to write code about it if you just want to query the Web Analytics on SharePoint 2010.

Just specify your URL and Level, and you’re good to go.

image

Usage:
Rdz.GetAggregationId.exe –URL <URL of SharePoint Site or SubSite> –Level [SPSite | SPWeb]

Below is the exe file that you can use. It based on .NET 3.5.

UPDATE: Thanks for Anand for noticing. I just realized that I haven’t include the DLL inside the ZIP file yet. Above, is the updated link. Thanks a lot and sorry for my mistake! Open-mouthed smile

20 Jul 2011

Tips for Different FQDN and NetBIOSName in SharePoint 2010 User Profiles

SharePoint, SharePoint, and SharePoint again. Today I want to post something about how we can import from Active Directory but with the FQDN and NetBIOSName completely different. If your domain FQDN is (for example) gembelcorpse.co.id, and your NetBIOS Name set to GC, then you do have a problem. When you let this SharePoint User Profile imports from your active directory, it will make the User Profile import like GEMBELCORPSE\administrator, or GEMBELCORPSE\user1, and that’s totally wrong.

In the previous version of SharePoint (2007), we don’t need to do this tips, all things are automatically done by system. Now, in SharePoint 2010, we must do this kind of tips. So, take a look at this PowerShell code.

Code Snippet
  1. param($ServiceApplicationName)
  2. $ServiceApps = Get-SPServiceApplication
  3. $UserProfileServiceApp = ""
  4. foreach ($sa in $ServiceApps)
  5.   {if ($sa.DisplayName -eq $ServiceApplicationName)
  6.     {$UserProfileServiceApp = $sa}
  7.   }
  8. if ($UserProfileServiceApp -eq "")
  9. {
  10.     Write-Host "Ooops..., Service Application '$($ServiceApplicationName)' not found."
  11. }
  12. else
  13. {
  14.     Write-Host "Found '$($UserProfileServiceApp.DisplayName)'..."
  15.     if ($UserProfileServiceApp.NetBIOSDomainNamesEnabled -eq 1)
  16.     {
  17.         Write-Host "NetBIOSDomainNamesEnabled in '$($UserProfileServiceApp.DisplayName)' already enabled, nothings updated!"
  18.     }
  19.     else
  20.     {
  21.         Write-Host "Press any key to continue, [Esc] to cancel..."
  22.         $Key = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
  23.         if ([int]$Key.Character -eq 27)
  24.         {
  25.             Write-Host "Canceling update to '$($UserProfileServiceApp.DisplayName)'..."
  26.         }
  27.         else
  28.         {
  29.             $UserProfileServiceApp.NetBIOSDomainNamesEnabled = 1
  30.             $UserProfileServiceApp.Update()
  31.             Write-Host "Done Updating '$($UserProfileServiceApp.DisplayName)'!"
  32.             Write-Host "Please run Full Synchronization to import all User Profile."
  33.         }
  34.     }
  35. }

With that PowerShell code, run it using SharePoint PowerShell, you can run it from Start menu > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell.

image

Run it using –ServiceApplicationName argument. If your User Profile Service Application Name is User Profile SSA, then you should run it like this command below.
.\SP2010EnableNetBIOSName.ps1 -ServiceApplicationName "User Profile SSA"

image

NOTE: You must run this script on a newly created User Profile Service Application. If you already have the existing, you must delete it, or create another User Profile Service Application. Don’t do the Full Synchronization, configure it first (point to active directory), and then run this script, and then run the Full Synchronization of your User Profile Service Application.

Nice….! click +1 if you do like Winking smile