0 votes

I'm seeing this error when I run a user deprovision. It still executes the script but nobody likes errors!

Run PowerShell Script 'DuoDeprovisionExport' For the user. The term '#this' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Stack trace: at <ScriptBlock>, <No file>: line 1 Run external program 'DuoDeprovision' for the user

Below is the first few lines of the DuoDeprovisionExport script I am running. I am running this script within Adaxes. I am not calling powershell.exe with the file path.

#this is required for the external script "DuoDeprovision.ps1" to run.
#That script reads the info from the csv this script creates.
#Adaxes doesn't let us use import-module for custom modules from what I've tested.

My first question is: Does Adaxes recognize Powershell comments? Does it only recognize the block comments like this? <# This is a comment #>

On that note... My second question is: does Adaxes allow for the use of custom powershell modules for the in-house script editor? It is installed in the Program Files directory, but even after calling Import-Module Duo (the custom module) it still doesn't recognize the cmdlets. (This is why I'm running an export script in the first place for my Duo user info. )

Thanks.

by (60 points)

1 Answer

+1 vote
by (270k points)
selected by
Best answer

Hello,

Does Adaxes recognize Powershell comments? Does it only recognize the block comments like this? <# This is a comment #>

You can use both approaches in PowerShell scripts executed in Adaxes - comment each line with a leading # character or place comment blocks as in your example. In both cases, the comments should not affect the script execution.

According to the error message, the issue occurs because there is a non-printable character before text #this. Most probably, it was kept when you copied the text from another editor. To remedy the issue, you need to remove the character (just delete everything in front of the word this and then add the # character).

My second question is: does Adaxes allow for the use of custom powershell modules for the in-house script editor?

Yes, using custom modules is allowed. The modules should be installed on the computer where Adaxes service is running. If there are multiple instances of Adaxes service sharing common configuration, the modules should be installed on each of the computers where the services run. Also, if a module location differs from the default one, use the -CimResourceUri parameter of the Import-Module cmdlet to specify the alternative location.

0

Figures that it would be that easy! Thank you very much, that's working now. I was trying to install the modules to the $env:psmodulepath locations previously. You've saved me a lot of trouble.

You're pretty good!

Related questions

0 votes
1 answer

We want to automate the provisioning of skype users with adaxes. Therefore we installed the Skype module onto the adaxer server. Then we tried to utilise some commands in a ... . How can the Skype module be integrated for Adaxes? Thank you for your help.

asked Apr 23, 2020 by PGstoehl (100 points)
0 votes
1 answer

Hi All, I am currently using the 30 day free trial of Adaxes and seeing if we can use it to achieve our method of user provisioning. I am looking into server-side ... variable value within an SQL query Can this be achieved? Any help is much appreciated, Thanks

asked Feb 1 by Lewis (40 points)
0 votes
1 answer

My role as a developer require a form submission with Adaxes to get JIT (just in time) access to an client environment, I want to need guidance to form submission with the Adaxes PowerShell module.

asked Nov 19, 2020 by spencer.nicol (20 points)
0 votes
1 answer

I have 18 domains managed by Adaxes and have noticed that Admin (full access) t all objects acts normally, but for piecemeal scopes like Service Desk that scopes to individual ... role (including 16 denies) and expect it to grow as we add more domains.

asked Sep 20, 2022 by DA-symplr (80 points)
0 votes
1 answer

In order to add a managed domain does it have to be trusted by the primary domain adaxes is installed an running in? I have set up a domain for testing adaxes and it ... I have set my host file to point the untrusted domain to it's primary Domain Controller.

asked Oct 5, 2022 by mightycabal (1.0k points)
3,326 questions
3,026 answers
7,727 comments
544,678 users