Categories
Windows 2008

AD DS : Find Users with Specific Home Drive Path

AD DS : Find Users with Specific Home Drive Path

I had to move some users home directories from one server to another recently, the users Mac users had their home drive set in AD DS rather than using folder redirection determined by Group policy.

In AD Users and Computers I used the following customer search to identify all of the users; change *server name* to suit your environment:

{code lang:css showtitle:false lines:false hidden:false}(&(objectClass=user)(objectCategory=person)(homeDirectory=*server name*)){/code}

For example, if your file server waqs called FILESRV1 you would change the query to use *FILESRV1*:

{code lang:css showtitle:false lines:false hidden:false}(&(objectClass=user)(objectCategory=person)(homeDirectory=*FILESRV1*)){/code}

Categories
Exchange Server 2007

Exchange : Database Sizing Scripts

Exchange : Database Sizing Scripts

I’ve recently been asked to size some Exchange 2007 environments for migration to Exchange 2010; specifically database sizes. I used the following scripts to perform this task.

Export User Mailbox Sizes

This script will give you an idea of allocated storage, regardless of Single Instance Storage – this is important as Exchange 2010 no longer includes Single Instance Storage. Microsoft suggest that you should allow a 15% increase in storage, in reality I’ve found this to be a very accurate figure to go by. Change the server name in the script an you’re good to go.

{code lang:css showtitle:false lines:false hidden:false}Get-MailboxServer <server name> | Get-MailboxStatistics | Sort -Property TotalItemsize | select-object DisplayName, LastLoggedOnUserAccount, ItemCount, @{name=”Size(MB)”;expression={$_.totalitemsize.value.ToMB()}} | export-csv stats.csv{/code}

Find Database File Size

This script will show the physical file size of each database. Remember this will not give an indication of the true data size of all user mailboxes, unless you add approx 15% to the size (YMMV). Again, change the server name.

{code lang:css showtitle:false lines:false hidden:false}Get-ExchangeServer <server name> | Get-MailboxDatabase | foreach-object {add-member -inputobject $_ -membertype noteproperty -name mailboxdbsizeinMB -value ([math]::Round(([int64](get-wmiobject cim_datafile -computername $_.server -filter (‘name=”’ + $_.edbfilepath.pathname.replace(“\”,”\\”) + ””)).filesize / 1MB),2)) -passthru} | Sort-Object mailboxdbsizeinMB -Descending | format-table identity,mailboxdbsizeinMB{/code}

Database Whitespace

If you are using Enterprise Vault or something similar chances are you’ll have a good chunk of white space in your database which you wont need to provision for on the new environment. To identify the amount of white space in your database files use the code below, execute on the Mailbox server itself.

{code lang:css showtitle:false lines:false hidden:false}$yesterday = [DateTime]::Now.AddDays(-1)
$Events = Get-Eventlog Application | Where {($yesterday -le $_.TimeWritten)} | ?{$_.eventid -eq “1221”}
$Events | select-object Message | ft{/code}

Categories
General Site News

Joomla : Using a CDN/Setting Up Your Own

Joomla : Using a CDN/Setting Up Your Own

Like me you’ve probably read the hype about Content Delivery Networks that keeps doing the rounds. Want to energize/supercharge your blog?!…heh.

Still, being in the mood to improve the sites I host I decided to give it a go and see if the reality lived up to the hype. I suppose part of me missed the feature I never got to properly try on iPage – the Akamai CDN plugin. This would probably have been easier to setup with that!

Why?!

