Monday, 31 March 2014

IBM Server virtualization: IRQL_NOT_LESS_OR_EQUAL

I've tried to virtualize one of my physical servers.
I have no problems doing this via Disk2vhd or Acronis Backup&Restore on many machines till now.
For one of IBM servers I couldn't do this.
After trying many methods of making copy of the C:\ drive, nothing worked.
I've always get the BSOD saying: IRQL_NOT_LESS_OR_EQUAL.
I knew that it was caused by the driver problem, but I thought that it's a rather IDE driver ( server has had SCSI disks) which was not included in my system. After adding registry entries, this didn't help too.
After some more research taken, I find out that the real problem was with OSA IPMI Driver.
After uninstalling it on the physical server, restarting it and making new image by disk2vhd, virtual machine started correctly!

Wednesday, 26 March 2014

PS: Export AD users from selected OU using powershell

How to export users from selected OU and it's subtree using powershell?

Get-ADUser -filter * -SearchScope Subtree -SearchBase "OU=Users,OU=Company,DC=Contoso,DC=com"|select-object givenname,surname,samaccountname |export-csv c:\temp\Company_Users.csv

Thursday, 20 March 2014

No winlogon.log file

After fresh installation of Windows Server domain controller you could see that you have no winlogon.log file which is useful to debugging AD gpo's.

For example when you need to troubleshot SceCli events.Event ID 1202 tells you to use:

FIND /I "Cannot find"  %SYSTEMROOT%\Security\Logs\winlogon.log

But, hey! There are no winlogon.log file!
This is by design :).

To create it, go to regedit and track following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{827D319E-6EAC-11D2-A4EA-00C04F79F83A}
Click the key ExtensionDebugLevel and enter 2 as a Data.

After refreshing AD policies with gpupdate you should see your winlogon.log file

Wednesday, 19 March 2014

How to kill hung service

Sometimes, when you're trying to stop Windows service, it shows stopping and actually don't stop.
You need to force it to stop.

First query for service PID:
sc queryex SERVICENAME

Then kill the process using tskill
taskkill /f /pid PID

Wednesday, 12 March 2014

2008R2: How to restore deleted AD object after enabling Active Directory Recycle Bin

After enabling Active Directory Recycle Bin in Server 2008R2 you can recover deleted AD object.
But you need to track it fiirst.
When you don't remember where you deleted object resided, use this powershell command to recover AD object.
(replace objectlastnamehere with the name of your object)

Get-ADObject -SearchBase "CN=Deleted Objects,DC=domain,DC=domain" -ldapFilter:"(msDs-lastKnownRDN=objectlastnamehere)" –IncludeDeletedObjects –Properties lastKnownParent |Restore-ADObject

Thursday, 6 March 2014

Setting proxy with .pac file in IE10 IE11 using registry and group policy gpo

Set Proxy settings using GPO

We have many computers with Windows8 now but 2008R2 server which doesn't like anything newer than Internet Explorer 9.
Setting proxy for IE8 and IE9 was simple with Interet Explorer .adm files.

You can use Internet Explorer Administration Kit (IEAK) for deploying customized Internet Explorer and it works, but for me works only if you deploy full installation with only changed proxy settings. It was very weird to me, so I searched another way.

Finally, my thoughts were directed to Windows registry. Everyone nows that if something is hidden from your eyes you can set it through the registry.

And this is it, keys that set your path for proxy .pac file!

For adding proxy address:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "" /f

For removing proxy address:
reg del "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "" /f

I've set gpo for that:
As you see I've used Preferences settings to add new registry settings
Settings in the add registry you can see below: