Archive for the ‘Microsoft’ Category

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

04 Mar

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

strFile = “c:\powershell.txt”

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

03 Mar

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()

Where is my disk space? Part 2

24 Feb

OK here we go again another server and another space issue.
Windows folder was taking 48GB which is a bit on the high side. So I was started cheking which file or folder is eating the space and found that c:\windir\winsxs\ was the one. Now there are a lot of folders in there and almos all  of them are needed. In c:\windir\winsxs\ManifestCache you should see a file or two called something xxxxxxxxxxx_blobs.bin and this one in my case was taking 23GB. The good news is that you can get rid of it and here is how:

Stop trustedinstaller service
Take ownership of the xxxxxxxxxxx_blobs.bin file
Grant yourself full right to the file
Delete the file.
Start trustedinstaller service

As soon as you start the service the file will be recreated but it will be much smaller.

Error: The security database on the server does not have a computer account for this workstation trust relationship

18 Feb

 I had to change the Primary DNS suffix to some servers. To do that the server were moved to a separate OU and a Group Policy was applied to that OU to change the DNS suffix.
I’ve issued gpupdate /force command on the servers and restarted them. After restart I was not able to login to some of them with my domain credentials. Only servers with Windows Server 2008 were having this problem. Windows 2003 servers were running as expected. The error that I was getting was: The security database on the server does not have a computer account for this workstation trust relationship.

My SCCM blog was referenced in the book

15 Feb

This come as a complete surprise to me.
I’ve found out that my blog was referenced in the System Center Configuration Manager (SCCM) 2007 Unleashed book that was published in 2009 by SAMS. In page 1108 you can find my name and URL to the blog, although last year I’ve changed the naming in my domain but I’m going to make the link in the book work.

Here are book details:
Paperback: 1224 pages
Publisher: Sams; 1 edition (August 2, 2009)
Language: English
ISBN-10: 0672330237
ISBN-13: 978-0672330230

Where is my disk space? Part 1

04 Feb

I had this problems before on SCCM server and it appeared again. SCCM hides somefolder from users but they are in know location. When they are in known location it is easy to unhide them. But what to do if the folder is hidden somewhere and nobody can pin point the location. This is what happened to one of the servers. The server has a partition size of ~72GB the total used space is ~28GB but when I’ve checked the folder size it was saying that all files are using only ~5GB. So where is my disk space gone? Well I suspect that some folder are hidden. So the first thing to do would be to choose option to ‘Show hidden files and folders’ and  untick ‘Hide protected oparating system file’ this have not shows the hidden folder for me.
The second option is to use good all Command Prompt and write the following command line:
attrib *. -h -s /s /d
This command remove hidden and system attributes from all the files in the partition. Once that was done a new sub folder appeared that had load of files and it was using ~23GB of disk space.

Win2008 cannot join domain

02 Feb

Here is what happens when you try to do things too fast.
I was imaging 4 servers at the same time, all these servers had the same name but were going to be joined to different domains. I’ve done that many times before but this time after joining 2 servers to the domain I could not join the other 2.
The error that I was getting was:
The following error occurred attempting to join the domain domain.local.
Logon failure: unknown user name or bad password


SCCM network ports

29 Jan

Here is a good Technet article about SCCM ports that it is using to communicate.
After reading this I think there should be no questions left what ports must be opened on firewalls.

Quick way of fixing ASP.NET

21 Jan

Probably majority of you know but for those who don’t here is a quick to fix you ASP.NET installation.
First Identify the ASP.NET version that you need to fix.
Then search for aspnet_regiis.exe file. Most likely you’ll find couple of them this is is why knowing the version is important. The file should be located in C:\WINDOWS\Microsoft.NET\Framework\ followed by the version number on 32bit systems and C:\WINDOWS\Microsoft.NET\Framework64\ on 64bit systems. After identifying the correct version (in my case C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) open command prompt and change directory to the required one(cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727). Now type
aspnet_regiis -i
This should take less then a minute. In Application Event log you should see couple ASP.NET events the last one will contain the location where the log file is held. The log file simply tells you what was done.

For more information about aspnet_regiis check MSDN.

Multiple connections to share

11 Jan

One of the errors that I’ve never saw before.
A client computer cannot connect to a network share and here is the error:
\\ is not accessible. You might not have permission to use the network resource. Contact the administrator of this server to find out if you have permissions.
Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.

The computer did not have any mapped drives and that share work ok before.
Command prompt to the rescue. 🙂
In command prompt type net use
You should see a list of addresses and there shoud be something like \\\IPC$
Now I need to delete that to do that type net use \\\IPC$ /delete
Job’s done.

IT Blog

Just another blog on Network