0 votes

In the Admin Console, I've created a scheduled task to create an export. I get this error, "The execution of the external program or script took longer than 600000 milliseconds and was terminated." This is my Program parameter for the task: c:\Progra~1\Softerra\Adaxes~1\Admini~1\admimex.exe /d TXT /f C:\file.txt /r "OU=<name of OU>,DC=<name of DC>" /p SUB /a employeeID,displayName,telephoneNumber. What do I have wrong? (I have the OU,DC param enclosed in double quotes because it contains spaces.) When I run it manually at a command line, it generates the file in a matter of seconds.

by (270 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello,

Actually, we don't recommend using the admimex.exe tool as a part of Scheduled tasks, Business Rules or Custom Commands. It was designed mainly for command line export and can show prompts, confirmations etc when it runs. When a program is run as a part of Scheduled tasks, Business Rules or Custom Commands, it is run by Adaxes service. Any operations performed by services are run separately in Windows, and any UI shown by operations run be services is never shown to users, thus you'll never be able to reply to those confirmations and/or prompts.

Instead of using the admimex.exe tool, we recommend exporting data with the help of PowerShell scripts. Here's a PowerShell script that exports all users located in the OU on which a Scheduled task, Business Rule or Custom Command is executed, and creates a CSV file with format very similar to what you received from the admimex.exe tool.

Import-Module Adaxes
$filePath = '\\server\share\file.txt' # TODO: modify me

# Get domain name
$domainName = $Context.GetObjectDomain('%distinguishedName%')

# Get all users in the target OU and export properties to a file
Get-AdmUser -Filter * -SearchBase '%distinguishedName%' -SearchScope Subtree -AdaxesService localhost -Server $domainName -Properties employeeID, displayName, telephoneNumber | `
    Select-Object -Property DistinguishedName, employeeID, displayName, telephoneNumber | Export-Csv $filePath -NoTypeInformation

In the script, $filePath specifies the path of the CSV file that will be created by the script. Modify it to meet your requirements.

To add the script to your Scheduled Task, use the Run a program or PowerShell script action and select PowerShell script in the Type drop-down list.

0

This works as long as I run it manually. However when I run it scheduled, it produces the error "The network path was not found." I've tried the following to no avail...
\<filename>
C:\<filename>
\\<servername>\C$\<filename>
\\<servername>\<share>\<filename>

0

When I simply use a filename and extension,it runs successfully; however I cannot locate the file using Windows Explorer. I've executed a search of the entire C drive but didn't find the file.

0

Hello,

This works as long as I run it manually. However when I run it scheduled, it produces the error "The network path was not found." I've tried the following to no avail...

Hmm ... That's strange. We've tested the script and can confirm that it works OK. Can you send us the script after you've made the necessary modifications?

0
Import-Module Adaxes
$filePath = 'file_supportExample.txt'

# Get domain name
$domainName = $Context.GetObjectDomain('%distinguishedName%')

# Get all users in the target OU and export properties to a file
Get-AdmUser -Filter * -SearchBase '%distinguishedName%' -SearchScope Subtree -AdaxesService localhost -Server $domainName -Properties employeeID, displayName, telephoneNumber | `
    Select-Object -Property DistinguishedName, employeeID, displayName, telephoneNumber | Export-Csv $filePath -NoTypeInformation
0

When specified like this (without the path), the file will be saved to C:\Windows\system32\ by default.

However, it's quite strange that the script cannot save the file to the specified location, be that local hard drive or file share. Please check whether Adaxes default service administrator (the user that you specified when installing Adaxes) has sufficient permissions to create files in the folders / shares that you specify.

0

It's working now, turns out it was a permissions issue. Wish I'd thought of that and that the message had been more indicative of the issue. Thanks for your assistance!

Related questions

0 votes
1 answer

Is it possible to get an email notification if a scheduled task fails to run, or if 1 step in the task failed? I have a scheduled task that goes through a few steps ... part was failing to send, is it possible to get an email notification if this happens?

asked Apr 30, 2018 by ScottGriff (400 points)
0 votes
1 answer

Hi , is there any way that i can add a new Exchange Task in ADAXES I want to Export mailboxes using adaxes Exchange Task but there is no option for it , but ... please give me a working script for Exporting user Archive Mailbox only not the Primary Mailbox.

asked Dec 2 by vagifazari (450 points)
0 votes
1 answer

Hello, I'm wondering if it's possible to export a list of all users in AD along with their email addresses to an Excel spreadsheet and then schedule that export to append ... address that wasn't previously used. Please let me know if this is possible. Thanks!

asked Apr 11 by sjjb2024 (60 points)
0 votes
0 answers

Hello! I've run into this problem before with the windows task scheduler. It looks like there's no way in the interface to target a specific day in the month aside from ... of the month and output $True so I can use it to trigger an email notification?

asked Nov 10, 2015 by drew.tittle (810 points)
0 votes
1 answer

Hi , I have fully working After Create User Business Rule Question 1 ) It does create and send everyting throu eMail except sending user exchange eMail. How can i do ... want help desk to check Generate password checkbox. I want to generate in business rule.

asked Nov 29 by vagifazari (450 points)
3,588 questions
3,277 answers
8,303 comments
548,094 users