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

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

asked Oct 16, 2019 by Dmytro.Rudyi (2.8k 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)
0 votes
0 answers

Hello, I'm curious again... In this post: Lync Fails when Line URI is used its mentioned that because Adaxes uses PowerShell v2, and the Lync module from Microsoft ... scripts. How then, does Adaxes go about enabling and disabling users for Lync? Thanks.

asked Jan 27, 2016 by EgotisticalGiraffe (2.2k points)
0 votes
1 answer

Hi! In 2019.2 new feature was introduced to use Microsoft Authenticator to validate the password self-service. Is it possible to connect it to existing MFA in ... Authenticator - one company account and another one generated by Adaxes after enrollment. Thanks!

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

I had a business rules that had a PowerShell script to update User properties in a SQL table. It was working fine. I moved the PowerShell to a custom command so I could ... in the custom command does get the values for the User object. Am I missing something?

asked Jun 2, 2014 by sdavidson (5.1k points)
2,135 questions
1,900 answers
5,319 comments
3,534 users