Search This Blog

Wednesday 24 April 2013

Exchange mail disappearing from Drop folder but not in SP List

Hi,

i Got the following error:
i Configured a smtp server under IIS 6 as in: http://daniecsp.blogspot.com/2013/04/sp20132010-how-to-configure-incoming.html

When sending a mail from GMail it gets to the drop folder and SharePoint pics up the mail and add it to the list.

When sending a mail from Exchange 2010 client it gets to the drop folder disappears but does not go to the list in sharepoint.

After lots of trouble shooting i eventually intercepted a email(Copy the file before it disappears)  from GMail and one from Exchange to compare them.
Open them it in notepad.

In the mail from gmail the x-sender reads: x-sender: user@domain.co.za
In the Exchange Mail it reads(As image below): x-sender: prvs=6fa4781=user@domain.co.za

When i edit the x-sender for the exchange mail to be the same as gmail it works..."x-sender: user@domain.co.za"

Ok, now i need to try and figure out why and how to fix it...Hopefully i get a answer before the end of the week...Starting a new job and don't want this one to get the better of me.

If you have the same issue and i don't get a answer maybe this can at least point you in the right direction.

Solution:
You need to go to your mail enabled list and change the
"Accept E-Mail Messages from any sender"


Friday 12 April 2013

Import and Export a Site Collection

Hi,

This is pretty simple.
Open SharePoint Management Shell in Admin mode.
Make sure the user you are logged on with has got full rights everywhere.

Export Command:
export-spweb -identity http://yoursiteurl -path c:\path\filename.cmp


Export-SPWeb -Identity <SiteURL> -Path <Path and File Name> [-ItemUrl <URL of Site, List, or Library>] [-IncludeUserSecurity] [-IncludeVersions] [-NoFileCompression] [-GradualDelete] [-Verbose]


Import Command:
Import-spweb -identity http://yoursiteUrl -path c:\yourpath\filename.cmp


Import-SPWeb [-Identity] <SPWebPipeBind> -Path <String> [-ActivateSolutions <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-HaltOnError <SwitchParameter>] [-HaltOnWarning <SwitchParameter>] [-IncludeUserCustomAction <None | All>] [-IncludeUserSecurity <SwitchParameter>] [-NoFileCompression <SwitchParameter>] [-NoLogFile <SwitchParameter>] [-UpdateVersions <Append | Overwrite | Ignore>] [-WhatIf [<SwitchParameter>]]


i Have used the command to export and import sites between different domains and it works just fine. There is a security parameter which you can remove if you are doing it between different domains.

To over write existing lists you can add "-updateversions overwrite" this however does not seem to over write everything.



Adding a Document Template to a Library

Hi,

How to add a Document Template to a Library.


First create a Site Content Type by going to site settings and selecting Site content types
Click on New

Select the following options


Click Ok.
Goto the advanced settings of the content type

Choose your template
Goto your document library settings, click on advanced settings.
Allow Management of content types must be yes


Now you should be able to see this field:
Click on add from existing site content types.
Select your content type and move it to the right
And that is it. You should have your template added to the list!


Thursday 11 April 2013

Scheduling SharePoint Backups

Hi, To schedule SharePoint Central Admin backups you still to this day need to schedule it via a script.
This is so far up to SharePoint 2013.

Create the backup folder on your SQL Server, still playing with this but seems that backing up to your WFE sometimes can cause issues.
Share the folder with your farm users, sp_admin, sp_farm, sqluser.
i Have also started creating a Backup user with full rights everywhere(Full SQL, SP and server rights) and running the backup under it. Sorted out some issues i had.


Before you schedule it make sure you do a manual backup to the shared folder under Central Admin that it complete with no issues. Log in with your backup users for this.

If you get this error:  Operating system error 5(failed to retrieve text for this error. Reason: 15105).
BACKUP DATABASE is terminating abnormally.
Here is the solution(Backup user might also resolve this): http://daniecsp.blogspot.com/2013/04/sp2010-backups-failing-with-error.html

Now you can create the script file.
Here i changed my script to the following. Found this script at SharePoint Police and it work brilliantly
http://sharepointpolice.com/blog/2010/12/07/automated-powershell-script-to-backup-sharepoint-farm-or-site-collection-with-email-notification/

So, create a file with ps1 extension and with the following content:(Maybe copy it from the above link to make sure it is all 100% formatted)


****************************

# ==============================================================================================
# NAME: SP2010_Farm_Backup_With_Notification.ps1
# AUTHOR: Mukesh Parmar
# DATE: 07 December 2010
# COMMENT: A Powerful Script to take backup of the entire SharePoint 2010 Farm with email notification.
# Website: http://thecommunicator.co.cc
# ==============================================================================================
Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue
try
 {
  $today = (Get-Date -Format dd-MM-yyyy)
 #Location of the Backup Folder
  [IO.Directory]::CreateDirectory("C:\Backups\Sharepoint\Scheduled\$today")
 # This will actually initiate the SPFarm backup.
  Backup-SPFarm -Directory C:\Backups\Sharepoint\Scheduled\$today -BackupMethod full
 # Edit the From Address as per your environment.
  $emailFrom = "SPBackupMcMethod@dac.co.za"
 # Edit the mail address to which the Notification should be sent.
  $emailTo = "daniec@dac.co.zam"
 # Subject for the notification email. The + “$today” part will add the date in the subject.
  $subject = "The SharePoint Farm Backup was Successful for "+"$today"
 # Body or the notification email. The + “$today” part will add the date in the subject.
  $body = "The SharePoint Farm Backup was Successful for "+"$today"
  # IP address of your SMTP server. Make sure relay Is enabled for the SharePoint server on your SMTP server
  $smtpServer = "10.10.10.2"
  $smtp = new-object Net.Mail.SmtpClient($smtpServer)
  $smtp.Send($emailFrom, $emailTo, $subject, $body)
 }
