Modify/Edit Computer Settings via txt file

Need to create a custom fixlet to insert in the BigFix computer setting the e-mail of each computer’s user.
For example, create a custom fixlet that keeps the e-mail information from a txt file where all the information are listed, as for example:

computer1 - email1
computer2 - email 2
computer3 - email3

A possible idea should be to identify a parameter in the actions script that keeps these information

If you have a listing of computers to email addresses, you could use the Location Property Wizard, with the option to map custom key-value pairs. You’d paste in the computer-to-email mappings, like from a spreadsheet, and let it create a custom property for email address.

1 Like

Hi Jason, Thanks for your reply. we want to add Email ID as custom setting to each computers so that it will show as a column that has the custom email address that we will set. By Using location property wizard we tried but it is giving blank entry against the custom Email ID setting.

Does your organization have an API/WebService that you can call via policy action and use the logged-in user property of the BESClient to set this email address custom property?

no we dont have API/Webservice, We just want to stamp email address against each computer. Currently we are performing manual task to edit computer setting and then add email address and the required value. This option we get when we select “manage properties” under columns

There are several ways to do it. How many computers are in your deployment? The size of your deployment helps guide which options might be best.

In the console, can you go to Tools->Manage Properties, find the property for the column you’re adding, and paste the property name and its definition here? With that I can give you some screenshots of how you’d use the Location Property Wizard to update the values.

Another option might be to create a text file with the mappings, attach it as a “Site File” in the Console with the “Send to Clients” option selected, and use a Task that parses the file on the client to update the client setting. I could give you some relevance and action script for that as well, but we’d need to see the property definition to tune it to your example.

1 Like

below are the details @JasonWalker

Name: Email ID
Relevance: if exist values of settings “Email ID” of client then value of setting “Email ID” of client else error “not set”

Right Click on computer–>Edit Computer Settings–> Add
Setting Name: Email ID
Setting Value: test@test.com

@andy_zoomin – as Jason pointed out, size of your environment plays a big role here.
For smaller environments you could just add this info directly inside a Fixlet relevance and action script.

Let’s assume you have a list like:

“Computer1”, "email1@test.com"
“Computer2”, "email2@test.com"
“comp3”, "e3@e.com"

For relevance you could do something like:

not exists (it, ("Computer1", "email1@test.com"; "Computer2", "email2@test.com"; "Comp3", "e3@e.com")) whose (item 0 of item 1 of it as lowercase = hostname as lowercase AND item 0 of it = item 1 of item 1 of it) of values of settings "Custom" of client

And for action script:

parameter "email"="{preceding text of first "||" of (it & "||") of concatenation "||" of items 1 of ("Computer1", "email1@test.com"; "Computer2", "email2@test.com"; "comp3", "e3@e.com") whose (item 0 of it as lowercase = hostname as lowercase)}"`

setting "Email ID"="{parameter "email" as string}" on "{parameter "action issue date" of action}" for client

If you have a larger environment – you might want to consider propagating a mapping file or some other solution.

Hope that helps!

2 Likes

Thanks @Marjan
We have total 4000 systems that needs email ID mapping. Please suggest

we tried the script provided by @Marjan but it is failing. and no settings are getting applied.

Thanks a lot @Marjan It worked for few clients. the only thing that restricted here whose (item 0 of it as lowercase = hostname as lowercase)}"` was having extra ’ and once i removed it all worked. But if we want to deploy it on 3000 systems can you please suggest

I don’t have a handy write-up yet and it would take some time to put it together.

The basic idea is to create a text file with computername[TAB]email mappings. I.E. pasting those two columns from Excel into a text file defaults to tab-delimited text.
Because we are going to send this file to every client, we want to be sure it’s as small as possible. Sending a 10 MB site file to 4,000 clients could generate a lot of traffic. So use Site Files sparingly.

Save the text file, and attach it to a BigFix Custom Site using the “Send to Client” option
image
image

Then you can set up a Task to parse the text file at the client. Now here’s where I messed up my example, I don’t have any clients subscribed to that site in the earlier screenshots, so I repeated attaching the file to my custom site “HCL-Lab-Services-Test” which I’ll use for the rest of this example.

We can find our folder and file in the debugger