Why you ask? Well the science behind it is simple really. Most modern browsers support up to 6 concurrent connections per hostname (http://www.browserscope.org/?category=network&v=top), by using multiple hostnames you can download content in parallel, or put simply, using two hostnames would allow 12 concurrent connections for your site content, three would provide 18 etc. There are limits as to how effective this become, and most would suggest that you don’t go above four hostnames for your content. You’ve also got to have the bandwidth available to download using all of these concurrent connections so those poor users still on dial-up are unlikely to benefit much.

Who and Where?!

There are a lot of paid services from companies like Akamai, MaxCDN and Amazon, and there are a few free services from companies like CoralCDN, CloudFlare and Incapsula, you can also setup your own CDN (a very limited version of any of the previously mentioned companies) using a subdomain, I’ll also show you how to do this. Using a paid for service, like most things in life, will get you the most functionality, but that doesn’t mean that the others are worth a look.

For my requirements a paid for service wasn’t really necessary so I opted to try CloudFlare and also making my own subdomain and serving content from there. Again, as per my recent article on hosting companies, I’m not fussed which one you choose, or if you choose to use one at all in fact – I opted to use my own subdomain in the end. Why do I say limited? Simply because you’re still restricted to a single host really, and the same host if you follow my guide below. Using a provider like CoralCDN or CloudFlare you’re providing content closer to your users as these networks have servers around the globe as opposed to your single(?) server.

Many other options are out there, this article is designed to get you looking at what is available and testing a few of these options.

Categories
Linux

Apache : Usefull .htaccess Configurations

Apache Usefull .htaccess Configurations

I came across the following useful .htaccess configuations over at https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L169.

Rewrite www.cb-net.co.uk -> cb-net.co.uk
{code lang:ini showtitle:false lines:false hidden:false}<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>{/code}
 
Conversley rewrite cb-net.co.uk -> www.cb-net.co.uk
{code lang:ini showtitle:false lines:false hidden:false}<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>{/code}
 
Protect access to backup files, including Akeeba backup files for Joomla
{code lang:ini showtitle:false lines:false hidden:false}<FilesMatch “(\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist|jpa)|~)$”>
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>{/code}
 
Prevent access to hidden files
{code lang:ini showtitle:false lines:false hidden:false}<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} -d
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule “(^|/)\.” – [F]
</IfModule>
{/code}
Categories
General Site News

Hosting Move Complete

Well that was easy… Move was completed today, no downtime… thank you Akeeba backup/kickstart – seriously good product if you are using Joomla, I even use it to create my dev sites. Took me less than 15 minutes to move this site, including the FTP transfers!

The site also seems to be a little nippier; so long Hostmonster, hello Bluehost 🙂

Categories
General Site News

Hosting Nightmare

Its that time, I’ve had the renewal reminder and Hostmonster are offering renewal at an inflated price, as every hosting company does (and insurance company or that matter, whatever happened to customer loyalty?) – so I do what anyone would do and trawl the ‘net trying to find the best hosting deal out there.

Right… before we go any further lets make something clear. I have nothing to gain from this article, no allegiance to ANY hosting company. Currently the site your now reading from is running on Hostomster, why..? Because I didn’t have the time to review the hosting packages available to me at the time of last renewal… and before then, well Hostmonster was nice a cheap…. 🙂

Part of my issue with finding a useful host was the bulls**t review sites out there that, lets not hold any punches here, are obviously sponsored by the hosting companies themselves. I read too many biased reviews and saw far too many completely different ‘top 10 hosting companies’ awards that I lost faith entirely and took to pot luck… that was my second mistake (the first was reading the review sites…)

I host a small number of small sites with low traffic requirements, my requirements are not out of the ordinary – Joomla hosting pretty much covers it. From whatever hosting I choose I expect an intuitive interface, good support and above to get what I was promised.

Now where was I… ah yes, initially I come across the GoDaddy 4GH Ultimate package; features included (at time of writing) an SSL certificate, static IP and the usual unlimited bandwidth/storage (including fair use policy rubbish and all that you get with every shared hosting provider). So I signed up and started to transfer my data across… that’s when the fun started.

GoDaddy 4GH

Firstly, the GoDaddy way of doing things appears to be to fragment the administration of hosting features into as many different control panels as possible… one for SSL, one for Email, one for Hosting… I’m not daft (at least I like to think I’m not!) but its a mess, period.

Next there’s no support for IMAP… huh?! This is an Ultimate hosting plan, they offer no better shared hosting… of course you can have IMAP if you upgrade your email hosting from the basic package supplied with the hosting deal (see where the separate control panels come in – email is essentially a seperate product from your web hosting).

The worst thing was however the level of additional customisation, and additional issues I had moving the site across. I kept getting the PHP ‘no input file specified’ when I was in the Joomla Administrator interface; this then stopped the entire site working for up to 20 minutes. Remember, this site worked just fine with the previous host. My encounter with GoDaddy support wasn’t inspirational either, I laid out all of the steps I had taken to try and resolve the problem myself using the .htaccess file, and yet was advised I should probably make some changes (all of which I had already advised I had done) to the .htaccess file… cunning!

