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 (227k 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

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 by DA-symplr (40 points)
0 votes
1 answer

Hello, we want to setup a scheduled report with all our teams (security groups) and their respective team-leader (specified in "managedBy" of security group). I get the name of ... the team-leader. And this is my problem... Can you help me with this problem?

asked Oct 9, 2020 by lohnag (100 points)
0 votes
1 answer

Our SQL DBAs are working to move most/all our SQL connections to SSL. They have asked if Adaxes can support this.

asked Feb 22, 2021 by ggallaway (300 points)
2,801 questions
2,535 answers
6,605 comments
61,643 users