How to put a different file on Customer desktop based on who the Customer is

I need to put a file on customers’ desktops, but every customer will get a slightly different file. I assume I can use scripting variables and or dropdowns, but I just don’t know how to incorporate that into a script.

My thoughts are when I run a script, I want the dropdown to ask which client. If it the client is Joe’s Auto Repair, they will get the file for Joe’s Auto Repair. If the client is Randy’s Sandwiches, they will get the file for Randy’s Sandwiches.

Specifying the customer is easy. You can just do this:

Where are you downloading the file from and what kind of file is it?

I assumed I would upload it as a script file to be called within the scripting engine. The file is a Watchguard VPN configuration file (.wgssl)

If you upload as a script file, then it’s going to download that file to the asset. That file is static, so you can’t modify it based on customer. We have a VPN script for each client.

Off the top of my head, about the only thing I can think of is building a lot of logic into the script. If $customer = XYZ download this file from URL, and then duplicate to cover all your clients.

I assumed I would upload it as a script file to be called within the scripting engine. The file is a Watchguard VPN configuration file (.wgssl)

Well, based on how I understand the system works that may not be your best option. You can add required files to a Syncro script, but it’ll download all of them. You can set a variable at runtime if you want, but you can’t choose files from the Syncro script repository that way.

Now, if they all use the same base config with different settings maybe you could set some custom customer fields and pull those in as variables to fill in blanks in a script. I’m just making this up as I go, but something like setting IP address endpoints and ports as custom fields for the customer. Then you could pull those in as platform variables in the script.

Say you use $VPNPort and $VPNIP or something like that. I’m declaring them here, but you’d be pulling them in as platform variables.

vpnconf1

The resulting text file looks like this.

vpnconf2

The $VPNConfig variable using @ is a multi-line variable. You could literally just paste the entire config in there and then insert your other variables where needed.

Unfortunately, it is a pre-built config file downloaded from the Watchguard appliance, so there is no way to edit it.

That was kind if where I was going next. I’m not sure if it is worth the extra effort when I could just build an individual script per customer and call it a day.

In that case @Jimmie has the best idea. Host the configs somewhere and use the customer name as a way to specify which file to download.

But I bet even the pre-built config you downloaded could just be opened in a text editor.

Yeah because ideally, you’d want to put your customers in a dropdown variable so that no one could mistype the name, so it’s quite a bit to build out at first. I’m actually working on creating a master VPN script, but I don’t have to download a file. I put variables in at the customer level, but then in my script I have to check to make sure those fields are filled out and error if not, so it’s never as simple as we envision lol.

Sorry if this was stated this way, but I don’t think it was, and it expands a little on Jimmie’s idea but I think makes it easier.

If you host the config files someplace, name the files exactly as the customer name in Syncro, then you don’t haven need to tell it for AA customer grab AA, you can just use Syncro environment variables, grab the customer name and then invoke the download using the same name. I’m trying to explain it without going in depth.

So you have files:
customer1.wgssl
customer2.wgssl
customer3.wgssl

So like, you have https:\linktofiledirectory\

In your script instead of specifying manually which customer downloads which, just have your code match the filename to the customer name variable and download that file.

Something like this:

Invoke-WebRequest "https://urltouploadedfiles/$CustomerName.wgssl" -OutFile "C:\$CustomerName.wgssl"

This also means one script only can be ran against all your clients and it will just download the correct one.

Consider a custom variable in the customer record. We use that method all the time.