Skip to content

Instantly share code, notes, and snippets.

@FH-Inway
FH-Inway / Untitled-1.ipynb
Created June 23, 2024 12:00
New notebook with valid first F# code cell and invalid second cell
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FH-Inway
FH-Inway / Import-D365EntraIdUser.log
Created June 22, 2024 16:29
Example output from first draft of Import-D365EntraIdUser
PS K:\Repositories\GitHub\d365fo.tools> import-D365EntraIdUser -Users $user -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ClientId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -CertificateName "CHEAuth"
[18:20:21][Connect-MicrosoftGraph] Connecting to Microsoft Graph
VERBOSE: [18:20:21][Import-UserList] Getting tenant from user@example.com.
VERBOSE: [18:20:21][Import-UserList] Getting domain from user@example.com.
VERBOSE: [18:20:21][Get-InstanceIdentityProvider] The found instance identity provider is: https://sts.windows.net/example.com/
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] Loading dll files to do some work against the CanonicalIdentityProvider.
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] Executing the CanonicalIdentityProvider lookup logic.
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] CanonicalIdentityProvider is: https://sts.windows.net/
VERBOSE: [18:20:21][Import-UserList] InstanceProvider : https://sts.windows.net/example.com/
VERBOSE: [18:20:21][Import-UserList] Tenant : exampl
@FH-Inway
FH-Inway / New-AzureAppRedirectURLs.ps1
Last active June 8, 2024 15:13
Create full D365FO CHE Entra integration
# Add additional redirect URLs to an Azure Application.
# Based on https://blog.icewolf.ch/archive/2022/12/02/create-azure-ad-app-registration-with-microsoft-graph-powershell
# original gist: https://gist.github.com/FH-Inway/d55993312d1bb1aa2d63adfeed9946f3
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, HelpMessage = "The object ID of the Azure Application.")]
[String]
$AppObjectId,
@FH-Inway
FH-Inway / Exceptions.ipynb
Created May 5, 2024 10:36
.Net Interactive Polyglot notebook with "invalid" cell
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FH-Inway
FH-Inway / cgeo-system-info.md
Created April 5, 2024 18:38
c:geo system information

System information

c:geo version: 2024.04.05-NB-bf2adb3

Device:

  • Device type: SM-S906B (g0sxeea, samsung)
  • Available processors: 8
  • Android version: 14
  • Android build: UP1A.231005.007.S906BXXS7DXBD
@FH-Inway
FH-Inway / Upload.log
Created March 7, 2024 15:57
Upload to LCS pipeline run
2024-03-07T15:47:44.4754820Z ##[section]Starting: Upload package and deploy it
2024-03-07T15:47:44.6364725Z ##[section]Starting: Initialize job
2024-03-07T15:47:44.6368238Z Agent name: 'Hosted Agent'
2024-03-07T15:47:44.6368623Z Agent machine name: 'fv-az527-964'
2024-03-07T15:47:44.6368775Z Current agent version: '3.236.1'
2024-03-07T15:47:44.6413381Z ##[group]Operating System
2024-03-07T15:47:44.6413593Z Microsoft Windows Server 2022
2024-03-07T15:47:44.6413786Z 10.0.20348
2024-03-07T15:47:44.6413879Z Datacenter
2024-03-07T15:47:44.6414032Z ##[endgroup]
@FH-Inway
FH-Inway / Add-AudienceUriInWifConfig.ps1
Last active December 31, 2023 16:10
Adds an Entra app registration id as audienceUri in a D365FO wif.config
# Adds an audienceUri entry to the WIF configuration file
# Original script: https://gist.github.com/FH-Inway/5b5e86a4eb7ee8cd1670c6a8599d8f1e
param(
[Parameter(Mandatory)]
[Alias('AppId', 'ClientId')]
[string]$AudienceUri,
[string]$WifConfigPath = 'K:\AosService\webroot\wif.config'
)
# Downloads a certificate from an Azure key vault and stores it as .pfx and .cer file in C:\Temp\Certificate
# The files can then be used to enable the Entra integration for a Dynamics 365 Finance and Operations cloud hosted environment.
# See https://github.com/d365collaborative/d365fo.tools/issues/789 for more information
# Original file: https://gist.github.com/FH-Inway/86507ac3ed3e9b2e645ca015b9634f9a
$vaultName = 'MyKeyVaultname'
$certificateName = 'MyCertificateName'
$null = Connect-AzAccount -Tenant 00000000-0000-0000-0000-000000000000 -Subscription 00000000-0000-0000-0000-000000000000
@FH-Inway
FH-Inway / Add-SecurityRoleToUser.ps1
Created November 15, 2023 17:19
d365fo.integrations add role to user
$payload = Get-D365ODataEntityData -EntityName SecurityUserRoles -CrossCompany -Filter "UserId eq 'Guest'" -Verbose
$payload.SecurityRoleIdentifier = 'LedgerAccountant'
$payload.SecurityRoleName = 'Accountant'
$payloadNew = ConvertTo-Json $payload
Import-D365ODataEntity -EntityName SecurityUserRoles -CrossCompany -Payload $payloadNew -Verbose
@FH-Inway
FH-Inway / Fix-BacpacModel.ps1
Last active June 27, 2024 22:19
PowerShell script to remove AutoDrop and Grant.KillDatabaseConnection.Database from Bacpac model file
# This script can be used to
# - remove AutoDrop properties
# - remove Grant.KillDatabaseConnection.Database elements of type SqlPermissionStatement
# from the model file of a SQL Server 2022 (or equivalent Azure SQL) bacpac backup.
# This enables restoring the bacpac on a SQL server 2019.
# The d365fo.tools module needs to be installed to run this script.
# See also
# - https://github.com/d365collaborative/d365fo.tools/issues/747 (for AutoDrop)
# - https://github.com/d365collaborative/d365fo.tools/issues/820 (for Grant.KillDatabaseConnection.Database)
# Original script by @batetech in https://www.yammer.com/dynamicsaxfeedbackprograms/#/Threads/show?threadId=2382104258371584