quarta-feira, 28 de agosto de 2013

Recover a SSL Certificate lost private key on Windows Server 2008 R2

So you get the certificate, import it to the Computer Certificates store, and then you want to use it on IIS or other application which requires a certificate, like, Forefront TMG.

And you notice that your recently added certificate is not there. To recover it, just follow the steps provided by Entrust on this very easy to follow how to: http://www.entrust.net/knowledge-base/technote.cfm?tn=7905

sexta-feira, 8 de março de 2013

Binding a SSL Certificate to Website Error: HRESULT: 0x80070520

Hello,

today I faced a problem with IIS and Certificates. The error was:

HRESULT: 0x80070520

I found a very good article here: http://blogs.msdn.com/b/kaushal/archive/2012/10/07/error-hresult-0x80070520-when-adding-ssl-binding-in-iis.aspx

In my specific case the problem was the permissions. I had to remove the certificate and set Administrators as Full Control to 'THIS FOLDER ONLY' and Everyone with Full Control over the entire folder.

After that imported the certificate again and it worked.

I am a bit worried with the Everyone permission, but this was the recommendation from this article: http://msdn.microsoft.com/en-us/library/ee248638%28v=vs.100%29.aspx

And, another problem solved!

domingo, 17 de fevereiro de 2013

Export Installed Updates in Windows Server 2008 or 2008 R2

There is a quick command to export in a nice CSV format all installed updates in a Windows Server 2008 or 2008 R2 system:

1. Open a command prompt

2. Type: wmic qfe get /format:csv >C:\updates.csv

What is the benefit of it? This is a way to build a Changelog to track the changes performed in the system. Each Month or Scheduled update 'day' export the changes, so you can see the history of applied patches.

quinta-feira, 14 de fevereiro de 2013

Find the Shares from your DFS Namespace

DFS Namespace information can be easily exported to a nice XML file with the command:

dfsutil root export \\domain\namespacename C:\Export.xml

But now you have a XML file, which is not the best file type to work with and check important info. Basically what I will show you is a small script in Powershell that parses the XML and return the ONLINE targets sharename, but you can adapt to return the info you need.

# Parsing XML from Namespace
[xml]$dfs = Get-Content output.xml
$output = @()
foreach ($link in $dfs.Root.Link)
{
    if ($link.Name -match "DEEI\\Groups")
    {
        $user = $link.Name.Split("\")


        foreach ($target in $link.Target)
        {
            $shareName = $target.get_InnerXml()
            if ($target.state -eq "ONLINE")
            {       
                $output+=$sharename
            }
        }
    }
}       
$output | Out-File '.\OUTPUT-SHARE.TXT'


The small script above returns all shares which are ONLINE and output them to the OUTPUT-SHARE.TXT. It takes as input the file 'output.xml' which is the xml from the namespace.

Feel free to adapt it. Please let your comment.