cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
894
Views
5
Helpful
5
Replies

Powershell and SX20 Backups

russell.5813
Level 1
Level 1

Good afternoon. My organization frequently implements new SX20 VTC systems. The system settings must be configured a certain way before being implemented on our network. This can be a time-consuming process, so I decided to configure one of the systems, save it as a backup, then use the backup to quickly upload settings onto new systems (after opening the file and changing name/alias). To speed up the process further, I made a Powershell script that will prompt the user for the SX20 name and alias, then save the changes in a new file. Problem is, when I try to upload this new file, I receive the error "Invalid file uploaded." The script ONLY changes the system name and alias and I've triple-checked to ensure it's not adding any extra characters to the file. I can go into the backup file, manually change these settings, and upload the file with no problems. I can only assume that there must be some feature (either with Powershell or the Backup files) that I'm not aware of that's causing the system to reject the upload. Has anyone experienced this, or have any idea what could be causing this?

1 Accepted Solution

Accepted Solutions

After playing around with the script, adding "-Encoding UTF8" to my out-file seems to have corrected the problem. I wouldn't have been able to come up with this without you pointing out the different formats, so thank you!

View solution in original post

5 Replies 5

Wayne DeNardi
VIP Alumni
VIP Alumni

Can you give us some more detail on how you are downloading and uploading the file?

Is your download just a grab of the output of the "xconfiguration" command?  If so, you need to remove the *c from the start of every line before dumping it back in via telnet/ssh (if that's what you're doing?).

Another thing that could cause an error is having a different software release on the endpoint you've backed up to the others you're deploying to.  Different version of software have additional or deprecated commands, so it's recommended that you make sure they're all running a very similar release.

Wayne
--
Please remember to rate responses and to mark your question as answered if appropriate.

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

Hi Wayne.

Basically what I'm doing is going into the system's Web interface, accessing Maintenance->Backup and Restore->Take Backup. It generates a .txt backup that I save to my desktop. I can go into this file and manually change the system name and alias and re-upload with no problems. If I generate a copy of the backup using my Powershell script (which also changes the name and alias) and try to upload this copy, I get the invalid file error.

Also, it may or may not be helpful, but when I save the original .txt backup from the Web interface, the information in the file isn't formatted-- it's a jumbled mess. When Powershell saves a copy, the new .txt is formatted so that it's much easier to read, so maybe this has something to do with the different versions you mentioned?

OK, the difference in readability sounds like the difference between the Unix and DOS/Windows end of line characters.

The original file, being in a unix format, only has a LF character at the end of each line.  Perhaps when you're editing it and re-saving it, this is being changed to the DOS/Windows format which has a CR followed by a LF at the end of each line.

I've just tried uploading one of each on an SX20 here and both formats work fine, so that doesn't seem to be the issue.

Are you sure there's not something else changing in your file?  And, as I queried before, are all your endpoints running the same software version (ie TC7.3.4)?

Wayne
--
Please remember to rate responses and to mark your question as answered if appropriate?

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

After playing around with the script, adding "-Encoding UTF8" to my out-file seems to have corrected the problem. I wouldn't have been able to come up with this without you pointing out the different formats, so thank you!

Would you be prepared to share the script with us? I am trying to achieve exactly the same task.