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 …

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, …

Build XRMServices Request for Microsoft Dynamics CRM

Use the CRM 2011 OData Query Designer tool. In addition, here’s some examples: Get Quote details for a specific quote /XRMServices/2011/OrganizationData.svc/QuoteDetailSet?$filter=QuoteId/Id eq guid'<RECORD_GUID>’ Get specific property details (e.g. ExtendedAmount and Quantity) for a specific entity (e.g. Quote Detail) /XRMServices/2011/OrganizationData.svc/QuoteDetailSet?$select=ExtendedAmount,Quantity&$filter=QuoteId/Id eq guid'<RECORD_GUID>’ Filter on custom entities and how to use multiple …

How to Specify a Filename For Your Exported Reports in Microsoft Dynamics CRM 2011

As you probably already know, there’s no built-in way to specify the filename of a report you want to export to PDF, Excel, Word, etc. Then a colleague pointed me to this article.  First off, the code for the below solution can be downloaded here. This one took a while …