You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Query Issue]: Users with logon scripts stored in a trusted domain #58
MATCH (n:User)
WHERE n.logonscript IS NOT NULL
MATCH (d:Domain)<-[:SameForestTrust|CrossForestTrust]-(:Domain)-[:Contains*1..]->(n)
WITH n,last(split(d.name, '@')) AS domain
WHERE toUpper(n.logonscript) STARTS WITH ("\\" + domain + "\")
RETURN n
Thank you for reporting! I am fixing this in an upcomig release.
This query has been bugging me for a long time, so I will reduce it to simply Users with logon scripts.
The check for logon script WITHIN a trusted domain is equally important, if not less important, than a logon script OUTSIDE a trusted domain.
The query itself is complex and brittle
This is my current best iteration:
MATCH (n:User)
WHERE n.logonscript IS NOT NULL
MATCH (d:Domain)<-[:SameForestTrust|CrossForestTrust]-(:Domain)-[:Contains*1..]->(n)
WHERE toUpper(n.logonscript) STARTS WITH ("\\\\" + toUpper(d.name) + "\\")
RETURN n
However, it can still return false-negagives due to possible variations of the network path: FQDN, short domain name, explicit server/DC hostnames, IP addresses, ...
Activity
Address query bugs
martinsohn commentedon Jun 9, 2026
Thank you for reporting! I am fixing this in an upcomig release.
This query has been bugging me for a long time, so I will reduce it to simply
Users with logon scripts.The check for logon script WITHIN a trusted domain is equally important, if not less important, than a logon script OUTSIDE a trusted domain.
The query itself is complex and brittle
This is my current best iteration:
However, it can still return false-negagives due to possible variations of the network path: FQDN, short domain name, explicit server/DC hostnames, IP addresses, ...
martinsohn commentedon Aug 5, 2026
Fixed in the latest release.