Cool Links for Friday (20090925)

SharePoint
0 comments

External Users must retry several times to connect to SharePoint

SharePoint
.
.
Seems like this issue comes up pretty often. Here’s the symptoms:
You have an intranet (maybe even an extranet) SharePoint site. All users on the LAN (or domain) are able to connect and view the site with no issues. External users (users not on the LAN but have domain accounts) keep getting a login box. Their success is intermittent (works sometimes and other times it never works).
To trace down the issue, you’ll have to enable auditing on the SharePoint front-end. If you enable logon auditing, you’ll see strange errors related to NTLM. What caused this in my case?
Our domain was setup to Accept NTLMv2 only/Refuse LM & NTLM (Network Security: LAN Manager authentication level under Local Policies -> Security Options). A group policy enforced this upon all the SharePoint servers as well. It isn’t a problem for computers on the LAN because they also have the same group policy.
The external user was using a public computer or one that wasn’t on the same domain as the SharePoint server so whent he login box appeared they had to type in: DOMAIN\UserName and their password.
The fix is to change the Local Security Policy on the client machine. We examined this and turns out they had a Group Policy set for Send LM & NTLM Only. Changing this to “Send NTLMv2” would resolve the issue and still allow for their legacy applications to work (Domain Controllers accept LM, NTLM and NTLMv2 in this setting).
Its a best practice to configure your farm for Kerberos anyway. If the Domain Administrators had allowed that, things would work much smoother. However, that was not possible.
6 comments

Free SharePoint Backups Email Log

SharePoint, Microsoft, Windows PowerShell

In a very recent post, I showed you a script written in Visual BASIC (vbs) to have your log file emailed to you on a schedule.

This script didn’t work for me on my Windows Server 2008 machines. I got the error “Reportlog.vbs:(52,2). CDO.Message.1: The transport failed to connect to the server.”

I later confirmed this was due to me specifying the wrong server name. But, I went on a small tangent and decided to try PowerShell. The PowerShell version of this script seems to run faster and is easier to understand.

Step 1
Install PowerShell. You can do this on Windows Server 2008 by using the following command: ServerManagerCmd -install PowerShell

Step 2
You’ll need to enable execution of .ps1 files (powershell scripts) first by typing the following into the PowerShell prompt: Set-ExecutionPolicy RemoteSigned

Step 3
Save this script and run it. You can type Drive:\Path\scriptname.ps1 in PowerShell but I like to save this in a batch file and run it using: powershell.exe -noexit &’D:\BackupBatch\reportlog.ps1′

# ##############################################################
# Send Email with Attachment Script
# Usage: $smtp to see settings, or $smtp | gm to see options
# Written by Wahid Saleemi (https://wahidsaleemi.com)
# Enable execution by: Set-ExecutionPolicy RemoteSigned
# ##############################################################
$file = "D:\Backups\Farm\backupdaily.log"
$smtpServer = "mailserver1"

$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($file)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "sharepoint@domain.com"
$msg.To.Add("wahid.saleemi@domain.com")
$msg.Subject = "Your SharePoint Backup Report"
$msg.Body = "See attachment"

$msg.Attachments.Add($att)
$smtp.Send($msg)
 
$att.Dispose()


# ##############################################################
# Here's some extra things we could use
# ##############################################################
# $Credentials = new-object System.Net.networkCredential
# $Credentials.domain = "NETBIOS"
# $Credentials.UserName = "xxxx"
# $Credentials.Password = "xxxx"
# $smtp.Credentials = $Credentials
#
# $msg.Sender = "portal.sharepoint@domain.com"
# $msg.IsBodyHtml = $true

Hope you find this useful. Check out Michael Blumenthal’s blog for more useful PowerShell scripts for SharePoint.

2 comments

Free SharePoint Backups (4 of 4)

SharePoint
This entry is part 4 of 4 in the series Free SharePoint Backups

This is the 4th and final article of the Free SharePoint Backups series. If you haven’t already, check out:

So, in the last article of the series we’ll look at some of those 3rd party products. I have to first say that I am not employed or paid by any companies mentioned here. Also, I have not tested every product in detail, these are just some that I have used or seen demos on. You can bing (or google) SharePoint Backup Products and get many many more.

