I got this error today while trying to access my new SharePoint 2010 environment via PowerShell:
Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.
If I would have just read the error message a little more carefully, I would have realized that I should start by looking at my permissions in SQL – which my account didn’t. This happened because I installed SQL Server 2008 R2 in my virtual machine while I was logged on as the local administrator. When I was attempting to run PowerShell, I was logged on as the domain administrator. (These are virtual machines that I’m using for demos….). The local administrator was granted access automatically as part of the SQL install.