0 votes

Can I use a PS script to call Adaxes with a list of users or computer and run through it? For example, PS script checks for users NotLoggedOnFor 30 days and sends this list to Adaxes to disable accounts.

by (60 points)

1 Answer

0 votes
by (215k points)

Yes, you can. Try the following script:

Import-Module Adaxes

$domainName = "domain.com";
$adaxesService = "localhost";
$dataLimit = [System.DateTime]::Now.AddDays(-30); 

Search-AdmAccount -AccountInactive -DateTime $dataLimit -UsersOnly -AdaxesService $adaxesService -Server $domainName | Disable-AdmAccount -AdaxesService $adaxesService -Server $domainName 

To search only for computers, use the -ComputersOnly switch parameter. To search for both users and computers, omit this parameter.
To get the full list of Adaxes cmdlets, use Get-Command -Module Adaxes.

In the next version that is scheduled for September (October), it will be possible to perform such activities without scripting using new feature called Scheduled Tasks.


Thanks for help!

Related questions

0 votes
0 answers

Hi, I'm currently working with setting up a new Adaxes solution for a customer at my company. The customer needs a solution that can add a security group with full ... help me out here :-) That would be greatly appreciated. Best Regards, Kristoffer Høie.

asked Jun 29, 2016 by krihoie (20 points)
0 votes
1 answer

When running a PowerShell script as an action in a custom command, you can set the script to run as a different account and then use the RunAs property in the ... Is there another way to get the Adaxes service account's credentials from within the script?

asked Mar 31 by KelseaIT (320 points)
0 votes
1 answer

Hello, currently we use powershell scripts to perform compliance critical tasks because this allows us to generate user defined entries in the windows event log. Now we would like to ... ". Is there a way to retrieve this information in the CC? Many thanks.

asked Jul 21, 2018 by HorstR (460 points)
0 votes
1 answer

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

asked Oct 16, 2019 by Dmytro.Rudyi (850 points)
0 votes
1 answer

I'm currently running a SQL SPROC from within powershell, getting a value, and attempting to assign that value to an AD attribute. Everything goes fine getting the value, but ... avoid calling PS from within PS to load the module and run the command. Thanks!

asked Feb 3, 2017 by gmadd13 (50 points)
2,801 questions
2,535 answers
61,658 users