Skip to content

Instantly share code, notes, and snippets.

@fraga
fraga / gist:1078228
Created July 12, 2011 15:40
Updating userinfo database information AX 2012 after restoring contoso
update userinfo
set
networkdomain = 'YourDomain',
networkalias = 'YourAlias',
SID = 'YourSID'
where ID = 'Admin'
@fraga
fraga / gist:1072951
Created July 8, 2011 22:12
how to connect to microsoft dynamics ax 2012 WCF Currency services using a create request
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CurrencyServiceExample.DAX.Services;
namespace CurrencyServiceExample
{
class Program
@fraga
fraga / gist:1072137
Created July 8, 2011 15:58
app.config file for .net 4.0 and activating legacy v2 policy
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">"<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
@fraga
fraga / gist:1068426
Created July 6, 2011 21:47
How to connect to microsoft exchange online and retrieve info
public class ExchangePowerShell
{
public static PSCredential GetCredentials(string userName, string password)
{
var securePassword = new SecureString();
Array.ForEach(password.ToCharArray(), securePassword.AppendChar);
var cred = new PSCredential(userName, securePassword);
return cred;
}
@fraga
fraga / gist:1067295
Created July 6, 2011 14:04
changing user passwords in microsoft online exchange
$cred = Get-Credential
Set-MSOnlineUserPassword –Identity jane.dow@contoso.com –Password P@55word –ChangePasswordOnNextLogon $true –Credential $cred
@fraga
fraga / gist:1030298
Created June 16, 2011 21:14
Enable or disable WMI traffic in windows 7 firewall
To enable or disable WMI traffic using firewall UI
1.In the Control Panel, click Security and then click Windows Firewall.
2.Click Change Settings and then click the Exceptions tab.
3.In the Exceptions window, select the check box for Windows Management Instrumentation (WMI) to enable WMI traffic through the firewall. To disable WMI traffic, clear the check box.
You can enable or disable WMI traffic through the firewall at the command prompt.
To enable or disable WMI traffic at command prompt using WMI rule group
•Use the following commands at a command prompt. Type the following to enable WMI traffic through the firewall.
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
@fraga
fraga / interfaces
Created June 14, 2011 19:18
/etc/network/interfaces example
iface eth0:1 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
iface eth0:2 inet static
address 192.168.1.10
netmask 255.255.255.0
@fraga
fraga / gist:1003096
Created June 1, 2011 19:26
Program to copy vs font color settings to sql management studio settings
//
// Program.cs
//
// Author:
// Tomas Restrepo (email was hidden for privacy concerns)
//
using System;
using System.Collections.Generic;
@fraga
fraga / gist:998467
Created May 30, 2011 04:48
Two differents web.config regarding unity mapping
<configuration>
<configSections>
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<exceptionHandling>
<exceptionPolicies>
<add name="UIExceptionPolicy">
<exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None" name="Exception">
@fraga
fraga / gist:998393
Created May 30, 2011 02:53
Xunit console configuration for .net 4.0 (xunit.console.exe.config)
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<requiredRuntime version="v4.0.20506" safemode="true"/>
</startup>
<configSections>
<section name="xunit" type="Xunit.ConsoleClient.XunitConsoleConfigurationSection, xunit.console"/>
</configSections>