Catch
 {
  $ErrorMessage = $_.Exception.Message
  # Configure the below parameters as per the above.
  $emailFrom = "SPBackupMcMethod@dac.co.za"
  $emailTo = "daniec@dac.co.za"
  $subject = "The SharePoint Farm Backup Job failed on "+"$today"
  $body = "The SharePoint Farm Backup Job failed on "+"$today and the reason for failure was $ErrorMessage."
  $smtpServer = "10.10.10.2"
  $smtp = new-object Net.Mail.SmtpClient($smtpServer)
  $smtp.Send($emailFrom, $emailTo, $subject, $body)
 }


 ***************************


Edit the obvious parts as explained in the script.
Thanks Mukesh, this really helps allot.

Open PowerShell in Admin mode and run the ps1 file.(Stil logged on as backup user)
See if it completed without errors.

Now create a txt file, rename it to .bat and paste the line in there. Obviously change the path to your ps1 file path and name)
PowerShell -command C:\Backups\SharePoint\SPScheduledbackup.ps1

Ok, now you can double click on the bat file, let it run and check if there are errors.

If you get a error saying it is not digitally signed look here : http://daniecsp.blogspot.com/2013/02/powershell-script-not-digitally-signed.html

Now all that is left is to schedule it.

Open task scheduler.
Expand till below Microsoft and right click and choose "Create Basic Task"
Type name and click next


On the next 2 pages select the frequency you want to backup your SP.

Now click on the browse button and browse to your Bat file

You can also point to the PS1 directly with the following parameters:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
.\systemcheck.ps1
c:\script\

On this page check open properties and click next


Now  under General set your settings the same as screenshot. On configure for choose your o/s

After this you can click ok.
Right click on the task and make sure it completes successfully.

Hope this helps!




SP2013/2010: How to configure Incoming mail without Exchange for SharePoint 2010/2013

Hi,

This explains how to configure incoming mail without exchange. If you need to frd mail to SharePoint via exchange go to this post:
http://daniecsp.blogspot.com/2013/02/sp20132010-how-to-configure-incoming.html

Start of on your SharePoint Server:

You need to add and configure the SMTP service.

Goto your server manager, click on "Add Features"


Here you need to check "SMTP Server" and Then "Add Required Role Services"




This will install the SMTP server and required services.

Now you need to install IIS Management Console and requirements. IIS Should already be installed so that scroll down to Web Server(IIS) under your roles and then click on "Add role service"



Here you need to make sure the IIS6 Management Compatibility is all installed.



Now you need configure IIS.
Open IIS6, expand SMTP and click on domains.

Choose Alias on the next option and Next.
Now you need to type the domain name. In my case it is going to be servername.domain.com


Click finish.

Please remember to point your domains DNS MX record to the public ip of your server.
Screenshot here

Ok, next configure incoming mail under Central Admin.
Click on System Settings under Central Admin. Here should be Configure Incoming e-mail.( If not run IE as administrator)

Configure your settings to be the same as this screenshot:
Domain must be the same as the one you added under smtp.
Click OK.

Now you need to configure a list to except incoming mail.
Not all lists support incoming mail so under list settings, if there are no "Incoming email settings" it does not support incoming email.

Lists that do support incoming mail:
Document, picture, or form library
Announcements list
Calendar list
Discussion board
Blog


Add one of the above lists and go to list settings and incoming email settings.
choose Yes to allow the list to except email and enter i email alias.


Now it is to test.
send a mail to your list and you can monitor your drop folder. The e-mail will appear in the drop folder before SharePoint pick it up from there. Default path: C:\inetpub\mailroot\Drop

Once the file disappear from your drop folder it should be in your list.

Ps: i Have got a very strange error. If i send a mail from gmail to the list it gets to the list without an issue. If i send mail via our exchange server i get the following error:
"An error occurred while processing the incoming e-mail file C:\inetpub\mailroot\Drop\eb18f2f601ce40c90000001d.eml. The error was: Access denied. You do not have permission to perform this action or access this resource.."
Dont have the solution yet but if i get it will prob add a new post and add link in here...



Tuesday 9 April 2013

SP2010: Backups failing with error: Operating system error 5(failed to retrieve text for this error. Reason: 15105). BACKUP DATABASE is terminating abnormally

Hi,
Had this error a few times and finally got a solution


Operating system error 5(failed to retrieve text for this error. Reason: 15105).
BACKUP DATABASE is terminating abnormally


First be sure that your sp users got the required rights.
So share your backup folder on the SQL server and give your sp_admin, sp_farm and sqluser full rights



If you have done this then you can try the following:
Open SQL Server Configuration Manager
Expand SQL Server Services

Go to the properties of your SQL Server instance and change the Log On As to Local System.

Restart SQL and try again


Wednesday 3 April 2013

SP2010: Usage and Health Data Collection Service Application Proxy is not started

This is a bug in SP2010.
i Created the Usage Profile Service Application Manually and it's proxy was not started.



You start it via power-shell.

Open SharePoint 2010 Management Shell as Admin
Type: Get-ServiceApplicationProxy
This will give you a list of Service Applications

then copy the id for WSS_UsageApplication and run this command:

$Up = get-SPServiceApplicationProxy | Where{$_.ID -eg "Paste ID here"}
then
$UP.provision()

Refresh your Service Applications page and it should be started.