Skip to main content

Get Specific/Multiple User Audit

Summary

This script is designed to get the specific or multiple user(s) information (Username, SIDs, and Status). Note: If the agent is a Domain Controller, it will audit the domain accounts; otherwise, it will audit the local accounts.

Sample Run

Sample Run 1 Sample Run 3 Sample Run 4

Dependencies

User-Audit

User Parameters

NameExampleAccepted ValuesRequiredDefaultTypeDescription
UserList_To_AuditTest,ProTest, Test,Pro,SystemTrueText StringThis parameter should be filled with a pattern to fetch the user list matching the pattern. Multiple user lists can be provided, separated by commas, as shown in the accepted values.

Task Creation

Create a new Script Editor style script in the system to implement this task.

Task Creation 1 Task Creation 2

Name: Get Specific/Multiple User Audit
Description: This script is designed to get the specific or multiple user information (Username, SIDs, and Status).
Category: Security

Task Creation 3

Task

Parameter

Add a new parameter by clicking the Add Parameter button present at the top-right corner of the screen.

Add Parameter

This screen will appear.
Parameter Screen Image

  • Set UserList_To_Audit in the Parameter Name field.
  • Enable the Required Field button.
  • Select Text String from the Parameter Type dropdown menu.
  • Click the Save button.

Parameter Setup Image

Row 1 Function: PowerShell Script

Add a new Add Row button.

Row 1

Search and select the PowerShell Script function.

PowerShell Script

The following function will pop up on the screen:

PowerShell Function

Paste the following PowerShell script and set the Expected time of script execution in seconds to 900 seconds. Click the Save button.

PowerShell Script

PowerShell Script 2

Row 2 Logic: If/Then

Add a new If/Then/Else logic from the Add Logic dropdown menu.

If Then

ROW 2a Condition: Output Contains

Type An error occurred in the Value box.

Output Contains

Row 2b Function: Script Exit

Add a new row by clicking the Add Row button.

Add Row 2b

A blank function will appear.

Blank Function

Search and select the Script Exit function.

Script Exit 1 Script Exit 2

The following function will pop up on the screen:

Script Exit Function

In the script exit message, simply type:

Bash Script 1

and click the Save button.

Script Exit Save

Row 3 Function: Script Log

Add a new row by clicking the Add Row button.

Add Row 3

A blank function will appear.

Blank Function 3

Search and select the Script Log function.

Script Log Script Log 2

The following function will pop up on the screen:

Script Log Function

In the script log message, type:

Bash Script 2

and click the Save button.

Script Log Save

Completed Task

Complete Task

Output

  • Script Log

Changelog

2025-04-10

  • Initial version of the document