I’m trying to create a new Managed Property based on first part of users’ i.d.
First four letters/#s of a user id denotes what department is linked to that i.d.
So if a group i.d. starts with 1234 and remaining 4 spots (5678) are unique to the user, is there a way to filter so it only looks at the first 4 letters/numbers?
Will an * work as a wildcard so it singles out all user id’s that start with “1234” and places them in “Group A”?
example: will it place 1234joe and 1234zed in same group “Group A”?
Please see code snippet below:
if (value “DefaultUserName” of key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” of registry as string = “1234*”) then “Group A”
There are a few ways to pull parts of a string if you know the position (in the string) you are starting from.
concatenation of characters (0;1;2;3) of “1234abc”
will return the string “1234”
You can also use
preceding text of position 4 of “1234abc”
to get the same result. In your case this turns into something like:
if (preceding text of position 4 of (value “DefaultUserName” of key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” of registry as string) = “1234”) then “Group A”
going by your edit “firsts 4 of” would the code look like this?:
if (firsts 4 of (value “DefaultUserName” of key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” of registry as string) = “1234”) then “Group A”
One more thing, going back to original code, could I have replaced the “=” with “starts with” and achieved the same results, or would it be open to possible issues?
example:
if (value “DefaultUserName” of key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” of registry as string starts with “1234”) then “Group A”