(post courtesy Priyo Lahiri)
Out of the box, SharePoint 2010 doesn’t have the capability of scheduling a backup. Fortunately, we have the mix of PowerShell script and Windows Task Scheduler to do the job. In reality it’s just a single line script:
Backup-SPFarm –Directory YourBackupDirectory –BackupMethod Full / Differential
How can we make this backup script more special?
The script below will send an email if an error occurrs during the backup with the error description so that every morning (or whatever your backup schedule is) you don’t have to open up Central Admin and see if the backup went fine or not (assuming you check the backup status / integrity…. I know a lot of people who don’t!) and hopefully it gives you an idea on what went wrong.
The PowerShell cmdlet that we can use to send the email is a simple one:
Send-MailMessage -From "someaddress@domain.com" -To "YourEmail@domain.com" -Subject "Error captured" -Body “Error Message Here” -SmtpServer YourSMTPServerFQDN
(more parameters are available for the Send-MailMessage cmdlet here: http://technet.microsoft.com/en-us/library/dd347693.aspx)
So I created the simple script below to first see the error message being displayed from PowerShell:
Unfortunately, the error message is not very helpful. It tells me that the backup was not successful but doesn’t give me any pointers as to why. No point sending this to the SharePoint admin. Let’s take a look at the spbrtoc.xml from the backup directory:
<SPHistoryObject> <SPId>376aa7dd-0e79-4e8e-9247-26d5a61949b7</SPId> <SPRequestedBy>LZENG\administrator</SPRequestedBy> <SPBackupMethod>Full</SPBackupMethod> <SPRestoreMethod>None</SPRestoreMethod> <SPStartTime>02/24/2011 18:15:15</SPStartTime> <SPFinishTime>02/24/2011 18:15:41</SPFinishTime> <SPIsBackup>True</SPIsBackup> <SPConfigurationOnly>False</SPConfigurationOnly> <SPBackupDirectory>\\app02\SPBackup\spbr000D\</SPBackupDirectory> <SPDirectoryName>spbr000D</SPDirectoryName> <SPDirectoryNumber>13</SPDirectoryNumber> <SPFailure>Object lz_Admin failed in event OnBackup. For more information, see the spbackup.log or sprestore.log file located in the backup directory.</SPFailure> <SPTopComponent>Farm</SPTopComponent> <SPTopComponentId>d1047b6f-4ff1-4ce4-943b-f54ff5fe44e3</SPTopComponentId> <SPWarningCount>0</SPWarningCount> <SPErrorCount>1</SPErrorCount> </SPHistoryObject>
Now that makes a little more sense, I can now see that the Admin Content Database failed during the back-up. So how about sending this to the SharePoint Admin so that he knows exactly what’s going on? To make this more useful, we will also attach the backup log from the SPBackupDirectory with the email so that the SharePoint admin knows everything he needs to about the error.
Here is how we do it… (in pseudocode)
Read the spbrtoc.xml file and pull up the First <SPHistoryObject> block and get the path of the spbackup.txt from <SPBackupDirectory> and attach it to the email.
Here is a script sample
1: $xmldata = [xml](Get-Content 'C:\SPBackup\spbrtoc.xml') #loading spbrtoc.xml as XML datatype
2:
3: # In the statement below I am getting the block of <SPHistoryObject> where SPErrorCount is more than zero and the #SPHistoryObject was created today and storing it in $Node
4:
5: $Node = $xmldata.SPBackupRestoreHistory.SPHistoryObject | Where-Object {$_.SPErrorCount -gt '0' -and $_.SPStartTime -gt (Get-Date -DisplayHint Date)}
6:
7: # Getting the SPFailure Message and the spBackup.Log path and creating the body of the email
8:
9: $FailureMsg = $Node[0] | % {$_.SPFailure}
10: $Att = ($Node[0] | % {$_.SPBackupDirectory}) + 'spbackup.log'
11: $msgBody = 'An Error occurred while trying to backup your SharePoint Farm. Details : ' + $Failuremsg + '
12: Attached is the Error Log for additional reference.'
13:
14: # Finally sending the email
15:
16: Send-MailMessage -From 'administrator@lzeng.local' -To 'Administrator@lzeng.local' -Subject 'Error Occured in SharePoint Backup' -Body $msgBody -Attachments $att -SmtpServer mail.lzeng.local
And here is the result:
Here is the full script:
1: Clear-Host
2: $Error.Clear()
3: ###################################################################################################
4: #################### POPULATE THE VARIABLES BELOW ##################################################
5: ###################################################################################################
7: $BackupDir = '\\app02\SPBackup' # Your backup directory here. Recommended to use \\server\share
8: # NOTE: DO NOT put '\' after the above path
9: # Ensure SharePoint Timer Service Account and SQL Service Account has Full Control on the above Path
10: # More Information: http://technet.microsoft.com/en-us/library/ee748614.aspx
11:
12: # Variables below required for Sending Email.
13: $FromAccount = 'administrator@lzeng.local' # valid domain account or an account with Send As rights
14: $ToAccount = 'administrator@lzeng.local' # Recipient email address
15: $smtpServer = 'mail.lzeng.local' # SMTP / Exchange / SMTP Relay Agent FQDN
16: # If you need other parameters like CC Field or if you exchange uses SSL refer here: http://technet.microsoft.com/en-us/library/dd347693.aspx
17: ######################################### START SCRIPT ##############################################
18:
19: # Start Loading SharePoint Snap-in
20: $snapin = (Get-PSSnapin -name Microsoft.SharePoint.PowerShell -EA SilentlyContinue)
21: IF ($snapin -ne $null){write-host -f Green "SharePoint Snap-in is loaded... No Action taken"}
22: ELSE { write-host -f Yellow "SharePoint Snap-in not found... Loading now"
23: Add-PSSnapin Microsoft.SharePoint.PowerShell
24: write-host -f Green "SharePoint Snap-in is now loaded"}
25: # END Loading SharePoint Snapin
26:
27: # Starting Backup
28: Write-Host -f green "Staring Backup process"
29: Backup-SPFarm -Directory $BackupDir -BackupMethod full -BackupThreads 10 -Force -ErrorAction SilentlyContinue
30: Write-Host -f green "Exit: Backup process"
31:
32: IF($Error[0] -ne $null){
33: # Loading toc file
34: $xmldata = [xml](Get-Content ($BackupDir +'\spbrtoc.xml'))
35: $Node = $xmldata.SPBackupRestoreHistory.SPHistoryObject | Where-Object {$_.SPErrorCount -gt '0' -and $_.SPStartTime -gt (Get-Date -DisplayHint Date)}
36: # Grab SPFailure Msg and Path to attachment
37: $FailureMsg = $Node[0] | % {$_.SPFailure}
38: $Att = ($Node[0] | % {$_.SPBackupDirectory}) + 'spbackup.log'
39: # Create msgbody
40: $msgBody = 'An Error occurred while trying to backup your SharePoint Farm. Details : ' + $Failuremsg + '
41: Attached is the Error Log for additional reference.'
42:
43: # Send email
44: Send-MailMessage -From $FromAccount -To $ToAccount -Subject 'Error Occured in SharePoint Backup' -Body $msgBody -Attachments $att -SmtpServer $smtpServer }
45:
46: Write-Host -f Green "Operation Complete"
47: ############################################## END SCRIPT ##############################################
A workable script is attached with this post that you can download and use. All you need to do it specify values for the variables below and follow the instructions to create a task in Windows Task Scheduler.
Variables to populate in the script:
$BackupDir = '\\app02\SPBackup' # Your backup directory here. Recommended to use \\server\share
NOTE: DO NOT put '\' after the above path
$FromAccount = 'administrator@lzeng.local' # valid domain account or an account with Send As rights $ToAccount = 'administrator@lzeng.local' # Recipient email address $smtpServer = 'mail.lzeng.local' # SMTP / Exchange / SMTP Relay Agent FQDN
If you need other parameters like CC Field or if you exchange uses SSL refer here: http://technet.microsoft.com/en-us/library/dd347693.aspx
Instructions to configure the task:
You are all set.
If you want, you can create 2 copies of this script and change the second one to run Differential backup every night and Full Backup every Sunday or whatever your backup strategy is.
Ok so now you know I can read the xml file from PowerShell which means I can also remove some lines from it and may be have a cleanup script for backup retention and remove all those failed backup listed in the central admin? You are right on… but that’s for the next post.
Stay tuned.
Cheers
-Priyo
(Post courtesy Iftekhar Hussain)
Virtual Desktop Infrastructure (VDI) is getting momentum and more and more organizations are looking at VDI to remotely provide the Operating system environment to their users.
One of the challenges that VDI is facing today is the ability to provide the same graphic experience of the desktop operating system as they have today on their physical PC.
E.g:
If you are following this blog and read my last post about features like RemoteFX and Dynamic Memory brought in by Service Pack 1 for Windows Server 2008 R2, you probably already know what RemoteFX is.
Just to recap,
"RemoteFX adds new capabilities to the Remote Desktop Services platform by delivering a full-fidelity Virtual Desktop Infrastructure (VDI) and high-density, scalable, client-agnostic session virtualization capabilities, shifting delivery intelligence to host-based systems running RemoteFX. Through a new graphics payload purpose-built for RemoteFX and Remote Desktop Protocol (RDP), the session virtualization platform is tightly integrated with the RDP protocol, which enables shared encryption, authentication, management, and local device support."
In layman’s terms, RemoteFX extends the capabilities of GPU on your server hardware into your Virtual Machines running Windows 7 so that you can get rich graphic capabilities which are on par with a physical desktop running Windows 7.
RemoteFX leverages the power of virtualized graphics resources and advanced codecs to recreate the fidelity of hardware-assisted graphics acceleration, including support for 3D content and Windows Aero, on a remote user’s device. This allows for a local-like, remote experience.
RemoteFX also provides redirection of virtually any USB device. Some of the features of RemoteFX device redirection are:
Microsoft has recently released bunch of documentation on Remote FX deployments and I would like collate all these documentations right here for you.
Before I take you through the documentations, let me touch briefly on the deployment guidelines of RemoteFX.
Now lets review some of the great documentation released a few weeks ago about RemoteFX deployment.
Microsoft RemoteFX for Remote Desktop Virtualization Host Capacity Planning Guide for Windows Server 2008 R2 Service Pack 1
This white paper is intended as a guide for capacity planning of Microsoft RemoteFX in Windows Server 2008 R2 Service Pack 1. It describes the most relevant factors that influence the capacity of a given deployment, methodologies to evaluate capacity for specific deployments, and a set of experimental results for different combinations of usage scenarios and hardware configurations. Download
This white paper is intended as a guide for capacity planning of Microsoft RemoteFX in Windows Server 2008 R2 Service Pack 1. It describes the most relevant factors that influence the capacity of a given deployment, methodologies to evaluate capacity for specific deployments, and a set of experimental results for different combinations of usage scenarios and hardware configurations.
Download
Deploying Microsoft RemoteFX on a Single Remote Desktop Virtualization Host Server Step-by-Step Guide
This step-by-step guide walks you through the process of setting up a working virtual desktop that uses RemoteFX and is accessible by using Remote Desktop Connection (RDC) in a test environment. Upon completion of this step-by-step guide, you will have a virtual desktop with RemoteFX that can be connected to by using Remote Desktop Connection. You can then test and verify this functionality by connecting to the virtual desktop from a client computer as a standard user. Download
This step-by-step guide walks you through the process of setting up a working virtual desktop that uses RemoteFX and is accessible by using Remote Desktop Connection (RDC) in a test environment. Upon completion of this step-by-step guide, you will have a virtual desktop with RemoteFX that can be connected to by using Remote Desktop Connection. You can then test and verify this functionality by connecting to the virtual desktop from a client computer as a standard user.
Deploying Microsoft RemoteFX for Virtual Desktop Pools Step-by-Step Guide.
This step-by-step guide walks you through the process of setting up a working virtual desktop pool that uses RemoteFX in a test environment. Upon completion of this step-by-step guide, you will have a virtual desktop pool with RemoteFX that users can connect to by using RD Web Access. Download
This step-by-step guide walks you through the process of setting up a working virtual desktop pool that uses RemoteFX in a test environment. Upon completion of this step-by-step guide, you will have a virtual desktop pool with RemoteFX that users can connect to by using RD Web Access.
Deploying Microsoft RemoteFX for Personal Virtual Desktops Step-by-Step Guide
This step-by-step guide walks you through the process of setting up a working personal virtual desktop that uses RemoteFX in a test environment.Upon completion of this step-by-step guide, you will have a personal virtual desktop with RemoteFX assigned to a user account that can connect by using RD Web Access. You can then test and verify this functionality by connecting to the personal virtual desktop from RD Web Access as a standard user. Download
This step-by-step guide walks you through the process of setting up a working personal virtual desktop that uses RemoteFX in a test environment.Upon completion of this step-by-step guide, you will have a personal virtual desktop with RemoteFX assigned to a user account that can connect by using RD Web Access. You can then test and verify this functionality by connecting to the personal virtual desktop from RD Web Access as a standard user.
Configuring-USB-Device-Redirection-with-Microsoft-RemoteFX-Step-by-Step-Guide
This step-by-step guide walks you through the process of setting up USB redirection with RemoteFX in a test environment. Upon completion of this step-by-step guide, you will have a personal virtual desktop with RemoteFX assigned to a user account that can connect by using RD Web Access. Download
This step-by-step guide walks you through the process of setting up USB redirection with RemoteFX in a test environment. Upon completion of this step-by-step guide, you will have a personal virtual desktop with RemoteFX assigned to a user account that can connect by using RD Web Access.
Microsoft RemoteFX for Session Virtualization: Architectural Overview
This paper provides an architectural overview of RemoteFX in the context of session virtualization—using a new Windows Server role called the Remote Desktop Session Host (RD Session Host) designed specifically for modern session virtualization environments using Windows Server 2008 R2 SP1. Download
This paper provides an architectural overview of RemoteFX in the context of session virtualization—using a new Windows Server role called the Remote Desktop Session Host (RD Session Host) designed specifically for modern session virtualization environments using Windows Server 2008 R2 SP1.
Deploying Microsoft RemoteFX on a Remote Desktop Session Host Server Step-by-Step Guide
This document walks you through the process of setting up a working Remote Desktop Session Host that uses RemoteFX and is accessible by using Remote Desktop Connection in a test environment. Download
This document walks you through the process of setting up a working Remote Desktop Session Host that uses RemoteFX and is accessible by using Remote Desktop Connection in a test environment.
I believe the documentations provides some very useful information about the best way to deploy RemoteFX, In case you need more information or clarification, please feel free to contact me directly.
Cheers.
Iftekhar
(post courtesy Bryan Petersen)
Office 365 is the next iteration of Business Productivity and Online Suite (BPOS). Office 365 will connect the Office desktop suite to the cloud-based versions of our next-generation communication and collaboration services. These are Exchange Online 2010, SharePoint Online 2010, and Lync Online.
With the General Availability date of Office 365 fast approaching, it’s important to begin planning for transitions from BPOS to Office 365 and/or moving customers from on-premise environments to “The Cloud”. This blog post will address some key requirements with the Office 365 release that need to be considered during the planning phase. Also provided are key resources that can be referenced during each step.
Think about the lifecycle of a product/service in the following sequence. With this posting we emphasize the Plan phase to help partners streamline those initial conversations with prospective customers, and help eliminate surprises in the phases that follow.
A. Walk-thru the Office 365 Service Descriptions with your prospective customer.
A good understanding of what each service provides will allow the customer to know what they’re getting in to with Office 365, as well as provide guidance in helping them make decisions throughout the deployment process.
Office 365 Service Descriptions http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6c6ecc6c-64f5-490a-bca3-8835c9a4a2ea Note: The Appendix section at the end of each Service Description provides a feature comparison between on-premise and online. Note: These are currently in Beta form so some of the details are subject to change. Business Productivity and Online Suite (BPOS) Service Descriptions This information is for comparison purposes to Office 365 only. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c60c0af0-10cc-4b11-bcef-b989c1f168b0 Note: The Appendix section at the end of each Service Description provides a feature comparison between on-premise and online.
Office 365 Service Descriptions
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6c6ecc6c-64f5-490a-bca3-8835c9a4a2ea
Note: The Appendix section at the end of each Service Description provides a feature comparison between on-premise and online. Note: These are currently in Beta form so some of the details are subject to change.
Business Productivity and Online Suite (BPOS) Service Descriptions This information is for comparison purposes to Office 365 only.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c60c0af0-10cc-4b11-bcef-b989c1f168b0
Note: The Appendix section at the end of each Service Description provides a feature comparison between on-premise and online.
B. Review the System Requirements for Office 365.
Office 365 will present a new set of requirements for those customers moving from on-premise to online or transitioning from BPOS-S to Office 365. Some of the key requirements are as follows, focusing on the systems/software that WILL NOT BE SUPPORTED - I start on the systems/software that will not be supported because those requirements are typically overlooked and are the basis for many of those surprises we’re trying to eliminate.
Not Supported
Supported
The complete list of software requirements can be found in the Office 365 online help. http://onlinehelp.microsoft.com/en-us/office365-enterprises/ff652534.aspx Note: The information is currently for the Office 365 Beta release so is subject to change by General Availability.
The complete list of software requirements can be found in the Office 365 online help.
http://onlinehelp.microsoft.com/en-us/office365-enterprises/ff652534.aspx
Note: The information is currently for the Office 365 Beta release so is subject to change by General Availability.
Office 365 pricing and fact sheets are publicly available. They can be found off the primary Office 365 site at http://office365.microsoft.com/. Office 365 for Enterprises - http://office365.microsoft.com/en-us/enterprise.aspx Office 365 for Small Businesses - http://office365.microsoft.com/en-us/small-business.aspx Office 365 for Education - http://office365.microsoft.com/en-us/education.aspx
Office 365 pricing and fact sheets are publicly available. They can be found off the primary Office 365 site at http://office365.microsoft.com/.
Office 365 for Enterprises - http://office365.microsoft.com/en-us/enterprise.aspx
Office 365 for Small Businesses - http://office365.microsoft.com/en-us/small-business.aspx
Office 365 for Education - http://office365.microsoft.com/en-us/education.aspx
Office 365 will be generally available in 2011. Expect more communication about Beta plans and General Availability in the weeks to come. The best way to stay in touch is through one/all the following outlets. Office 365 Blog, Office 365 Facebook , and Office 365 Twitter If customers are interested in moving Online, but don’t want to wait for Office 365 they can certainly move to BPOS and then transition to Office 365 when the time comes. There is an excellent resource available to users who are currently using BPOS and need to plan for the transition to Office 365. The Office 365 Transition Center: http://www.microsoft.com/online/transition-center.aspx
Office 365 will be generally available in 2011. Expect more communication about Beta plans and General Availability in the weeks to come. The best way to stay in touch is through one/all the following outlets.
Office 365 Blog, Office 365 Facebook , and Office 365 Twitter
If customers are interested in moving Online, but don’t want to wait for Office 365 they can certainly move to BPOS and then transition to Office 365 when the time comes. There is an excellent resource available to users who are currently using BPOS and need to plan for the transition to Office 365. The Office 365 Transition Center: http://www.microsoft.com/online/transition-center.aspx
Word on how to buy is just around the corner. Customers should begin conversations with their Microsoft Partner’s for focusing on Steps 1-3.
Part of the planning portion of the lifecycle is finding a partner, but for this audience I felt information on how to become an Office 365 partner and providing additional partner ready resources was more important.
Please review the Office 365 Partner Program
http://office365.microsoft.com/en-US/partners.aspx
If you are a Partner, contact Microsoft Partner Technical Services for assistance with planning deployments of Office 365
(post courtesy Iftekhar and cross-posted from his blog). If you are going to the Microsoft Management Summit, make sure to say hi!
Hello Everybody,
This is again a part of year where Microsoft reaches out to all its customers, partners, IT Pros and developers through its back to back technical conferences with some great announcements, Technical Sessions and demonstrations of its latest and cutting edge products and solutions.
Year 2011 will start with Microsoft Management Summit 2011 next week in Las Vegas, followed by TechEd North America 2011 in May and then Worldwide Partner Conference 2011 (WPC) in July.
MMS 2011 is expected to be all about Private Cloud, Datacenter Automation and Virtualization Management. The products which I am really looking forward to at MMS this year are VMM 2012, Opalis and Service Manager
I’ll be working at MMS 2011 in Las Vegas next week as a product specialist for Virtual Machine Manager 2012. So all you partners, customers and IT Pros, Virtualization enthusiasts who are interested in Next Gen capabilities of Virtual Machine Manager 2012 and learn how it helps creating and doing end to end management of Private Cloud can find me at VMM Booth at Microsoft Pavilion.
In addition to my booth duty, I am really looking forward to presenting and meeting some of my customers, partners whom I work with and discuss their Virtualization and Private Cloud Practice, also hanging out with some old friends and explore Vegas..
Though MMS 2011 is completely sold out for general attendees but here are other options. http://www.mms-2011.com/registrationoverview
For those who are not attending but would like to be updated with what's happening in Vegas, I am planning to do some heavy duty tweeting..
See you in Las Vegas.
Cheers,
(post courtesy Sarkis Derbedrossian)
I often meet Microsoft CRM users who don’t know how sending e-mail works within Microsoft Dynamics CRM. Most users think that when they create an e-mail in CRM and hit the send button, the e-mail is sent automatically. Neither Outlook nor CRM can send e-mails without a post system e.g. Exchange server. Below you will learn how e-mail within CRM works with and without Outlook
Once you've created an e-mail activity in MS CRM and click the Send button to send the e-mail, this mail is handled differently depending on the settings of each user is set to in MS CRM.
E-mail can be handled through Outlook or directly through CRM ... but neither Outlook nor MS CRM can implement the physical handling of the e-mail. This is done by a mail server (Microsoft Exchange Server or another mail system).
Do not make a fast conclusion and think that MS CRM can neither receive nor send e-mail. You should understand that the above task requires an e-mail system to accomplish.
When you send email from MS CRM it usually happens by the following steps:
What if the user does not have the Outlook client open? This will result in the mail will not be sent until the user logs into Outlook. For some situations this can be insufficient. Fortunately installing the e-mail router can solve it.
If you want to be independent of Outlook, and thus could send email directly from MS CRM without using Outlook, this can be done by installing and configuring an E-mail Router.
The e-mail Router is free software that comes with MS CRM. The software can be installed on any server that has access to a Mail Server (Exchange Server or other mail system (POP3/SMTP)) and MS CRM.
When you send email from MS CRM using an E-mail Router it often happens by the following steps
Depending on how you want your organization to send e-mails, remember to check the following settings:
Configuring e-mail access
It is possible to choose one of the following settings from the option list:
None Outlook cannot be used for sending and receiving e-mails which is related to MS CRM
Microsoft Dynamics CRM for Outlook Outlook is responsible for sending / receiving e-mail. Integration with MS CRM for Outlook must be installed and configured. E-mails sent / received only when Outlook is active (open)
E-mail router E-mail is sent and received with MS CRM Email Router. If this element is selected, a dialog box allows entering credentials. Check the box if you want to specify credentials
Forwarded mailbox E-mail forwarded from another e-mail address. The e-mail Router is responsible for sending / receiving e-mails.