Question on Bulk Change

avatar
jbullen
Disabled

We have a bulk change that we need to make on over 800 devices and are not sure what is the best way to accomplish it. The entries are SSH and web based currently. We are using IP's as the host entries today, but need to change them to FQDN's instead. The good news is that the FQDN's are all standardized. For instance

Entry Name: BK00101
New FQDN to use for host: CAR-BK00101.fortiddns.com

As you can see we are using the existing entry name as part of the FQDN. Is there an easy way to script this change or something along those lines?

All Comments (13)

avatar

Hello,

I think it may be possible to do this via PowerShell.

Let me verify with my team and get back to you.

Best regards,

Jeff Dagenais

avatar

Hello John,

following command should work:

$domain = ".min.destens"
$connection.Terminal.Host = "CAR-" + $connection.Name + $domain
$RDM.Save()

Please test this command first on 3-10 entries to see if it work. You have only adapt the $domain in the first line and the "CAR-" if you had another prename. Enter the command by marking the desired session => Right Click => Edit => Edit (Special Actions)... => Custom Powershell Command
Please do a backup from your DB before you run this command against all your sessions!!

Regards,
Min

avatar

OK, did that as requested against a couple of units and the command does come back and says it successfully completed, however the host entries did not change and are still the original IP address.

avatar

Hello John,

against what kind of entries did you run the batch edit? It should work for SSH Shell entries. (Tested it succefully on my side with version 13.5.0)

Just to be sure - the session now (before you run the command) looks like:
Name = a part from the hostname
Host = IP Address
?

Regards,
Min

avatar

I did the test on SSH entries, although I have web ones to do as well.

Yes, the entry name right now is what will become part of the host name, and the current host data is an IP address currently.

So entry BK00101 has a host entry of 96.97.56.2. I need to change the host entry to CAR-BK00101.fortiddns.com

We are running this against a 13.5 RDM with DVLS 5.0

avatar

Hi,

tried it again now and here it works perfectly. Attached my test entry (should be the same as on your side)

Now I select the entry => Right click => Edit => Edit (Special Actions)... => Custom PowerShell command ==>

$domain = ".fortiddns.com"
$connection.Terminal.Host = "CAR-" + $connection.Name + $domain
$RDM.Save()

click ok and the host name looks like: CAR-BK00101.fortiddns.com

Regards,
Min

BK00101.rdm

avatar

OK, I copied your exact commands into the window and still get the same result, the results windows says two success but the entries are still the same. See attached screenshot of properties

Capture.PNG

avatar

Hi John,

sorry to say, but this isn`t a SSH Shell entry - it is a Putty (SSH Shell Rebex) - it is not the same as the native SSH Shell entry. Attached you can see the difference.

Here I have to investigate if for this entry a batch edit for this will work.

Your entry:


My entry:


PS: if you run my mentioned command on my attached session, you will see it works ;)
Regards,
Min

avatar

Hi John,

now finally this command should work for you:

$domain = ".fortiddns.com"
$connection.Putty.Host = "CAR-" + $connection.Name + $domain
$RDM.Save()

Regards,
Min

avatar

Worked perfectly. So what change is required to make that work for web? Screenshot of entry attached

Capture2.PNG

avatar

Hi,

for the web entries please use this comand:

$domain = ".fortiddns.com"
$connection.WebBrowserUrl = "https://CAR-" + $connection.Name + $domain
$RDM.Save()

Last, but not least, I recommend to read this about the native SSH Entry and Putty (Rebex) entries - good explanation from Hubert :)

Regards,
Min

avatar

Awesome, that has saved me so much time. Thank you!

avatar

You're welcome :)

Regards,
Min