q: (name of it, client folder of it) of sites
A: BES Asset Discovery, C:\BES\Client\__BESData\BES Asset Discovery
A: BES Inventory and License, C:\BES\Client\__BESData\BES Inventory and License
A: BES Support, C:\BES\Client\__BESData\BES Support
A: BigFix Labs, C:\BES\Client\__BESData\BigFix Labs
A: BigFix ServiceNow Data Flow, C:\BES\Client\__BESData\BigFix ServiceNow Data Flow
A: CIS Checklist for MS SQL Server 2016, C:\BES\Client\__BESData\CIS Checklist for MS SQL Server 2016
A: CIS Checklist for Windows 2016 MS, C:\BES\Client\__BESData\CIS Checklist for Windows 2016 MS
A: HCL-Lab-Services-Test, C:\BES\Client\__BESData\CustomSite_HCL-2dLab-2dServices-2dTest

q: exists files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")
A: True
T: 2.002 ms
I: singular boolean

q: lines of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")
A: BES-ROOT%09user1@example.com
A: BFC%09user1@example.com
A: BFI%09user1@example.com
A: cent-1.domain.home%09user1@example.com
A: cent-2%09user2@example.com
A: cent-3.domain.home%09user2@example.com
A: DC%09user3@example.com
A: ENDPOINT-1%09user4@example.com

( %09 is the TAB character )

We can find ourselves in the file. Here I’m running on the computer “BES-Root”. I’ll test searching the file for my computer name, and test using the pipe symbol ( | ) to trap an error if my computer name is not present in the file:

q: lines whose (preceding text of first "%09" of it as lowercase = computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")
A: BES-ROOT%09user1@example.com
T: 8.294 ms
I: plural file line

// Test a matching computer
q: (following text of first "%09" of lines whose (preceding text of first "%09" of it as lowercase = computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")) | ""
A: user1@example.com
T: 6.340 ms
I: singular string

// Test a non-matching computer - add an "x" to our computername to test the pipe trapping an error
q: (following text of first "%09" of lines whose (preceding text of first "%09" of it as lowercase = "x" & computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")) | ""
A: 
T: 4.400 ms
I: singular string

// Test that our client setting matches the value in the file
q: not exists setting "Email ID" whose (value of it = (following text of first "%09" of lines whose (preceding text of first "%09" of it as lowercase = computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")) | "") of client
A: True
T: 2.386 ms
I: singular boolean

q: (following text of first "%09" of lines whose (preceding text of first "%09" of it as lowercase = computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")) | ""
A: user1@example.com
T: 2.209 ms
I: singular string

For the Task Relevance, I want to be Relevant if the “Email ID” client setting is not present, or does not match what’s in the site file:

// Test that our client setting matches the value in the file
q: not exists setting "Email ID" whose (value of it = (following text of first "%09" of lines whose (preceding text of first "%09" of it as lowercase = computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")) | "") of client
A: True
T: 2.386 ms
I: singular boolean

For the Task Action, I want to set the “Email ID” client setting to the value I find in the file, or to the empty string “” if my computer name is not found in the file:

setting "Email ID"="{((following text of first "%09" of lines whose (preceding text of first "%09" of it as lowercase = computer name as lowercase) of files "email.txt" of client folders of sites whose (name of it = "HCL-Lab-Services-Test")) | "")}" on "{parameter "action issue date" of action}" for client

3 Likes

we dont want to send files to clients, instead putting email id against each client via console. You told that can be done via Location Property wizard, can you please share some screenshots of how we’d use the Location Property Wizard to update the values.

Have a look at this post from @bradsexton81 where he describes customing the Location Property Wizard.

BigFix - Customizing the Location by Subnet Property
https://www.linkedin.com/pulse/bigfix-customizing-location-subnet-property-brad-sexton

His example maps logged-on username to email address, you would instead use relevance like computer name as uppercase . And make sure the spreadsheet you paste in has the hostnames as uppercase as well.

1 Like

It would be a great help if you could guide me with the screenshots to use Location Property Wizard for mapping email address against User ID/Computer.

please provide below 2 examples

  1. Map Email address towards Computer
  2. Map email address towards logged-on user name

please help here with the exact configuration