/build/static/layout/Breadcrumb_cap_w.png

Can we update a file using KACE?

Can we update a file using KACE? need to update content of a file instead of replacing the file 



File:      VPN1.pcf 
Location:    C:\Program Files (x86)\Cisco Systems\VPN Client\Profiles

Content:
[main]
Description=
[main]
Description=
Host=10.10.10.120
AuthType=1
GroupName=Frost-NA1
GroupPwd=


I  want to change the HOST=10.10.10.120      to   HOST=10.10.10.150

2 Comments   [ + ] Show comments
  • Why can you not replace it? - rockhead44 7 years ago
  • yes thats what i thought, but profiles is not same for all users so had to replace the content of the file instead of file. - rahimpal 7 years ago

Answers (1)

Answer Summary:
Posted by: Desktop Jockey 7 years ago
Second Degree Green Belt
2

Top Answer

You can use powershell to complete this task. This should do the trick:
(Get-Content "C:\Program Files (x86)\Cisco Systems\VPN Client\Profiles\VPN1.pcf") | ForEach-Object { $_ -replace "Host=.+", "Host=BlahBlahBlah" } | Set-Content "C:\Program Files (x86)\Cisco Systems\VPN Client\Profiles\VPN1.pcf"

Comments:

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