I never got the issue resolved and had to rollback the migration; I’d been through every additional configuration I found on the GoDaddy forums, via their support and even trawling Google search results. I’m certainly not the first person to encounter this issue with Joomla (or Magento) running on GoDaddy shared hosting. Needless to say this was a nightmare.

Finally, there was the issue of performance. I’ll admit it, I was suckered in by the 4GH thing… the reality was that it was certainly no faster when the website I moved across was working, if anything it was slower. Experiential learning 0, stupidity 1 – lesson re-learnt on this occasion: when something sounds too good to be true it generally is.

iPage (aka Fat Cow)

So, here we are again… prices that look too good to be true, features that sound, well amazing for the money. The good news is that iPage support IMAP (at no additional cost!) and that they operate a single control panel (vDeck)… after GoDaddy this was a revelation. vDeck is not as intuitive is cPanel, but unless you’re particular about your control panels I think you’d get over it quickly enough.

The bad news came after I restored a site; no InnoDB support. What on earth is InnoDB you ask? Well I found myself asking just that very question. For a number of the sites I have built I use Rocket Theme extensions and Themes, some of which (RokGallery) require InnoDB. I didn’t fancy redesigning or rebuilding these sites with new templates and extensions, so iPage was gone.

In their defence the support response I got was almost instant, I liked the administration interface and loved the option to use the Akamai CDN for free, as well as the Site Lock subscription being part of the hosting package…. had they supported InnoDB that is where this site would be hosted today.

Bluehost (AKA Hostmonster)

So where did I end up (or will I end up)… Bluehost, which is one and the same as Hostmonster, only instead of paying $6.95 /month I’ll pay $3.95 for exactly the same service, on exactly the same servers, in exactly the same datacenters supported by exactly the same people. No revolutionary 4GH technology, or indeed ‘green power’ but it will work, and will continue to work as it has done for the last 4 years without issue… YMMV.

Lets face it people, the worlds economy is in a mess and money matters…. #rantover.

Categories
Windows 2008

Windows 2008 R2 : Failover Cluster Manager – Move Cluster Group

Windows 2008 R2 : Failover Cluster Manager – Move Cluster Group

You’ve probably noticed that in Failover Cluster Manager you don’t have the option to move the cluster group resources like you did in Windows 2000/2003. It is possible to move this group, however you’ll have to use either Windows Powershell or Command Prompt to achieve this.

Using Windows Powershell:
  Move-ClusterGroup “Cluster Group”
  Move-ClusterGroup “Available Storage”

Using the CLI and cluster.exe:
  cluster group “Cluster Group” /move
  cluster group “Available Storage” /move

Categories
Lansweeper

LANSweeper : Query SQL Server Version

LANSweeper : Query SQL Server Version

SQL version information is stored in the registry, its location varies depending on server architecture (x86/x64) and SQL Instance name.

This is how I achieved this….

Added the following Registry paths to be scanned by LANSweeper (you may not need all of these, could well need to add some of your own):

RegKey ValueName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.2005\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SHAREPOINT\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.SOPHOS\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SHAREPOINT\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Setup Edition

Next, scan all of your machines.

Finally use the following code to return the information for your domain, by version:

{code lang:sql title:”LANSweeper Query SQL Version” lines:false hidden:false}Select Top 1000000 tblComputers.ComputerName, tblComputers.ComputerUnique As Machine , tblSoftware.softwareName As Product, tblRegistry.Value As ‘Version’,
tblComputers.Domain

From tblSoftware
Inner Join tblComputers On tblSoftware.ComputerName = tblComputers.Computername
Inner Join web40ActiveComputers On tblComputers.Computername = web40ActiveComputers.Computername
Inner Join tblRegistry On tblComputers.Computername = tblRegistry.Computername

