Active Directory: Get Last Logon Time For Users

Ever needed the logon time for users in your Active Directory domain? Use the following command: For /F “Skip=1 Tokens=3” %I in (‘Dsquery * domainroot -filter “(&(objectCategory=Person)(objectClass=User)(samaccountname=))” -attr name lastLogon’) Do @w32tm /ntte %I The above command runs the Dsquery command and pipes the output to the w32tm command to …

Add an SSRS Report as an Attachment to E-mails in a Custom Workflow in MSCRM 2011

In the below sample code, the report will actually be generated in two formats: Excel and PDF. These would then be attached to an e-mail specified at the workflow level. Make sure to visit Creating a Custom Workflow Activity in MS CRM 2011! In this second article in a three …

Modify E-mail Recipients in a Custom Workflow in MSCRM 2011

This bit of code will allow you to specify Team members as e-mail recipients in a workflow in Microsoft CRM 2011. Make sure to visit Creating a Custom Workflow Activity in MS CRM 2011 to understand how to create custom workflow activities! This bit of code will allow you to …

Creating a Custom Workflow Activity in MS CRM 2011 (Updated)

UPDATE 10-23-2013: Added a link on how to attach an SSRS report to an e-mail! UPDATE 10-03-2013: Added a link on how to send an e-mail to a team! Want to create a custom workflow activity in MS CRM 2011? Just follow Microsoft’s guide here. As an FYI, here are …

Declaring Literal Objects in C#

Here’s an awesome blog post on how to declare literal objects and object arrays in C#. My example involved calling a method within my C# custom workflow activity class: protected override void Execute(CodeActivityContext executionContext) { . . . dynamic[] sendFields = { new { type = "TO", teamMembers = GetTeamMembers(service, …

How to Change the Default PriceList or Currency in CRM 2011

Add the following code within a web resource: function setPriceList() { //Create an array to set as the DataValue for the lookup control. var lookupData = new Array(); //Create an Object add to the array. var lookupItem= new Object(); //Set the id, typename, and name properties to the object. lookupItem.id …