Thursday, June 21, 2012

Free E-book about Windows Server 2012

I haven't had a chance to read it yet, but Microsoft has made an e-book about Windows Server 2012 available free for download. You can get it here:

Friday, June 15, 2012

Sending Email from a PowerShell Script

As I move more batch jobs and scheduled tasks over to PowerShell, I've found that I often want to send some sort of status message when a script completes. The .NET Framework, which PowerShell uses, includes the Net.Mail.SMTPClient object that you can use to send email messages.

First you need to create a new instance of the object in a variable:
$mail= New-Object Net.Mail.SmtpClient("IPorDNSofSmtpServer")

Then, you can send the message:
$mail.Send("FromAddress","Recipient1,Recipent2","Subject","Body")

In most cases, you would use variables to define the addresses, subject, and body of the message.


Some potentially useful documentation:

KB 2720211 Kills WSUS

Updates were performed on a client's WSUS 3.0 SP2 server this week and KB 2720211 killed WSUS. Here are the symptoms we saw:
  • WSUSDB in single user mode (done as part of the failed update process, but not undone when the update failed)
  • Named pipes disabled (also I think done as part of the failed update process).
  • MMC for WSUS fails with "MMC has detected an error in a snap-in"
After doing some research, it seems that this update causes a problem for some servers and not others. This particular server Windows Server 2008 R2 64-bit. I'm not sure if that is part of the issue.

The resolve is:
  • Use SQL Server Configuration Manager to enable named pipes
  • Use SQL Server Management Studio to change the database to MULTI_USER
    • Stop the Windows Update service and World Wide Web Publishing service before connecting to allow you to use the single connection that is available.
  • Copy some files manually from the update into their correct location. I'm not sure why but it appears on some systems this is not being done.
    • Download and run WSUS-KB270211-x64.exe /extract to extract the files.
    • Use a program capable of extracting CAB files (7 zip) to open PCW_CAB_SUS and copy the files DbCert, DbCertDll, and DbCertSql
    • Rename those files to WSUSSignDb.cer, WSUSSignDb.dll, and WSUSSignDb.sql.
    • Copy the cer and dll file to: C:\Windows\Sysmsi\ssee\mssql.22005\mssql\schemasig
    • Copy the sql file to C:\Program Files\Update Services\Database
  • Rerun the update
Some others have also reported that there is a DCOM error that needs to be resolved.

For a great detailed description of how to resolve this look for the post by chucker2 in the microsoft forum link:
Some others have reported that a registry key needed to be modified in order for the update to install properly. Or perhaps, this is just an easier fix than the above. See this link:

Wednesday, June 6, 2012

Operations Manager Web Part Error

I created a lab exercise for course 10751A: Configuring and Deploying a Private Cloud with System Center 2012 that includes an Exercise on installing the new Operations Manager Web Part. This web part displays Operations Manager dashboards in SharePoint sites. By default, the dashboard is accessed based on the credentials you used to log on to SharePoint, but you can override this and use a single set of credentials for all users. This is useful when providing status information to people that do not have Operations Manager permissions.

As part of configuring the web part, you need to copy two encryption keys from the Operations Manager Web console into SharePoint. In earlier testing, with beta and release candidate software, this worked flawlessly. In our testing with RTM software we ran into a weird intermittent error where the dashboard could not be accessed by using the shared credentials.

In the web part the following message is displayed:
An unexpected error has occurred.

If you click the link to show error details, you see the following:
Microsoft.EnterpriseManagement.Presentation.Security.ConnectionSessionException: Unable to create connection session.

Imagine my concern when using the detailed error message resulted in zero results on Google. So, we tried a whole bunch of things, but what fixed it was uninstalling the Operations Manager Web console and reinstalling it. This regenerates the encryption keys in the Operations Manager Web console that are used for connectivity from SharePoint. After SharePoint was updated with the new encryption keys it worked without any issues.

I did verify that the shared credentials were being passed properly to the Operations Manager Web console. You can see this in the log for the Operations Manager Web console web site. No errors were displayed in that log. So, it must have been something at the .NET level which is a bit outside my area of expertise.

Ultimately, I don't know whether the encryption keys were the problem or the Operations Manager Web console was the problem. Uninstalling and reinstalling the Operations Manager Web console could have fixed either one.

Detailed steps for configuring the Operations Manager Web Part and shared credentials are here: