0 votes

Hi,

I'm trying to open Adaxes object with Powershell script, and receive "object does not exist" error message. The script is executed remotely (not locally on Adaxes server).

PS C:\Scripts> [Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

GAC Version Location
--- ------- --------
True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Softerra.Adaxes.Adsi\3.3.8423.0__43a637781bd9a3c2\Softerra.Adaxes...

PS C:\Scripts> $admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
PS C:\Scripts> $admService = $admNS.GetServiceDirectly("AdaxesServer.domain") # AdaxesServer.domain will be replaced with real Adaxes server hostname
PS C:\Scripts> $businessRulesPath = $admService.Backend.GetConfigurationContainerPath("BusinessRules")
PS C:\Scripts> $businessRulesContainer = $admService.OpenObject($businessRulesPath, $NULL, $NULL, 0)
Exception calling "OpenObject" with "4" argument(s): "The 'Business Rules (Adaxes\Adaxes Configuration\Configuration Ob
jects)' object does not exist."
At line:1 char:49
+ $businessRulesContainer = $admService.OpenObject <<<< ($businessRulesPath, $NULL, $NULL, 0)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

Any helps will be greatly appreciated.

Thank you,
Van

by (20 points)

1 Answer

0 votes
by (18.0k points)

Hello,

The object does not exist error occurs when you don't have permissions to view either Active Directory or Adaxes objects. In your case you don't have the right to view Business Rules. You need to configure your Security Roles.

0

Hi Eugene,

Thank you for your reply. However, I can login to Adaxes server with my account and I can view, edit, add business unit without any issues. So, I don't think there is a permission issue with my account. I try to run the script below again, and still get the same "object does not exist" error message:

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$username = "myusername"
$password = "mypassword"
$_clientmangersdn = "CN=demo_client_managers,OU=Security,OU=DEMO,OU=Clients,DC=domain,DC=lan"
$_clientusersou = "OU=Users,OU=DEMO,OU=Clients,DC=domain,DC=lan"
$_clientsecurityou = "OU=Security,OU=DEMO,OU=Clients,DC=domain,DC=lan"
# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("adaxesserver.domain.lan")
# Bind to AD objects
$_adx_clientmanagersdn = $admService.OpenObject("Adaxes://$_clientmangersdn", $NULL, $NULL, 0)
$_adx_clientusersou = $admService.OpenObject("Adaxes://$_clientusersou", $NULL, $NULL, 0)
$_adx_clientsecurityou = $admService.OpenObject("Adaxes://$_clientsecurityou", $NULL, $NULL, 0)

Also try with username/password
$_adx_clientmanagersdn = $admService.OpenObject("Adaxes://$_clientmangersdn", $username, $password, 0)
$_adx_clientusersou = $admService.OpenObject("Adaxes://$_clientusersou", $username, $password, 0)
$_adx_clientsecurityou = $admService.OpenObject("Adaxes://$_clientsecurityou", $username, $password, 0)

However, it still doesn't work. Any ideas?

Thanks,

0

Hello,

The script looks good. We tested it in our environment and it works perfectly.
Did you try to launch the script on the computer where your Adaxes service is installed? Is UAC enabled on the remote computer?

0

Sorry, I am new to Adaxes. I don't see any Adaxes service on my remote computer. Do you know the exact service name that I need to look for? If the service is not there, how do I install it. Also, how can I verify if UAC is enabled/disabled? Also, this script was maintained by one of my co-workers (I think he received this script from you), and he said it used to work fine on this same remote computer.

0

Hello,

I don't see any Adaxes service on my remote computer. Do you know the exact service name that I need to look for?

The exact name is Softerra Adaxes Service. It should be installed on the computer where you have Adaxes installed. Adaxes clients (such as Adaxes Web Interface or Adaxes Administration Console) perform any operations in Active Directory via Adaxes Service. When accessing Adaxes functionality from scripts, you are also doing it via Adaxes service.

Also, how can I verify if UAC is enabled/disabled?

Take a look at the Turn User Account Control on or off article by Microsoft.

Related questions

0 votes
1 answer

I have to generate an Excel sheet populated with some users informations. It works on the server itself, but not when i run it via Custom commands. There is the code that ... it does'nt open and throws an error : How to interact with com objects on Adaxes?

asked Nov 29, 2021 by diaz801 (20 points)
0 votes
1 answer

Recently, Microsoft deprecated use of the remote PS sessions using version 1. We have since converted all of our scripts to version 2, but our nightly staff ... { # Close the remote session and release resources Disconnect-ExchangeOnline -Confirm:$false }

asked Nov 2, 2022 by MShep (80 points)
0 votes
1 answer

I have a custom command that uses powershell to set the room capacity for a resource mailbox in 0365. The command runs without any errors when called manually ... { # Close the remote session and release resources Disconnect-ExchangeOnline -Confirm:$false }

asked Nov 7, 2022 by Kirkvanslyke (50 points)
0 votes
1 answer

I'm moving from 2013.1 (on Server 2008 R2) to 2014.1 (on Server 2012 R2) and am going from a single server to 2 new servers and will shut down the 2013 ... be updated properly if their target object is moved or renamed. Would another reboot fix this possibly?

asked Aug 26, 2014 by danftasc (440 points)
0 votes
0 answers

Hello there, We have guest accounts created in AD (on our DMZ DC) that use the first initial + last name format for username with the last 4 digits of their mobile ... there any special way I should be updating a username and UPN from PowerShell? Thanks, Chris

asked Jul 13, 2018 by Bowman4864 (270 points)
3,588 questions
3,277 answers
8,303 comments
548,087 users