0 votes

Hi again !

Is there a way in a BR Powershell script to get the Domain Controller Adaxes service is using for an operation. To be clearer, i use a powershell script in a BR after user creation to activate Lync account but sometimes, the script throws an error about not finding the user account, certainly because Adaxes created it on one DC and Lync powershell use another one. If i can get the DC in the context, i could pass it to the powershell cmdlet.

Thanks

Stephen

by (800 points)

1 Answer

0 votes
by (18.0k points)
selected by
Best answer

Try this one:

$domain = $Context.GetObjectDomain("%distinguishedName%")
$rootDse = $Context.BindToObject("Adaxes://$domain/rootDSE")
$dc = $rootDse.Get("dnsHostName")
0

Perfect ! Thanks

Related questions

0 votes
1 answer

We have a business rule that will update an AD attribute when a new member is added to a group. This business rule works when we use powershell commands or the admin console ... set to trigger "After adding a member to a group". Thank you for your support!

asked Mar 29, 2023 by mark.it.admin (2.3k points)
0 votes
1 answer

We are planning to use Adaxes in our environment and before proceeding, we need to understand the firewall port requirements for Adaxes service to work. What are the firewall ports needed between Adaxes and AD domain controller?

asked Jan 24 by Renugopal (120 points)
0 votes
1 answer

Hi team, I have a follow up to this question https://www.adaxes.com/questions/14234/business-after-adding-members-powershell-script-executed Let me explain my setup A rule- ... area% failed due to the following exception: $($_.Exception.Message)", "Error") }

asked Feb 13 by wintec01 (1.5k points)
0 votes
1 answer

I would like to add the following logic into a Powershell script that will be triggered on 'After Create User'. Read the value of the 'title' property of the user just created ... 'True' or 'False'. Could you assist with how to script this please? Many thanks.

asked May 1, 2020 by Bernie (310 points)
0 votes
1 answer

My scheduled task currently: Checks for staff in a particular OU that do not have an O365 license Adds a license Resets their AD Password Moves them to an OU based off ... scheduled task moves them out of the OU that the business rule is looking at. Thanks

asked Apr 15, 2020 by russmerriman (40 points)
3,548 questions
3,239 answers
8,232 comments
547,814 users