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:
Please log in to answer
Posted by:
Desktop Jockey
7 years ago
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:
-
thanks a lot - rahimpal 7 years ago