Hi,
I'm trying to create a script using the devolution PowerShell module to enable or disable user based on a AD group.
But before starting with the major sync part I wanted to test with a user in our test environment and it failings all the time the command "Update-DSUser".
Bellow is the code I'm using to do this, from what I see everything seems to be ok but, maybe I missed something. Can you help me please?
$env:DS_URL= 'https://DVLS.local/dvls'
$DVLSUrl = $env:DS_URL
$appkey = "XXXXXXXXXXX"
$appsecret = "XXXXXXXXXXXXXXXXXXXXXX"
$SecPassword = ConvertTo-SecureString $appsecret -AsPlainText -Force
$Creds = New-Object System.Management.Automation.PSCredential ($appkey,$SecPassword)
$Response = New-DSSession -Credential $Creds -BaseURI $DVLSUrl -AsApplication
$UserID = $((Get-DSUser -All).data | where {$_.name -eq 'User name'}).id
$enabled = $(Update-DSUser -UserID $UserID -Enabled $true)
The error:
Kind regards
e22578f9-bd75-4da9-b97a-716e772f41b5.png
Hello,
I just tried your code and it worked for me:
Could you confirm what version of Devolutions Server and the Devolutions.PowerShell Get-RDMInstance you are using?
Best regards,
Richard Boisvert
365167a9-602e-48ef-b7d6-4c6c6e34e90b.png
Hi Richard,
So on the test system we are running 2023.3.8 and the Get-RDMInstance says 2023.3.2.0.
Please note that, we have Azure MFA enabled, even though this should not be a problem I just wanted to give you this detail just in case.
Best Regards
Hello,
Are you trying to update a domain user or a Microsoft (AAD/Entra ID) user? I have not yet been able to replicate the issue.
Best regards,
Richard Boisvert
Hi Richard,
Yes it's Microsoft users, in this particular case I want to disable the user if the user is disabled the our AD/AAD.
Kind Regards
Hello,
User synchronization was added in the 2023.3 version of Devolutions Server, specifically for this reason - https://blog.devolutions.net/2023/11/whats-new-in-devolutions-server-20233/#keeping-dvls-user-lists-up-to-date-with-user-synchronization
When a user is disabled or removed from the domain or Entra ID, it will prompt you to keep, disable, or remove the user in Devolutions Server.
It is also on the roadmap to automate this task with the scheduler.
Best regards,
Richard Boisvert
Hi,
Is there any "expected" date/ release for that?
Kind Regards
Hello,
We don't have ETA for that feature. I will increase the priority to let know that we have users who would like a such feature.
Best regards,
François Dubois