$('#myid').prop('hidden', true);
$('#myid').hide();
$('#myid').prop('hidden', false);
$('#myid').show();
$('#myid').prop('hidden', true);
$('#myid').hide();
$('#myid').prop('hidden', false);
$('#myid').show();
function updateEntity(entityName, id, entity ) {
var url = oDataUrl + "/" + entityName + "Set(guid'" + id + "')";
entityData = window.JSON.stringify(entity);
return $.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
datatype: "json",
data: entityData,
url: url,
beforeSend: function (x) {
x.setRequestHeader("Accept", "application/json");
x.setRequestHeader("X-HTTP-Method", "MERGE")
},
});
}
entityName is the logical entity name.account = {};
account.Name = "New Name";
Unable to get item. Exception: System.NotSupportedException: The authentication endpoint Kerberos was not found on the configured Secure Token Service! at Microsoft.Xrm.Sdk.Client.IssuerEndpointDictionary.GetIssuerEndpoint(TokenServiceCredentialType credentialType) at Microsoft.Xrm.Sdk.Client.AuthenticationCredentials.get_IssuerEndpoint() at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateInternal(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateFederationInternal(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(AuthenticationCredentials authenticationCredentials) at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredentials clientCredentials) at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration.Authenticate(ClientCredentials clientCredentials) at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateClaims() at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateCore() at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.Authenticate() at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.ValidateAuthentication() at Microsoft.Xrm.Sdk.Client.ServiceContextInitializer`1.Initialize(ServiceProxy`1 proxy) at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultipleCore(QueryBase query) at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultiple(QueryBase query) at Consumer.ItemManager.RetrieveLastItem(String type) at
Consumer.ItemManager.RetrieveLastItem(String type) at
Consumer.Service.ConsumerService.Process[T](Config feed)
https://adfs.domain.com/adfs/ls/mex
https://adfs.domain.com/adfs/services/trust/mex
Param (
#optional params
[string]$ConfigurationEntityName="FederationProvider",
[string]$SettingName="ActiveMexEndpoint",
[object]$SettingValue,
[Guid]$Id
)
$RemoveSnapInWhenDone = $False
if (-not (Get-PSSnapin -Name Microsoft.Crm.PowerShell -ErrorAction SilentlyContinue))
{
Add-PSSnapin Microsoft.Crm.PowerShell
$RemoveSnapInWhenDone = $True
}
$Id=(Get-CrmAdvancedSetting -ConfigurationEntityName FederationProvider -Setting ActiveMexEndpoint).Attributes[0].Value
$setting = New-Object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
$setting.LogicalName = $ConfigurationEntityName
if($Id) { $setting.Id = $Id }
$setting.Attributes = New-Object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
$keypair = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ($SettingName, $SettingValue)
$setting.Attributes.Add($keypair)
Set-CrmAdvancedSetting -Entity $setting
if($RemoveSnapInWhenDone)
{
Remove-PSSnapin Microsoft.Crm.PowerShell
}
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.Xml; using System.Text; using System.Threading.Tasks; using System.Web; using System.Xml; using System.Xml.Linq; using log4net; namespace Encryption { public class Encryption { ILog logger; X509Certificate2 certificate; public Encryption(string certificateThumbprint) { logger = LogManager.GetLogger("Encryption"); certificate = GetCert(certificateThumbprint); } public string Encrypt(string plaintext) { XmlDocument Doc = new XmlDocument(); Doc.LoadXml(string.Format("<sensitivedata>{0}</sensitivedata>", HttpUtility.HtmlEncode(plaintext))); Doc.PreserveWhitespace = true; XmlElement toEncrypt = Doc.GetElementsByTagName("sensitivedata")[0] as XmlElement; EncryptedXml eXml = new EncryptedXml(); EncryptedData edElement = eXml.Encrypt(toEncrypt, certificate); EncryptedXml.ReplaceElement(toEncrypt, edElement, false); return Doc.OuterXml; } public string Decrypt(string encryptedtext) { XmlDocument Doc = new XmlDocument(); Doc.LoadXml(encryptedtext); EncryptedXml exml = new EncryptedXml(Doc); exml.DecryptDocument(); string plaintext = HttpUtility.HtmlDecode(XDocument.Parse(Doc.OuterXml).Element("sensitivedata").Value); return plaintext; } private X509Certificate2 GetCert(string thumbprint) { X509Certificate2 cert = null; X509Store store = new X509Store(StoreLocation.LocalMachine); store.Open(OpenFlags.ReadOnly); try { X509Certificate2Collection certCollection = store.Certificates; cert = certCollection.Cast<X509Certificate2>().Where(c => c.Thumbprint.Equals(thumbprint)).Single(); } catch (Exception ex) { logger.ErrorFormat("An error occurred looking for certificate with thumbprint: {0}.\nException:{1}." , thumbprint, ex); } finally { store.Close(); } return cert; } } }
https://<ADFS FQDN>/adfs/ls/IdpInitiatedSignon.aspx
var collection = context.CreateQuery("service")
.Join(context.CreateQuery("e2_dictionary"),x => x["serviceid"], y => (y["e2_serviceid"] as EntityReference).Id, (x, y) => y)
.Where(x => x["name"].Equals(serviceName));
Add-Type -AssemblyName System.EnterpriseServices
$Publisher = New-Object System.EnterpriseServices.Internal.Publish
$Publisher.GacInstall("C:\Users\Account\Desktop\mydll.dll)
gwmi win32_service | ? {$_.Name -match "MSCRM|W3SVC"} | %{Restart-Service -Name $_.Name}
Add-Type -AssemblyName System.EnterpriseServicesAdd-Type is a PowerShell 3.0 onwards cmdlet, you can use this instead:
$Publisher = New-Object System.EnterpriseServices.Internal.Publish
$Publisher.GacRemove("C:\Users\Account\Desktop\mydll.dll)
gwmi win32_service | ? {$_.Name -match "MSCRM|W3SVC"} | %{Restart-Service -Name $_.Name}
[System.Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices")