-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable users are not working #68
Comments
Could you share what payloads and OData endpoints that you are using? For an user to be valid and useable inside D365FO - some basics has to be in place. If you have a working D365FO environment, with a specific user in it. You can get / export that user from the OData endpoint and compare it against the environment that doesn't work. The EU region comment is a bit unclear to me. The d365fo.integrations will work against any D365FO instance, regardless region, as long as you can provide a valid OAuth 2.0 token (or ClientId / ClientSecret). If you can call the OData endpoint for the specific environment and get / export / fetch data - you know that the connection and token works. Then the issue could be the payload that you are sending to the OData endpoint. |
Hi Thanks for the reply , i found the issue in the admin user username is empty so got the error and not enabled the users , after adding the name issue got resolved .. for EU environment URL i am getting the below error when enabling the users Get-D365ODataEntityData] Something went wrong while retrieving data from the OData endpoint for the entity: SystemUsers | The remote name could not be resolved: 'XXX.sandbox.operations.eu.dynamics.com' |
And from the same machine you can actually reach the mentioned url from the error message? The tools are not doing anything special, sp the error would indicate that your machine is able to resolve the uri. Please try to copy the Uri from the error and paste it into your browser - from the same machine. Let me know what you find... This is normally a DNS issue - way out of what we can assist with. |
Hi i can able to access the URL only to the eu.dynamics it is not working |
Hi, I just tested things out with the following code: $token = Get-D365ODataToken -Tenant 000... -Url https://....test.sandbox.operations.eu.dynamics.com -ClientId 11111... -ClientSecret 'password....'
Get-D365ODataPublicEntity -EntityNameContains Sales -Token $token -SystemUrl https://....test.sandbox.operations.eu.dynamics.com -Url https://....test.sandbox.operations.eu.dynamics.com And was able to get data back from the EU deployed Tier2. If you are still struggling with the things, we could arrange a screensharing session and I could try to understand what you facing and see if I can unblock you. |
Was there any other issue instead of the empty username in admin account? I am struggling with the same issue: I try to enable two users - code is running without errormessage, but users are not enabled in FO. Running this operation with Postman (same clientID/-secret and so on) everything is working as intended, so I doubt that there are permission-problems. Any help appreciated! |
Can you share your payload and commands that you're running. If your payload in postman and powershell is 100% the same - it has to work. I'm keen to unblock you - so let me know if you need a hand. |
Took example from function-documentation, eg: $payload = '{"Enabled":"true"}' Fehler beim Aufrufen der Methode, da [System.Management.Automation.PSCustomObject] keine Methode mit dem Namen
Update-D365ODataEntityBatchMode : Das Argument kann nicht an den Parameter "Payload" gebunden werden, da es NULL ist.
If .ToArray() is removed, no "direct" error occurs but nothing happens. Remove-Variable : Es kann keine Variable mit dem Namen "ODataSystemUrl" gefunden werden.
|
Please run I would argue, that your array object isn't created correctly - based on the errors. Could you do a single update, in a loop - to unblock you? Then we can work on the batchmode in parallel... |
Please try this:
or in a loop
|
Name Value PSVersion 5.1.17763.5696 This is a default T1-DevBox from MS. |
The second version using loop and Update-D365ODataEntity works. |
Hm - no: Update-D365ODataEntityBatchMode: Cannot bind argument to parameter 'Payload' because it is null. InvalidOperation: Method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'ToArray'. Using "...-Payload $updates" instead of "...-Payload $updates.ToArray()" does not throw an error, but nothing happened on FO-side. |
This works - I just tested with one of my customers and their environments. A Tier1 - but still - it should work regardless, as long as the OData entity is available. $payload = @{
"Enabled" = "True"
} | ConvertTo-Json
$usersCol = New-Object System.Collections.Generic.List[System.Object]
$usersCol.Add( [PSCustomObject]@{Key = "UserID='abc'"; Payload = $payload })
$usersCol.Add( [PSCustomObject]@{Key = "UserID='def'"; Payload = $payload })
Update-D365ODataEntityBatchMode -EntityName SystemUsers -Payload $($usersCol.ToArray()) |
Nope - not working either. Same problem and behaviour as before. Even if I add the -token param ;) |
Then the next step is to do a offline / screensharing - where you can show me what you're actually doing. I noticed that your powershell session was in German, so our timezones should be compatible 🤞 Could you please verify - that you did a Add-D365ODataConfig -Name 'Temp' -Tenant -Url '' -SystemUrl '' -ClientId '' -ClientSecret '' -Force Please note that the Url and SystemUrl, has to be the same value. Next up is making the entire configuration, the active one. Set-D365ActiveODataConfig -Name 'Temp' Now you should be able to run my code, as this is the most common way to run the cmdlets, as the ODataConfig will fill out all default parameters, for all cmdlets calls. So no need for the -Token parm (unless you are an advanced user, but that is for another discussion) |
Hi
Thanks for the scripts for D365 F&O
I am using the script for enabling the users after the DB refresh the job is getting success but in the environment users are not enabled.
and the script is not working for EU region too.
The text was updated successfully, but these errors were encountered: