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 (290 points)

1 Answer

+1 vote
by (190k 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

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 (250 points)
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 (690 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 (1.1k points)
0 votes
1 answer

Is it possible to call execution of Adaxes custom command via SPML?

asked Oct 16, 2019 by Dmytro.Rudyi (4.1k points)
0 votes
1 answer

Hello, I'm attempting to automate a part of our user creation/modification process and I've created a script that works on the Adaxes server in PowerShell but when I ... ? The Quest Powershell commands are installed on the Adaxes server as well. Thank you!

asked May 20, 2014 by mmackay (280 points)
2,375 questions
2,131 answers
5,763 comments
180,546 users