Skip to main content

User Profile - Get Information

Summary​

Gathers information about user profiles and stores the data in the custom field.

Sample Run​

Image

Dependencies​

Output Description​

Script Output looks like below and here is the output description :

Output has 5 parts for each user profile and each user profile is separated by a |

  1. Username : The username of the target profile. If (Inferred) is appended, then the user could not be found and the username was inferred from the profile path.
  2. LocalUser : Indicates if the user is a local user. 1 if its a localuser, 0 if its not a local user.
  3. Admin : Indicates if the user is a local admin. 1 if its a local admin, 0 if its not.
  4. ProfileSizeMB : The size of the user folder for the target profile.
  5. Enabled : 1 if local account is enabled, 0 if disabled. 2 when the account is not local.

Image

Task Creation​

Script Details​

Step 1​

Navigate to Automation ➞ Tasks
step1

Step 2​

Create a new Script Editor style task by choosing the Script Editor option from the Add dropdown menu
step2

The New Script page will appear on clicking the Script Editor button:
step3

Step 3​

Fill in the following details in the Description section:

  • Name: User Profile - Get Information
  • Description: Gathers information about user profiles and stores the data in the custom field.
  • Category: Custom

Image

Script Editor​

Click the Add Row button in the Script Editor section to start creating the script
AddRow

A blank function will appear:
BlankFunction

Row 1 Function: PowerShell Script​

Search and select the PowerShell Script function.

PowerShell Function Selected

The following function will pop up on the screen:
PowerShell Function Example

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

PowerShell Script

Image

Row 2 Function: Script Log​

Add a new row by clicking the Add Row button.
Add Row

A blank function will appear.
Blank Function

Search and select the Script Log function.
Script Log Search

In the script log message, simply type %output% and click the Save button.
Script Log Save

Step 3 Logic: If/Then​

Click on Add Logic > select If/Then

Row 3a Condition: Output Does Not Contains​

  • Condition: Output
  • Operator: Does Not Contain
  • Input Values: Error

Image

Row 3b Function: Set Custom Field​

  • Select User Profiles from dropdown
  • Add %output% in the Value

Image

Save Task​

Click the Save button at the top-right corner of the screen to save the script.
SaveButton

Completed Task​

Image

Schedule Task​

Task Details​

  • Name: User Profile - Get Information
  • Description: Gathers information about user profiles and stores the data in the custom field.
  • Category: Custom

Schedule​

  • Schedule Type: Schedule
  • Timezone: Local Machine Time
  • Start: <Current Date>
  • Trigger: Time At <Current Time>
  • Recurrence: Every week on Monday

Targeted Resource​

Device Groups: Windows Machines (Non‑DC)

Image

Completed Scheduled Task​

Image

Output​

  • Script Logs
  • Custom Field

Changelog​

2026-03-11​

  • Initial version of the document