Skip to content

Commit f0960e7

Browse files
Create Readme.md
1 parent 01437e7 commit f0960e7

File tree

1 file changed

+45
-0
lines changed
  • Server-Side Components/Background Scripts/Get all users where manager is empty

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Users Without Manager - ServiceNow Background Script
2+
3+
This ServiceNow Background Script fetches all active users who do not have a manager assigned and provides a list of their names along with their Sys IDs, plus the total count of such users.
4+
5+
Features
6+
7+
Lists all active users without a manager.
8+
9+
Displays user display names along with their Sys IDs.
10+
11+
Provides a total count at the end.
12+
13+
Fully server-side, runs directly in Background Script.
14+
15+
Wrapped in a self-invoking function to avoid variable scope issues.
16+
17+
Usage
18+
19+
Log in to your ServiceNow instance.
20+
21+
Navigate to: System Definition → Scripts - Background.
22+
Click Run Script.
23+
24+
View the output in the System Logs → All (gs.info) to see:
25+
26+
A list of users without a manager
27+
28+
Their Sys IDs
29+
30+
Total count
31+
32+
Example Output
33+
Users without manager are:
34+
John Doe (Sys ID: 46d1f2f0db123300f0a12345c0a12345)
35+
Jane Smith (Sys ID: 46d1f2f0db123300f0a12345c0a67890)
36+
...
37+
Total users without manager: 42
38+
39+
Notes
40+
41+
This script only fetches active users (active=true).
42+
43+
You can modify the query to add additional filters if required (e.g., by department or role).
44+
45+
Ideal for administrators to quickly identify users without assigned managers for audits or reporting purposes.

0 commit comments

Comments
 (0)