Monday, February 29, 2016

Hyper V and VMWare on the same machine

If you get, "internal error" while starting a VM, please start "VMware Authorization Service" Service. and try again.
To do this open an Administrator Command Prompt, enter this command and then reboot:
bcdedit /set hypervisorlaunchtype off
Hyper-V can be enabled again with this command (which also requires a reboot):
bcdedit /set hypervisorlaunchtype auto

Ref : https://pricklytech.wordpress.com/2014/02/25/windows-8-1-vmware-player-and-hyper-v-are-not-compatible/

Wednesday, February 24, 2016

Globally Accessible Class

public class GloballyAccessibleClass
    {
        private GloballyAccessibleClass() { }

        public static GloballyAccessibleClass Instance
        {
            get
            {
                IDictionary items = HttpContext.Current.Items;
                if (!items.Contains("PaperSave"))
                {
                    items["PaperSave"] = new GloballyAccessibleClass();
                }
                return items["PaperSave"] as GloballyAccessibleClass;
            }
        }

        //public HostedEnvironment PaperSaveEnvironment { get; set; };

    }

Tuesday, February 23, 2016

IIS Log Viewer

https://www.weblogexpert.com/info/IISLogs.htm

Log Parser

Covert the time

LogParser.exe "SELECT DATE,TO_LOCALTIME(time) AS time,s-ip,cs-method,cs-uri-stem,cs-uri-query,s-port,cs-username,c-ip,cs(User-Agent),sc-status,sc-substatus,sc-win32-status,time-taken INTOc:\ayman\output.log FROM c:\ayman\input.log" -i:IISW3C -o:W3C


Wednesday, February 17, 2016

ADFS 3.0 stops working after reboot

Background :
With the arrival of ADFS 3.0 in Windows Server 2012 R2 the use of IIS with AD FS in Windows Server 2012 R2 has been eschewed in favour of a move to kernel-mode (HTTP.SYS). The motive is to improve performance, provide greater sign-in customization options and to be able for co-locating ADFS and AD Domain Services on the same server (IIS on domain controllers is from a security perspective a big no-no).
As the use of federation services goes more mainstream in everyday use with Windows 8.1, office 365 , intune , azure and whatever cloud service they come up with , this shift is understandable and an important design consideration.  With the new kernel-mode approach, support for running under server core also appears as an option in the new release.
Problem :
In my lab , I Installed and configured ADFS 3.0 om my domain controller with a global managed service account (gmsa). This is a new feature since ADDS 2012 was introduced. After a server reboot , the ADFS services cannot start anymore and it always stay in "starting" state , making your DC unusable.
This issue appears to be gMSA related, when you install ADFS 3.0 on a 2012R2 running AD DS, than after the reboot (not always) gMSA fails to authenticate on behalf of the ADFS Service under which the service is configured to run.
Solution:
After investigation, I found an unacceptable workaround, which is to :
1. Reboot the ADDS/ADFS3.0 server, logon and immediately set the ADFS Service from Automatic (Delayed) to Manual.
2. Change the Microsoft Key Distribution Service (kdssvc) service to auto (instead of manual trigger) and restart the DC.
3. Logon and start the ADFS service (starts successfully)
4. Set the ADFS Service from Manual to Automatic (Delayed) .
5. Done.
Keep it coming. We’re all learning ADFS 3.0 for Windows Intune  :-)

Enable Basic Authentication in IIS Express

go to
%USERPROFILE%\Documents\IISExpress\config\applicationhost.config: 
and then search for basicauthentication in there and set it to true.

<basicAuthentication enabled="true" />