Product: Symantec BackupExec with SharePoint Plugin (link)
Features:

  • Supports both Microsoft Office SharePoint Server 2007, Microsoft SharePoint Portal Server 2003 as well as Windows SharePoint Services 2.0/3.0.
  • Using a 32-bit or 64-bit Backup Exec 11d media server, this agent can protect 32-bit or 64-bit MOSS-2007 servers and can protect Single-Server or Multi-Server Farms.
  • This Agent also comes bundled with the innovative Granular Recovery Technology (GRT) that helps IT Administrators save time and money by giving them the ability to restore individual documents from a single-pass database backup.

Comments: I think this is one of the less expensive options. BackupExec is good software and you can use it to backup file shares, Exchange and other products.

Product: Idera SharePoint Backup (link)
Features:

  • Automated scheduling of backups
  • Self-service document recovery for site users
  • Central management of backup and recovery operations
  • Save space – compress backups by up to 95%
  • NEW: Differential backups save time and storage space
  • Comments: I really like the fact that users can recover their own items. This product looks promising. There are whitepapers and datasheets on the vendors website.

    Product: AvePoint DocAve Backup & Restore (link)
    Features:

    • Intelligent, Business-Aware Protection
    • True Enterprise-level SharePoint Backup
    • Restore With Minimal Business Interruption and Data Loss
    • Satisfy Stringent RTO’s and RPO’s Within Your SLAs
    • Reduce Human Errors by Simplifying Full System Backup
    • Deployment and Management
    • Compliance with Government Regulations

    Comment: AvePoint’s product is just one you have to see to realize its power. The site is great and has tons of information including a free download of a backup product. Additionally, AvePoint offers several other SharePoint products for IT Administrators. If you have NetApp hardware, check out SMMOSS.

    Product: metalogix Archive Manager for SharePoint (link)
    Features:

  • SharePoint Archiving
  • Archiving Methods
  • Global SharePoint Archive
  • Compliance Management
  • Lifecycle Management
  • Disaster Management
  • User Transparency
  • Comments: I’m not sure if I could consider this a full backup product in terms of disaster recovery. Nonetheless, it seems like a great tool to manage SharePoint.

    Product: Mimosa Systems NearPoint for SharePoint (link)
    Features:

  • Recovery
  • Storage Cost Management
  • Migration
  • Retention Management
  • eDiscovery
  • Comments: This product seems close to Idera’s product. I haven’t really tested it.

    For more detailed reviews of backup and other products, check out SharePointReviews.com. This is a great site, it is packed with user reviews of many 3rd party products with ratings and all.

    And that’s a wrap!

    0 comments

    Free SharePoint Backups (3 of 4)

    SharePoint
    This entry is part 3 of 4 in the series Free SharePoint Backups

    This is the 3rd article of the Free SharePoint Backups series. If you haven’t already, check out:

    In the 3rd article, we’ll talk about some of the other things that need to be backed up on a SharePoint server. I have scripts for these too!

    There are two primary components besides the sites that need to be backed up. You may never use these but they take up little space and would come in handy in some disaster recovery scenarios. The two components are:

    • The IIS metabase: The metabase is a repository for most Internet Information Services (IIS) configuration values.
    • Note: This applies to IIS6 only. IIS 7.0 uses XML to store configuration data, more on that later.

    • The 12 hive: The 12 hive is a folder location that contains templates, themes, features, etc for SharePoint. Its especially important to back this up if you’ve made cuztomizations.

    I’ll show you the batch file and then explain it. Here it is

    @ECHO OFF
    ECHO ================================================
    ECHO Backup Script For Office SharePoint Server 2007
    ECHO        Written By: Wahid Saleemi
    ECHO ================================================
    cscript C:\Windows\System32\iisback.vbs /backup /b sharepoint /overwrite
    COPY /Y C:\Windows\System32\inetsrv\Metaback\sharepoint.* G:\Backups\IIS
    robocopy "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12" G:\Backups\12\ /MIR /ZB /SEC /V /LOG:D:\BackupBatch\12hive.log
    cscript D:\BackupBatch\reportlog.vbs

    This batch file calls iisback.vbs, which should be installed already. It will name the backup “sharepoint.” For details on how it works, see this TechNet article: Backing Up IIS Configurations using iisback.vbs

    Next, we use a simple COPY command to copy the backup files to an alternate location. In my example its the G:\Backups\IIS folder. I use another backup utility to archive this to a remote disk library.

    Then, we’ll use robocopy to copy the 12 hive. Robocopy is a very useful app! It comes with Windows Server 2008 but if you’re still on 2003 you can download it from Microsoft. The example above assumes SharePoint is installed in its default location.

    Finally, we run a vbscript similar to the last post that will send us the report to our email so we can review it. Here’s the vbscript.

    '--------------------
    ' Send Email
    '--------------------
    Dim FSO, objShell
    Dim strVirt, strPath, strReportTo
    Dim strFileName, strTempFile, strLogFile
    Dim dtmThisMinute, dtmThisHour
    Dim dtmThisDay, dtmThisMonth, dtmThisYear
    
    'dtmThisSecond = PadDigits(Second(Now), 2)
    'dtmThisMinute = PadDigits(Minute(Now), 2)
    'dtmThisHour = PadDigits(Hour(Now), 2)
    'dtmThisDay = PadDigits(Day(Now), 2)
    'dtmThisMonth = PadDigits(Month(Now), 2)
    'dtmThisYear = Year(Now)
    
    	' Define consts
    	Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
    	Const cdoSendUsingPort = 2
    	Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    
    	' This is the sender of the report
    	strVirt = "http://sharepoint.domain.com"
    	strSMTPServer = "mailserver1"
    	strReportTo = "portaladmin@domain.com"
    	strFrom = "report@domain.com"
    	strLogFile = "D:\BackupBatch\12hive.log"	
    
    	' This is the subject
    	strSubject = "SharePoint IIS/12 Backup Report for " & dtmThisYear & "-" & dtmThisMonth & "-" & dtmThisDay & "-" & dtmThisHour
    
    	Set objMessage = CreateObject("CDO.Message")
    	Set objConfig = CreateObject("CDO.Configuration")
    	Set objFields = objConfig.Fields
    
    	With objFields
    		.Item(cdoSendUsingMethod) = cdoSendUsingPort
    		.Item(cdoSMTPServer) = strSMTPServer
    		.Update
    	End With
    
    	With objMessage
    		Set .Configuration = objConfig
    			.To = strReportTo
    			.From = strFrom
    			.Subject = strSubject
    			.AddAttachment strLogFile
    			.HTMLBody = "Attached is your IIS and 12 Hive backup for " & strVirt
    	End With
    
    	objMessage.Send
    
    	Set objMessage = Nothing
    	Set objConfig = Nothing
    	Set objFields = Nothing
    	strHTMLBody = vbNullString
        strFrom = vbNullString
        strSubject = vbNullString
    	arrEmailAddress = vbNullString
    	intArraySize = vbNullString
    

    Regarding IIS 7.0 (Windows Server 2008) and the metabase: IIS 7.0 doesn’t use a metabase. It uses the applicationHost.config file. You can read Robert McCurray’s Blog for more details. So, for Windows Server 2008, instead of using the script above, use the one below. It’s Robert McCurray’s script plus some additions:

    @echo offcls
    DEL /Y %WinDir%\System32\Inetsrv\Backups\*
    pushd "%WinDir%\System32\inetsrv"
    
    echo.| date | find /i "current">datetime1.tmp
    echo.| time | find /i "current">datetime2.tmp
    
    for /f "tokens=1,2,3,4,5,6" %%i in (datetime1.tmp) do (
      echo %%n>datetime1.tmp
    )
    for /f "tokens=1,2,3,4,5,6" %%i in (datetime2.tmp) do (
      echo %%m>datetime2.tmp
    )
    for /f "delims=/ tokens=1,2,3" %%i in (datetime1.tmp) do (
      set TMPDATETIME=%%k%%i%%j
    )
    for /f "delims=:. tokens=1,2,3,4" %%i in (datetime2.tmp) do (
      set TMPDATETIME=D%TMPDATETIME%T%%i%%j%%k%%l
    )
    
    appcmd add backups %TMPDATETIME%
    
    del datetime1.tmp
    del datetime2.tmp
    
    set TMPDATETIME=
    
    popd
    echo.
    COPY /Y %WinDir%\System32\Inetsrv\Backups\* G:\Backups\IIS
    robocopy "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12" G:\Backups\12\ /MIR /ZB /SEC /V /LOG:D:\BackupBatch\12hive.log
    cscript D:\BackupBatch\reportlog.vbs

    As you can see, even with built-in tools and at no cost, you can still design a backup solution that is somewhat robust. This is a good starting point. However, for a larger production environment, you should really look at a 3rd party backup solution. We’ll look at some of these in the last post of this series.

    0 comments