Closed AshawDyn closed 2 years ago
I'm using a clientid and secret with the Connect-CrmOnline to get the -conn parameter
I assume I need to use the Get-Crmconnection, but I don't see how to use it with a clientid and secret
Fixed it myself.
My Get-CRMCOnnection was wrong.
I changed it to: Get-CrmConnection -ConnectionString "AuthType=ClientSecret;Url=$DynamicsURL;ClientId=$DAppId;Secret=$Secret"
Then it started working
Thanks for the update @AshawDyn!
In most cases, I suggest going with Connect-CrmOnline in lieu of Get-CrmConnection directly. Get-CrmConnection is fine, but the format can be a real struggle at times and connect-CrmOnline effectively takes a slightly more standardized approach at building the connection string for the top scenarios including clientSecret and other methods. If I'm being honest, I've used the module with Connect-CrmOnline with -verbose to build connection strings for other apps :)
VERBOSE: Using the supplied single filter of uniquename 'like' DynamicsAssign Get-CrmRecordsByFetch : System.Management.Automation.RuntimeException: Crm Service not initialized