0 votes

I have a third-party provider that is asking us for the Name,Phone,Email,Job Title, & Office of every new hire we get sent tot hem in a .CSV file at the end of the week so they can import them into thier software.

If we have a file at c:\user.csv is there a script that we could use that would append that file each time we add a new user?

Thank you,

by (1.2k points)
0

Hello,

Unfortunately, there is no such script. However, we can write it for you. It will be executed in a Business Rule triggering After creating a user and append the necessary data into the CSV file. If the solution meets your needs, please, provide us with a sample of the CSV file, clarify the LDAP names of user attributes whose values should be appended to the file and the corresponding column names where the values should be added. Then we will provide you with the script and detailed instructions.

For your information, if you have multiple instances of Adaxes service that share common configuration, the file should be stored in a network share folder. This way, each instance of Adaxes service will be able to write updates into the same file instead of into the separate local ones.

0

Sample of the CSV CSV.PNG

CSV = Active Directory Attribute Name = cn Phone = telephoneNumber Email = mail Job Title = title Office = physicalDeliveryOfficeName

File Location would be on a network. \server\folder\sms.csv

Let me know if there is anything I missed or anything else you may need.

1 Answer

0 votes
by (215k points)

Hello,

Thank you for the provided details. To create the Business Rule:

  1. Launch Adaxes Administration Console.
  2. In the Console Tree, right-click your service node.
  3. In the context menu, navigate to New and click Business Rule. image.png
  4. On step 2 of the Create Business Rule wizard, select the User object type.
  5. Select After crating a user and click Next. image.png
  6. Click Add an action.
  7. Select Run a program or PowerShell script.
  8. Paste the below script into the Script field. In the script:
  • $path – Specifies the path to the CSV file.
  • $properties – Specifies a map of CSV column names to the value references of corresponding properties.
$path = "\\server\share\users.csv" # TODO: modify me
$properties = [ordered]@{
    "Name"= "%cn%";
    "Phone" = "%telephoneNumber%";
    "Email" = "%mail%";
    "Job Title" = "%title%";
    "Office" = "%physicalDeliveryOfficeName%"
} # TODO: modify me

New-Object PSObject -Property $properties | Export-Csv -Path $path -Append -NoTypeInformation
  1. Enter a short description and click OK. image.png
  2. Click Next and finish creating the rule.

Related questions

0 votes
1 answer

Hallo Everyone I'm attempting to import a CSV list to Update Current users. I Used the Script 2 from Repostitory https://www.adaxes.com/script-repository/ ... "employeeNumber") # TODO: modify me Test file: sAMAccountName,employeeNumber, Peter.Muster,AB052

asked Jul 13, 2021 by Sandberg94 (170 points)
0 votes
1 answer

Hello, is it possible to add computers to the basket, imported from a csv file? We get a list from our client team to disable computer accounts in bulk. regards Helmut

asked Feb 22, 2021 by a423385 (510 points)
0 votes
1 answer

We are working with an HR package that will send us a CSV file every 4 hours with a list of users that need to be created, modified or deleted from our environment. The CSV ... change, etc.) Is there a script that can manage all of that on a scheduled basis?

asked Sep 2, 2020 by RayBilyk (180 points)
0 votes
0 answers

I am trying to work out a method to create Drop-Down lists to select printers and printer properties. Using PowerShell I can extract a list of printers and printer properties to either ... or CSV file for my drop-down lists. Any ideas on how to do this? Thanks

asked Sep 17, 2019 by Fixxer (40 points)
0 votes
1 answer

We are using the following the script and would like to have it updated to use a CSV file instead of the list option. Thank you in advance for your assistance. ... error occurred when updating user. Error: " + $_.Exception.Message, "Warning") }

asked Jun 5, 2017 by willy-wally (3.2k points)
2,640 questions
2,375 answers
6,305 comments
985,907 users