0 votes

Forgive me if this topic has been discussed elsewhere i searched and didn't find anything.

What I would like to have adaxes do is on a nightly basis

1. go to a folder it will have access to which will have a file that contains the alias name(s) of an employee(s).
2. for the people in the file their account should be disabled by adaxes.
3. the description should read "disabled by adaxes on %getdate%"
4. send an email saying user x was disabled or user x was not found. (its fine to do one email a person it will be 2 or 3 at most or one email with everyone is fine as well)
5. move the file to a completed folder or possibly just delete it once everything is worked out.
6. do not disable any user with _adm in its name
7. do not parse file if it has over 20 entries.
8. do not disable/change description if its already disabled ( to avoid changing the date of the description if the same user is in next day file accidentally.

Ive been looking at scheduled tasks but it seems like im going to need to run a powershell script rather than use the gui bits. I can get it to do the actions aside from looking at a file from what i can se (so steps 2,3 and 4 seem doable from the gui anyway.)

for powershell something like this perhaps:

Import-Module ActiveDirectory
[string]$date = Get-Date -Format g
Import-Csv "d:\csv\test.csv" | ForEach-Object {
$samAccountName = $_."samAccountName"
Get-ADUser -Identity $samAccountName | Disable-ADAccount
set-ADUser -Identity $samAccountName -description "disabled by adaxes $date"
}

Is this possible #4 eludes me a bit.
Thank you in advance.

by (280 points)

1 Answer

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

Hello,

You need to use a PowerShell script. For details, have a look at the following script from our repository: https://www.adaxes.com/script-repositor ... e-s246.htm. If you have issues updating the script to meet your needs, we will help you.

Related questions

0 votes
0 answers

Before Deactivation of an Account on the Webinterface our Help Desk need to change the AD User Description manually. Is it possible to force a manual change before deactivation ?

asked Feb 7 by lv01 (250 points)
0 votes
0 answers

I have a deprovision task that our desktop support staff uses to terminate a user and want to setup a scheduled task that goes through and looks for users who are past their ... to the current date it is still applied to ALL users in the organization. Why?

asked May 16, 2013 by trscott (850 points)
0 votes
0 answers

Hello, I want to automate the creation of a contact based on an existing AD Users. For example, the code in my custom command contains something like: new-mailcontact - ... a parameter after he run the Custom Command from the Web interface? Thanks in advance.

asked Apr 20, 2016 by tentaal (5.6k points)
0 votes
1 answer

Hi , I would like to know that is there any API service, where we can work on objects inside Adaxes tool? Preferbly REST API?

asked Nov 6, 2019 by Anil (250 points)
0 votes
1 answer

I'm not able to retrieve the Description of a user using ADSI. I'm trying user.Get("description").ToString() on IADsUser I get the error, The 'description' property cannot be found in the cache. Is there a different method I need to use to get Description?

asked Feb 6, 2017 by sdavidson (5.1k points)
2,251 questions
2,011 answers
5,507 comments
25,317 users