Configuring SharePoint published reports for email delivery

Today someone wanted to give himself a subscription on a SharePoint published report. When he right clicked on the report and chose “manage subscription”, the email option wasn’t there (See screenshot below).

 No email subscription available

To get this functionality is something really simple. Just configure your reporting server with email functionality by using the Reporting Services Configuration Manager

 Reporting Services Configuration Manager

EC2: Windows activation

Today I had a problem with a Amazon EC2 Windows instance. It said “this copy of windows is not genuine”. I tried to activate it, but it kept giving me errors.

After some searching on the EC2 Forums I found this post which helped me out.

In short:

1. Open "C:\Program Files\Amazon\Ec2ConfigService\Settings\DnsSuffixSettings.xml"
2. Remove the extra </RegionMapping> tag from line 34
3. Open "C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml"
4. On line 34, change the state of EC2WindowsActivate plugin from Disabled to Enabled
5. Stop and Start the Ec2Config service
6. Wait couple minutes and then run slui.exe to verify Windows is activated (for core installation use "slmgr.vbs /dli")

SQL: getting column information

To retrieve a list of column information for a table using T-SQL, use the following method:

SELECT
   ORDINAL_POSITION
  ,COLUMN_NAME
  ,DATA_TYPE
  ,CHARACTER_MAXIMUM_LENGTH
  ,IS_NULLABLE
  ,COLUMN_DEFAULT
FROM
  INFORMATION_SCHEMA.COLUMNS
WHERE
  TABLE_NAME = '<your table>'
ORDER BY
  ORDINAL_POSITION ASC; 
 
 

thanks to the original poster.

PowerShell: backup your SQL Agent Jobs

I needed to backup some SQL Agent Jobs. I decided to save them to a file, but I wanted to schedule this (in the event they might change).

Below the PowerShell Script I used


[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.Smo') | Out-Null
$serverInstance = "."

$server = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $serverInstance

$jobs = $server.JobServer.Jobs | where-object {$_.category -eq "[your category]"}

if ($jobs -ne $null)
{

ForEach ( $job in $jobs )
{
$FileName = "d:\backup\SQLjobs\" + $job.Name + ".sql"
$job.Script() | Out-File -filepath $FileName
}
}

PowerShell: IP Address Details

It irritates me that when I execute the command “IPConfig” to get my current DHCP IP Address, I get a large list of all kind of adapters in which I am not interested. I then have to scroll up in the Command Prompt windows to find my IP Address.

Command Prompt

As a project of my own to get to learn PowerShell more, I decided to make a PowerShell Function which would give me the current IP Address. As I went along, I added an extra feature which displayed my current external IP Address.

Below is the PowerShell Function:

Function GetMyIP
{
$NetworkAdapter = gwmi win32_networkadapterconfiguration | where {$_.DHCPEnabled -and $_.DNSDomain -ne $null}
$SourcePage = "href="http://automation.whatismyip.com/n09230945.asp">http://automation.whatismyip.com/n09230945.asp"
$WebClient = new-object System.Net.WebClient
$ExternalIP = $WebClient.downloadString($SourcePage)

Write-host "IP Address IPV4: "$networkadapter.IPAddress[0]
Write-host "IP Address IPV6: "$networkadapter.IPAddress[1]
Write-host "Gateway Address:" $Networkadapter.DefaultIpGateway
write-host "External IP Address:" $ExternalIP
}

Windows 8: installing in VMware Workstation 8

Most of you will know that Microsoft released a developer preview of the next version of Windows 8. You can download the ISO it here.

I downloaded the ISO and tried to install it as a Virtual Machine (vmware workstation 8 because vmware v7.1 gave me an error).
During initial startup for install I received the following error:

Windows cannot read the <ProductKey> setting from the unattend answer file

Windows cannot read the <ProductKey> setting from the unattend answer file 

This is because of the fact that VMware is mounting an floppy disk with an autoinst.flp file.

Just disconnect your floppy drive and try again.

Disconnect Floppy Drive

SQL: installing SQL server on Windows 7 Dutch

When you install SQL server 2008 R2 on Windows 7 Dutch, it is possible you will receive the following error during the “setup support rules” phase: Performance counter registry hive consistency

Setup Support Rules

The solution was found here: http://bertvanvreumingen.blogspot.com/2010/11/performance-counter-registry-hive.html

In short:

  • export the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009
  • Edit the registry file you just created and change the value 009 to 013, resulting in:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\013
  • Merge the registry file and re-run the “setup support rules”

PowerShell: Count Files in Folder and write to file

For my own backlog:

$subfolders = Get-childitem <path to folder> -recurse | where {$_.psIsContainer}
foreach ($subfolder in $subfolders)
{
$filecount = (dir $subfolder.fullname  | where {$_.GetType() -match "fileInfo"}).count
if  ($filecount -ne $null)
    {
        write-output "$($subfolder.fullname) `t$($filecount)" | Out-File $resultfile -append
    }
}

BPOS: calendar meetings and send on behalf of permissions

I just noticed something.

We have a mailbox which we use with multiple people. But this mailbox is also used for sending out mail from software and servers (via SMTP authentication).

In order to use the mailing from software, we had to give the mailbox permissions to send out mail (send as or send on behalf of).

Now we had the following issue, the mailbox mentioned above (the system mailbox) had send on behalf permissions on the mailbox of user-A. Whenever user-A received a meeting request it also ended up in the system mailbox.

How weird is that?
As we read through the BPOS manual we see this:

Send on Behalf Of Access

Send on Behalf Of access is similar to Send As access except that when the delegate user sends mail for the mailbox owner, the From field of the message will read "Sent on behalf of mailbox owner by delegate user."

The Send on Behalf Of parameter sets delegate access for the specified mailboxes, and enables the default Microsoft Outlook settings for delegates, including default folder permissions and meeting request behavior.

So the system mailbox becomes a delegate of the user-A mailbox. And this means:

By default, when you add a delegate, the delegate has full access to your Calendar and Tasks folders. The delegate can also respond to meeting requests on your behalf.

So.. setting just the send as permission was more then enough.