IT Blog

Archive for March, 2011

SSL Certificate add failed, Error: 1312

by on Mar.25, 2011, under Microsoft

You are trying to bind SSL certificate ot a port number using the the following command:
netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF}

The command failes with error:
SSL Certificate add failed, Error: 1312
A specified logon session does not exist. It may already have been terminated. (continue reading…)

1 Comment :, , more...

Change registry permissions

by on Mar.18, 2011, under Microsoft, Other

So lets say you need to change registry permissions and give all domain users full rights to a specific key HKEY_LOCAL_MACHINE\SOFTWARE\My_App.
You can use Group Policy but also you can use a batch file. Batch file can be setup to run on system startup or you could push it with SCCM if you have it installed.

To change registry permissions you can use regini.exe and it should be on every Windows host but I think there is a better and easier tool(well at least to me) and it is called SetACL. This tool can be used to manage not only registry permission but also File Permissions, Auditing etc.
First download SetACL and from the download package extract command line version as this is what will be used in the script to c:\temp. There are 2 versions 32bit and 64bit, choose the one you need. (continue reading…)

Leave a Comment :, , , more...

Powershell command would not run

by on Mar.14, 2011, under Other

Here is my first Powershell problem. I’m not good in powershell as I don’t use it too often but ussually i find my way pretty quickly. Well except this time…
So here is my problem:
I have old Altiris Deployment server that I use for deploying server images. When I’m imaging 2008R2 servers I need to install server Roles and Features. Powershell here comes pretty handy as I only have to use Add-WindowsFeature command plus a list of Roles or Features that I want to add.
I created a file called powershell.ps1 that adds all the roles and features that I need plus does some configuration. I ran powershell -command powershell.ps1 on the test server to see if everything is installed and configured as expected. Everything went OK.
So next in Altiris I create a new job that copies a powershell.ps1 file and then runs it. (continue reading…)

2 Comments : more...

A problem occured while installing selected Windows SDK components. Unknown property.

by on Mar.09, 2011, under Microsoft, Other

Here is one of the problems that took me some time to figure out.
I had to install Microsoft Windows SDK for Windows 7 and .NET Framework 4 on Server 2008 R2. But it would not install.
There are 2 ways to install it:
Web install using winsdk_web.exe a small too that download all the files during installation.
ISO imgae that has all required files already.
I’ve tired both methods and bot of them failed almost instantly with the following error message:
A problem occured while installing selected Windows SDK components. Unknown property.

(continue reading…)

8 Comments :, more...

System.Exception: No certificate was found in the cert store for user

by on Mar.05, 2011, under Microsoft

Recently I’ve wrote about certificate problem in WCF applications. Here is another one:
When starting WCF application the following error is logged Event ID: 0

Internal exception occured: System.Exception: No certificate was found in the cert store for user: comp_1\WCF_AppUser

So first lets see what certificate is the application looking for. Locate the application files and open application config file with notepad.
Now search for serviceCertificate you should see the line like below:
<serviceCertificate storeLocation=”LocalMachine” storeName=”My” x509FindType=”FindBySubjectName” findValue=”*.domain.local”/>

As you can see the application is looking for * wildcard certificate called *.domain.local
Open Certificates management console and make sure that the certificate named in config file is there. If not, you need to import it.
(continue reading…)

Leave a Comment more...

How to read registry value remotely in all computers in the domain

by on Mar.04, 2011, under Microsoft, Other

I had a task to find out what versions of PowerShell we have installed on the computers in the domain.
PowerShell version is stored in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine\
There is a a string called PowerShell version and the value of the string is the version of the PowerShell that is installed on the computer.
After looking around I came up with the following script:

On Error Resume Next

Dim objGroup, objFSO, strFile, objFile

Const HKEY_LOCAL_MACHINE = &H80000002
Const ForWriting = 2
Const OpenAsASCII = 0
Const CreateIfNotExist = True
Const ADS_SCOPE_SUBTREE = 2

strFile = “c:\powershell.txt”
(continue reading…)

1 Comment more...

Cannot load the X.509 certificate identity specified in the configuration

by on Mar.03, 2011, under Microsoft

You have a WCF application and trying to run it but it would not start.
In application event log you see Error event logged with Event ID 0:
2011-02-02 13:46:52 [(null)] [ApplicationName] [FATAL] -
— Exception data associated with the Log entry —System.InvalidOperationException: Cannot load the X.509 certificate identity specified in the configuration.
at System.ServiceModel.Description.ConfigLoader.LoadIdentity(IdentityElement element)
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor()
(continue reading…)

Leave a Comment more...