Improve performance on large dataset queries on Dynamics CRM 2011

http://support.microsoft.com/kb/2535245/en-us

How move a Dynamics CRM 2011 deployment (or some roles)

http://technet.microsoft.com/en-us/library/hh386491.aspx

How to enable WCF compression to improve CRM 2011 network performance

http://blogs.msdn.com/b/crminthefield/archive/2011/12/29/enable-wcf-compression-to-improve-crm-2011-network-performance.aspx

How to restrict access to an URL for a single IP address using IIS URL Rewrite

How to grant calendar sharing permissions on Office 365 using powershell

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Add-MailboxFolderPermission -Identity “userA:\Calendar” -AccessRights PublishingEditor -User UserB
Remove-PSSession $Session

  • Possible permissions are: Owner, PublishingEditor, Editor, PublishingAuthor, Author, NonEditingAuthor, Reviewer, Contributor, AvailabilityOnly, LimitedDetails
  • If userA is using a different language (e.g.: Spanish), calendar will be “userA/Calendario”
  • Do not include domain in user names

How to remove a windows service

sc delete “Service Name”

Populating date/time tables

This code will populate a date/time table for a cube or any other purpose in SQL Server.

declare
	@start datetime,
	@end datetime,
	@date datetime,
	@hour int
select
	@start = '2011-08-01 00:00',
	@end =   '2013-01-01 00:00'
set @date = @start
while @date < @end
	begin
		set @hour = 0
		while @hour < 24
			begin
				insert into [date]([id], yeardate, monthdate, daydate, hourdate,[year], [month], [day], [hour])
				values(
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-' + ltrim(datepart(day, @date)) + ' ' + str(@hour) + ':00',
					ltrim(datepart(year, @date)) + '-01-01 00:00',
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-01 00:00',
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-' + ltrim(datepart(day, @date)) + ' 00:00',
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-' + ltrim(datepart(day, @date)) + ' ' + str(@hour) + ':00',
					datepart(year, @date),
					datepart(month, @date),
					datepart(day, @date),
					@hour)
				set @hour = @hour + 1;
			end
		set @date = dateadd(day, 1, @date)
	 end

Calculating table sizes on SQL Azure

This query will retrieve the rounded (2) size (MB) of all your tables on a SQL Azure database.

select
      sys.objects.name,
      cast(round(sum(reserved_page_count) * 8.0 / 1024, 2) as float) as size
from
      sys.dm_db_partition_stats,
      sys.objects
where
      sys.dm_db_partition_stats.object_id = sys.objects.object_id
group by
	sys.objects.name
order by
	size desc

How to connect a Debian machine to a Windows 2008 PPTP VPN

  1. #apt-get install pptp-linux
  2. #apt-get install ca-certificates
  3. Copy certificate to /usr/share/ca-certificates . If your certificate extension is .cer then change it to .crt
  4. #dpkg-reconfigure ca-certificates //Select your certificate from the list
  5. Follow the pppt client debian configuration instructions on http://pptpclient.sourceforge.net/howto-debian.phtml
  6. Create a /etc/ppp/ip-up.d/ppp0 with routing information:
    #!/bin/sh
    /sbin/route add -net 192.168.1.0 netmask 255.255.255.0 dev ppp0
  7. #chmod +x /etc/ppp/ip-up.d/ppp0
  8. Add the next lines to you /etc/ppp/peers/provider file if you want your connection to be reconnected if it fails and if you want to assign a static ip address to your connection
    persist
    192.168.1.10:

How to install Linux Integration Services Version 2.1 on a Hyper-V virtual machine running Debian

Linux Integration Services Version 2.1 now has support for Timesync, Integrated Shutdown and Symmetric Multi-Processing (SMP) up to 4 virtual processors.

  1. Get the Linux Integration Services 2.1 Beta from https://connect.microsoft.com/site495
  2. Extract the files and insert the .iso as a disk in your virtual machine
  3. Now the hard/long part, update your Kernel with version 2.6.27.47 (This is out of scope, so you will have to look for info on how to do this).
  4. Reboot and choose your new Kernel
  5. #mount /cdrom
  6. #mkdir /opt/linux_ic_v21_rc
  7. #cp /cdrom/* /opt/linux_ic_v21_rc -R
  8. #mkdir /etc/sysconfig/network
  9. # cd /opt/linux_ic_v21_rc  -R
  10. Modify the Mafile file replacing all the occurrences of —reload-rules with —reload_rules
  11. Modify the scripts/updateinitrd.pl file commenting lines 79 to 87 and adding this line after that $initrdfile = “/boot/initrd.img-2.6.27.47″;  
  12. Modify scripts/updategrub.pl file replacing line 55 with $grubfile = “/boot/grub/menu.lst”;
  13. #apt-get install chkconfig
  14. #make
  15. #make install
  16. Modify your /etc/init.d/vmbus file commenting lines 55 to 61 and 108 to 112. Also replace line 73 with return 0 and 75 with return 1
  17. Modify your /etc/network/interfaces file replacing eth0 with seth0
  18. Modify your /etc/initramfs-tools/modules file adding a vmbus line and a netvsc line
  19. #update-initramfs –u –k 2.6.27.47
  20. Shutdown your virtual machine #init 0
  21. Replace your legacy network adapter with a normal Network adapter copying your old adapter’s MAC to your new adapter
  22. Start your virtual machine
  23. That’s it, now you have a Debian Hyper-V virtual machine with Integration Services.
Return top