Over the years the last year I have had many conversation on how to make SharePoint and Moodle better together and in recent posts I have how to install Moodle on a 32bit and how to install Moodle on 64bit operating systems.
In the current version of Moodle any documents, assignments or images are stored in a folder on the local server. But why can’t we store these files in a SharePoint Document Library so any changes to these documents can be done easily with version controlling or using office web app. Documents can also be searched and index allowing teachers and students to easily find resource they want.
Back in April Microsoft released a white on how to bring SharePoint and Moodle better together but this only if you are going to run the Moodle website using Apache. On the page there are a few comments and unanswered questions on how to integrate Moodle running on IIS with SharePoint 2010.
Following the 3 whitepapers on implementing Moodle on 3 different types of Microsoft environments, I thought I would add how to do this through IIS and changing the same code as Microsoft have recommended for it to work. The following instruction assume you have setup Moodle with IIS as per the whitepapers above.
This blog post is part 1 of a series of 3 on how to integrate SharePoint and Moodle better.
Part 1: How to part 1 (this post)
Part 2: How to part 2
Part 3: Recommended Changes
Accounts Required
SharePoint uses Active Directory to authenticate its users. For Moodle to write documents to a SharePoint library it will require write access to that document library. To do this create a Active Directory user called md_admin. This user will be required to run the IIS website as well authenticated with SharePoint.
Create a new Active Directory user called md_admin. This user will be required to run the IIS website and will also need permission to the SharePoint document library
SharePoint Configuration
Navigate to the location of where you want your Moodle documents to be stored in SharePoint. Click on Site Actions and then on New Document Library. Call your library MoodleDocs or something to your pleasing. You need to make sure the md_admin user account has write access to this library to ensure the whole process works.
The upload process will move files through the upload process in Moodle to SharePoint through WebDav. To find out the webdav URL of your site click on the Windows Explorer from the SharePoint Ribbon.

Copy the path of the folder location eg. sp2010sitesmoodlemoodledocs

Later in the process we will be editing some of the Moodle PHP files and will need this URL.
Permissions to Moodle Root
The website will soon be changed for the md_admin user to run the web service but we also need to make sure the user has read permission of the Moodle PHP files.
Navigate to c:inetpub and right click on wwwroot and select properties
Select the Security tab and add the user md_admin with read permissions.
Changes to IIS
As mentioned in the previous step we need to change the web service that runs the website. This username will connect to SharePoint to upload the files, hence why you will need to use the md_admin username.
Open Internet Information Services Manager and expand the left navigation until you see default website. Select the default website. Using the right panel select Authentication which is in the IIS group

You will notice that Anonymous Authentication is Enabled. Click Edit… in the Actions panel.

Click Set to change the anonymous user identity.
![image_thumb6[1] image_thumb6[1]](http://www.bfcnetworks.com/wp-content/uploads/2012/09/image_thumb611.png)
Fill in the details of the domain username you created earlier (md_admin). You will need to put your domain name before this (domainmd_admin).
Click to go to part 2 of Integrating Moodle and SharePoint
Click to go to part 3 and recommendations of Integrating SharePoint and Moodle