Posted August 10th, 2009 by Matt Shadbolt
While trying to restore a MSSQL 2008 .BAK file to a staging server, I received the following error:
The media family on device ‘C:\database_backup.bak’ is incorrectly formed. SQL Server cannot process this media family.
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)
This is actually an easy error to fix! The problem is due to the service pack level of the server you are trying to restore to. If you backup the database on a SQL 08 server with SP1 applied, you need to make sure the destination server is at SP1 level too.
Posted by Matt Shadbolt
http://mattlog.net
Please comment or click an ad to support this site
No Responses
Posted August 3rd, 2009 by Matt Shadbolt
I’m finally completing my MCSE certification with one exam to go, and I thought I’d quickly post on a great online training site that I’ve found.
Unfortunately I didn’t know about this site until recently, so I’m only using it for the one exam (70-294).
http://www.vtc.com
For only $30 per month, you get full access to their video training catalog including all of the major Microsoft exams. There’s also heaps of other courses including Photoshop, programming, Cisco and heaps of others. Even better, its a simple monthly fee. Once you’ve completed the certs your after you can just cancel the account.
The videos are good quality, broken down into chapters and includes slide-show style presentations and lab senarios. In conjunction with the MS Press books there’s no reason to fail!
Posted by Matt Shadbolt
http://mattlog.net
Please comment or click an ad to support this site
Tags: MCSE, Microsoft Training
No Responses
Posted May 18th, 2009 by Matt Shadbolt
Here’s a LogParser query I’ve written that will output the top hits for your website within the last 7 days. All you need to do is change the path of the log file location:
SELECT COUNT(*) AS Hits, cs-uri-stem AS Page
FROM D:\LogFilePat*.*
WHERE
TO_DATE(Date) >= TO_DATE(SUB(SYSTEM_TIMESTAMP(), TO_TIMESTAMP(‘01-07′, ‘MM-dd’)))
GROUP BY cs-uri-stem
ORDER BY Hits DESC
Tags: Hits last 7 days, LogParser
No Responses
Posted April 20th, 2009 by Matt Shadbolt
I’ve been having some issues with my maintenance plans in SQL Server 2005. I’ve been using the newer 2008 Server Management Studio to manage my SQL servers and it didn’t occur to me that the newer version would break my maintenance plans.
When I modify the plans in 2005 Management Studio I receive the following error:
The DDS layout contains an invalid control progid.
After opening the maint plans in 2005 and resaving them they are back to their old glory and working perfectly.
Tags: SQL Server 2005, SQL Server Management Studio 2008
No Responses
Posted April 17th, 2009 by Matt Shadbolt
Here’s a quick and dirty Exchange 2007 command-let that will output all the outgoing emails that are not being delivered. It Checks the message status (NOT “Active) and the message retry count (GT 0) and outputs the results.
Get-Message -Server SERVER01 -IncludeRecipientInfo | Where{$_.RetryCount -gt 0} | Where{$_.Status -ne “Active”} | SELECT FromAddress, Recipients, LastError | Format-Table
Tags: EMS, Exchange 2007, Get-Message, PowerShell
No Responses
Posted April 16th, 2009 by Matt Shadbolt
“The World Wide Web Publishing Service (WWW Service) did not configure logging for site X. The data field contains the error number.”
This warning will show up in your System event logs and you custom IIS logging to a SQL database won’t work. Obviously the message is fairly cryptic, however in a facepalm sort of moment I worked out what wasn’t working.
Two words. Custom Logging.
Although I had enabled the ODBC logging feature for IIS, I hadn’t enabled custom Logging. Once you enable the custom logging feature your SQL DB will start to fill with log entries. I’ve included the full warning message for those of you unsure.
- <Event xmlns=”http://schemas.microsoft.com/win/2004/08/events/event“>
<Provider Name=”Microsoft-Windows-IIS-W3SVC“ Guid=”{05448E22-93DE-4A7A-BBA5-92E27486A8BE}“ EventSourceName=”W3SVC“ />
<EventID Qualifiers=”32768“>1016</EventID>
<Keywords>0×80000000000000</Keywords>
<TimeCreated SystemTime=”2009-04-15T23:55:39.000Z“ />
<EventRecordID>46323</EventRecordID>
<Execution ProcessID=”0“ ThreadID=”0“ />
<Channel>System</Channel>
<Computer>SERVER01</Computer>
</System>
<Data Name=”SiteID“>3</Data>
<Binary>57000780</Binary>
</EventData>
</Event>
Tags: error data 80070057, Event ID 1016, IIS, IIS7
No Responses
Posted March 25th, 2009 by Matt Shadbolt
Here is s nifty script I chucked together that will prompt for a user name, configure the required permissions and then export the users mailbox to a PST file. All you need to do is change the $TargetArchiveDir location to the folder you wish to save the PST’s to. I’d suggest using a file share so the PST’s are saved in the same location no matter which admin exports the mailbox.
$TargetUserName = Read-Host “Enter the user you would like to Export”
$TargetArchiveDir = Get-Item “\\FILE-SERVER\ARCHIVE PST\”
$CurrentHostName = hostname
$CurrentProfile = Gwmi Win32_ComputerSystem -Comp $CurrentHostName
“Logged On As User: ” + $CurrentProfile.UserName
Write-Host “Setting Permissions” -ForeGroundColor Yellow
Add-MailboxPermission -Identity $TargetUserName -User $CurrentProfile.Username -AccessRights ‘FullAccess’
Write-Host “Exporting Mailbox” -ForeGroundColor Yellow
Export-Mailbox -identity $TargetuserName -PSTFolderPath $TargetArchiveDir -Confirm:$True
Write-Host “You can now Delete the user – I’m too scared to do it for you!” -ForeGroundColor Yellow
Note: You need to run this script on a 32-bit machine with the Exchange Administration role installed
Posted by Matt Shadbolt
http://mattlog.net
Please comment or click an ad to support this site
Tags: EMS, Exchange 2007, Export-Mailbox, PST
14 Responses
Posted March 24th, 2009 by Matt Shadbolt
You can remove your IP address from NetRegistry’s RBL list by checking it
http://ipadmin.junkemailfilter.com/remove.php?ip=$
Tags: NetRegistry, RBL
No Responses
Posted March 20th, 2009 by Matt Shadbolt
I’ve just worked out a nifty way to rename your GoldMine tabs to be more specific to the data enclosed. For example, I wanted to load our intranet with GoldMine variables in the GM+View tab – but wanted the tab name to look more appropriate.
You can add the following string to each USERNAME.ini file and it will override the default tab names on a user by user basis:
ROTabs1=Summary,Fields,INTRANET,Notes,Contacts,Details,Referrals,Pending,History,Links,Members,Tracks,Opptys,Projects,Tickets,Events,Licenses,Products,Renewal,Sales,Sent
Or, alternatively, you can change every users tab names by adding the following to the GM.ini file:
[User-OverRide:GoldMine]
ROTabs1=Summary,Fields,INTRANET,Notes,Contacts,Details,Referrals,Pending,History,Links,Members,Tracks,Opptys,Projects,Tickets,Events,Licenses,Products,Renewal,Sales,Sent
As you can see, you need to just change the tab name to the required text. Simple as that!
Please note that adding the ROTabs1 field to the .ini file won’t affect the ROTabItems1 values. The ROTabItems1 option holds the order in which each users tabs are displayed – and fickle users will get angry if you change it! All we are doing here is changing the default name mappings, NOT the order of the tabs.
Tags: GM+View, GM.ini, Goldmine, Goldmine Tab Names
One Response
Posted March 12th, 2009 by Matt Shadbolt
Man! I’m killing these powershell scripts today – and they’ve all been related to alerting/reporting via email. If you’ve missed my two other posts – there is a mailbox size report (http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/) and a StorageGroupCopyStatus report (http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/)
This one is a little more useful.
Basically, this PowerShell script checks the SummaryCopyStatus and checks that it’s “Healthy” – if not, it will send an email reporting which Storage Group copy has failed. You can run this script every hour or so, and be alerted when any SCR status has gone bad.
This is based on the same email code as my previous two posts. Bare in mind that I’m NOT a developer and my code is more than likely inefficient and ugly!
You can download the script CheckSCRStatus.ps1
Or view the code:
$SCRStatus = Get-StorageGroupCopyStatus -Server PRIMARYSERVER -StandbyMachine SECONDARYSERVER | Where {$_.StorageGroupName -eq “First Storage Group”}
if ($SCRStatus.SummaryCopyStatus -ne “Healthy”)
{
$MessageBody = “The SCR for ” + $SCRStatus.StorageGroupName + ” has failed”
$FromAddress = “FromAddress@yourdomain.com”
$ToAddress = “ToAddress@yourdomain.com”
$MessageSubject = “SCR Status Failure”
$SendingServer = “MAILSERVER”
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody
$SMTPMessage.IsBodyHtml = $true
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
$SMTPClient.Send($SMTPMessage)
}
Else
{
Write-Host “First Storage Group All Good!”
}
$SCRStatus2 = Get-StorageGroupCopyStatus -Server PRIMARYSERVER -StandbyMachine SECONDARYSERVER | Where {$_.StorageGroupName -eq “Second Storage Group”}
if ($SCRStatus2.SummaryCopyStatus -ne “Healthy”)
{
$MessageBody = “The SCR for ” + $SCRStatus2.StorageGroupName + ” has failed”
$FromAddress = “FromAddress@yourdomain.com”
$ToAddress = “ToAddress@yourdomain.com”
$MessageSubject = “SCR Status Failure”
$SendingServer = “MAILSERVER”
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody
$SMTPMessage.IsBodyHtml = $true
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
$SMTPClient.Send($SMTPMessage)
}
Else
{
Write-Host “Second Storage Group All Good!”
Exit
}
Tags: Exchange 2007, PowerShell, SCR, StorageGroupCopyStatus
No Responses