0 votes

Is there a way to update a distribution group using a CSV file as the source through the web portal?

This script is an example of how I would do in manually through EMS.
import-csv C:\Distro1.csv | foreach {add-distributiongroupmember -id Distro1-member $_.Name }

by (350 points)

1 Answer

0 votes
by (216k points)

Hello Michael,

Currently import of data from a CSV file is not supported in Adaxes Web Interface. This feature is in our TODO list and will be available in one of the nearest releases.

However, there is a way to do this using Custom Commands. You can create a Custom Command that will import users from a CSV file located on a network share. In this Custom Command you can use your PowerShell script via the Run a program or PowerShell script action. The name of the file can depend on the name of the user who is performing the operation. So, your users will need to open a CSV file (using, for example, Excel) located on a network share, enter all the data necessary, and execute a Custom Command via the Web Interface.

To create such a Custom Command:

  1. Open Adaxes Administration Console.

  2. Create a new Custom Command.

  3. On the 2nd step of the Create Custom Command wizard, select Group.

  4. On the 3rd step of the wizard, add the Run a program or PowerShell script action.
    To pass the name of the initiator to your Powershell script, use the $Context.Initiator.UserAdsObject.Get("<property_name>") method passing sAMAccountname as the name of the property. To pass the group, on which your Custom Command is executed, you can use the %sAMAccountName% value reference. For example:

     Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
     $initiator = $Context.Initiator.UserAdsObject.Get("sAMAccountname")
     import-csv \\server\share\$initiator.csv | foreach {add-distributiongroupmember -id %sAMAccountName% $_.Name }
    
  5. Finish creation of the Custom Command.

On how to create a Home Page Action that will launch the Custom Command from the Web interface, see the Configure Home Page Actions tutorial (section Custom Command)

Related questions

0 votes
1 answer

Hi support, [https://www.adaxes.com/questions/752/import-data-wizard] I am trying to do something similiar to this however in our csv file the column is called ... powershell task as you have highlighted to add the ldap value to the accountExpires attribute?

asked Feb 19 by MikeBeattie (110 points)
0 votes
1 answer

Is it possible with Adaxes to update a distribution groups membership based on the users in an OU? I know this is exactly what a dynamic distribution group is for, but for certain reasons I need this to be a normal distribution group not dynamic.

asked Mar 16, 2015 by yobhod (150 points)
0 votes
1 answer

Receive "Index operation failed; the array index evaluated to null. Stack trace: at &lt;ScriptBlock&gt;, &lt;No file&gt;: line 104&gt;" and "Index operation failed; the ... $GroupName, $GroupDN." } } #foreach write-output "" Write-Output "" Stop-Transcript

asked Apr 14, 2022 by jbahou (20 points)
0 votes
1 answer

I would like to set the Hire Date of a user to the CustomAttributeDate2. Using your script to create users from a csv file. I have tried "Hire Date" = " ... for me to get that data into the customAttribute in adaxes? Add something to the script.

asked Jan 10, 2023 by mightycabal (1.0k points)
0 votes
1 answer

Hello, We are currently trailing Adaxes before purchase, We want to use this to mainly automate our starters and leavers process. Starters seems easy enough, however I ... CSV. Not very experienced with powershell so any help would be much appreciated. Regards

asked Oct 29, 2018 by wayne (70 points)
3,564 questions
3,255 answers
8,264 comments
547,915 users