To enable ping to the Windows Server 2008 R2, follow below steps
Go to Start >> Administrative Tools >> Windows Firewall with advanced security >> Inbound Rules >> File and Printer Sharing (Echo Request – ICMPv4-IN) >> right click and select Enable Rule.
To disable the ping select Disable Rule in the last step.