Where tblSoftware.softwareName Like ‘Microsoft SQL Server%’ And tblRegistry.Valuename = ‘Edition’
And tblSoftware.softwareName Not Like ‘%Native Client%’ And tblSoftware.softwareName Not Like ‘%Policies%’
And tblSoftware.softwareName Not Like ‘%Setup%’ And tblSoftware.softwareName Not Like ‘%Browser%’
And tblSoftware.softwareName Not Like ‘%VSS%’ And tblSoftware.softwareName Not Like ‘%Books%’
And tblSoftware.softwareName Not Like ‘%Compatibility%’ And tblSoftware.softwareName Not Like ‘%Analysis%’
And tblSoftware.softwareName Not Like ‘%Management Objects%’ And tblSoftware.softwareName Not Like ‘%Design Tools%’
And tblSoftware.softwareName Not Like ‘%Studio%’ And tblSoftware.softwareName Not Like ‘%Query Tools%’
And tblSoftware.softwareName Not Like ‘%Best Practice%’ And tblSoftware.softwareName Not Like ‘%CLR%’
And tblSoftware.softwareName Not Like ‘%Advisor%’ And tblSoftware.softwareName Not Like ‘%Reporting%’
And tblSoftware.softwareName Not Like ‘%Data Mining%’ And tblSoftware.softwareName Not Like ‘%Wizard%’
And tblSoftware.softwareName Not Like ‘%AdventureWorks%’ And tblSoftware.softwareName Not Like ‘%Transact-SQL%’
And tblSoftware.softwareName Not Like ‘%Refresh 3 Samples%’ And tblSoftware.softwareName Not Like ‘%Developer Tools%’

Group By tblComputers.ComputerUnique, tblComputers.ComputerName, tblSoftware.softwareName, tblRegistry.Value, tblComputers.Domain
Order By tblSoftware.softwareName{/code}

Modify the code if you want to return the version per computer or anything else for that matter… 🙂

Categories
Lansweeper

LANSweeper : Unaligned Disk Report

LANSweeper : Unaligned Disk Report

The SQL below will display all disks, that are over 1GB in size and not a system boot disk, in an ‘un-aligned’ state.

Select Top 1000000 tblComputers.ComputerUnique, tblComputers.Computername, tblComputers.Domain, 
Web40OSName.OSname, tblOperatingsystem.Description, CAST(ROUND(((tblDiskPartition.size/1024)/1024)/1024,2,0) As Decimal(20,2)) As 'Size (GB)' , tblDiskPartition.StartingOffset, 
tblDiskPartition.DeviceID, 
CASE WHEN (tblDiskPartition.StartingOffset/4096 != ROUND(tblDiskPartition.StartingOffset/4096,0)) THEN 'FALSE' ELSE 'TRUE' END As 'Is Aligned?'

From tblDiskPartition 
Inner Join tblComputers On tblDiskPartition.Computername = tblComputers.Computername 
Inner Join tblComputersystem On tblComputers.Computername = tblComputersystem.Computername 
Inner Join tblOperatingsystem On tblComputers.Computername = tblOperatingsystem.Computername 
Inner Join web40ActiveComputers On tblComputers.Computername = web40ActiveComputers.Computername 
Inner Join Web40OSName On Web40OSName.Computername = tblComputers.Computername

Where tblDiskPartition.StartingOffset/4096 != ROUND(tblDiskPartition.StartingOffset/4096,0) 
and (tblDiskPartition.bootpartition = 0 or tblDiskPartition.BootPartition = NULL) 
and ROUND(((tblDiskPartition.size/1024)/1024)/1024,2) > 1

Group By tblComputers.ComputerUnique, tblComputers.Computername, tblComputers.Domain, Web40OSName.OSname, 
tblOperatingsystem.Description, Web40OSName.Compimage, tblComputers.Computer, tblDiskPartition.StartingOffset, 
tblDiskPartition.StartingOffset/4096, tblDiskPartition.size , tblDiskPartition.DeviceID

Order By dbo.tblComputers.Computer, Count(dbo.tblDiskPartition.Computername) Desc 

Categories
Exchange Server 2010

Outlook : Waiting to update this Folder…

Outlook : Waiting to update this Folder…

I encountered an issues recently with an outlook 2007 client that, when in cached mode only, would not automatically update maibox folder such as Inbox. In the bottom right of the window the user simply had “Waiting to update this folder…” The user was alo receiving “Out of Memory” error when trying to browse public folders.

On further investigation we noted that the users RPC requst count (shown in the Outlook Connection Status window – Ctrl-click the Outlook Icon) was very high and quickly increasing to the Public Folder server.

It became aparent that the user had many Public Folder Favourites defined, hundreds of folders with thousands of emails. In online mode we deleted the Public Folder Favourites, then deleted the users OST. Finally we set the user back to Cached Mode. This resolved their Outlook issues, and dramaically improved Outlook performance.