A discussion took place about using tags as variables in EdgeDX scripts. It was suggested to use Device Groups or environment variables, with some limitations on the characters allowed. There were also discussions about future updates to increase the tag length and whether there is a PowerShell module for EdgeDX. The conversation also touched on the time it takes for a tag to show up on an endpoint and creating new tags through the script. There were some issues with setting the tag initially, but it was resolved by using all lowercase letters and limiting to specific characters. It is possible that the tag length may be increased in the future.
Read the entire ‘Using Tags as Variables in EdgeDX Scripts: A ControlUp Discussion’ thread below:
Anyone know if you can call a tag in an EdgeDX Script as a variable?
for the SecureDX remediation, we have the crowdstrike deploy script, but the CID is unique to the customer. Would prefer to not have a script for every customer that includes their CID, so if we could tag the customer machines then use that tag value that could be helpful
You can use Device Group…. https://support.controlup.com/docs/scripting-guide#scripts-tips-and-tricks
SIPDEVICEGROUP
are there any other variables that can be used or just device group and computername?
Well the example is just using environment variables. You can use any environment variable thats available.
true, ok but any controlup specific variables? so we have device group, device tags? prob not
If you run SET from a command prompt you should see SIPDEVICEGROUP listed.
ok
EDXDEVICEGROUP
looks like this is set as well
Tags might be in there as well? Unless this is like a debug build of the agent.
which one is newer or will they both stay around
also, any future updates to increase the tag length?
Tags should allow up to 100 characters
Is that not enough?
says 12?
oh that’s silly. The UI seems to enforce that. The API was recently increased to 100.
ohhh
well thats probably ok
Is that 12 per tag with a total of 100?
no. 100 per tag
I would think that would make the UI pretty bad.
not too concerned about the UI. the tag length longer will be great
is there a powershell module for edgedx?
or just the openapi?
I read that as openAI. As far as I’m aware there is no module. At least not a public one. I know that @member has one but I’m not sure if that is ready for the public.
@member has published these though.
nice!
getting 401 unauthorized when trying the api call
is this the place to do my api key?
I dont see anything under settings, api keys
https://support.controlup.com/docs/edge-dx-api
The green bit most likely applies to you.
ok. Ill open a ticket then
@member you can use $env:EDXDEVICETAGS
yes! found that one. thank you
anyone know how long it takes for a tag to show up on the endpoint?
when using "set"
I applied one earlier when we were talking and its still not there.
hmm
May take a service restart or machine restart?
ill try restarting the cu service
What script are you using to tag devices ?
I used the console, no script.
yeah I used the console as well
Oh no via the console it need to be immediately
Same with moving a device to a device group
changed device group and i am waiting on it to reflect on the endpoint
tried restarting the services and still not changing in the cmd prompt
can you:
Stop the agent
delete the environment variables for group and tag
start the agent
I’m curious if we only set it if it doesn’t exist already
If that doesn’t work, try including the agent manager in the start/stop as well. It might be the agent manager who sets those
The tag one just doesn’t exist.
Its not like its not being updated, its not there.
yeah same ^^
Microsoft Windows [Version 10.0.22631.3155]
(c) Microsoft Corporation. All rights reserved.
C:\Users\landon>set e
EDXDEVICEGROUP=Windows Machines
EFC_13828=1
C:\Users\landon>
a reboot brought them to me
not crazy about that tbh
I’ll leave my box up as a test. It may be something that is refreshed daily.
ok sounds good
@member I am able to set the tag on the device, but I cannot create a new tag. what is the syntax for actually creating it?
Using the script?
correct
The tags are arbitrary they don’t need to exist. They exist by virtue of being assigned to a device
yeah understood, but when I send the command to set a tag on a device, it errors with a 400 code but if I run it with a tag that already exists, it works
What’s the tag? I don’t have the requirements at hand but I believe it can only be lower case letter, numbers, – and _
Nothing else
I tried simply "crowdstrike" without the quotes
but let me check my lowercase/uppercase
I might not have had that right
yeah it was a capital C!
thank you
awesome yes it is working and I can confirm the length is greater than 12 characters
Continue reading and comment on the thread ‘Using Tags as Variables in EdgeDX Scripts: A ControlUp Discussion’. Not a member? Join Here!
Categories: All Archives, ControlUp Edge DX, ControlUp Scripts & Triggers, ControlUp Secure DX