Commit 3abd55fa authored by Olivier De Marchi's avatar Olivier De Marchi
Browse files

add Network Agent password in set-password

parent e98fea25
$KeyFile = Read-Host -Prompt "Key File (please put .key extension)"
$Password = Read-Host -AsSecureString -Prompt "Password to secure"
$AgentPassword = Read-Host -AsSecureString -Prompt "Network Agent Password to secure"
if ($KeyFile) {
$Key = New-Object Byte[] 32 # create key AES 256-bit key (32 bytes)
......@@ -8,6 +9,7 @@ if ($KeyFile) {
$Key | Out-File $KeyFile
$EncryptedPass = ConvertFrom-SecureString -SecureString $Password -Key $Key
$AgentEncryptedPass = ConvertFrom-SecureString -SecureString $AgentPassword -Key $Key
}
Write-Output ""
......@@ -15,6 +17,7 @@ Write-Output "# Lines to add in your configuration file Custom-VarOverload.psm1"
Write-Output "# or in the auto delete one Custom-VarAutodel.psm1"
Write-Output ""
Write-Output "`$Global:SWMB_Custom.KesSecureString = '$EncryptedPass'"
Write-Output "`$Global:SWMB_Custom.AgentSecureString = '$AgentEncryptedPass'"
Write-Output "`$Global:SWMB_Custom.KesKeyFile = '$KeyFile'"
Write-Output ""
......@@ -24,6 +27,7 @@ If (!(Test-Path -LiteralPath ".\Custom-VarAutodel.psm1")) {
Write-Output "
# Configuration for Kaspersky Endpoint
`$Global:SWMB_Custom.KesSecureString = '$EncryptedPass'
`$Global:SWMB_Custom.AgentSecureString = '$AgentEncryptedPass'
`$Global:SWMB_Custom.KesKeyFile = '$KeyFile'
" | Out-File -FilePath ".\Custom-VarAutodel.psm1" -NoClobber
}
......@@ -33,6 +37,7 @@ If (!(Test-Path -LiteralPath ".\Custom-VarAutodel.psm1")) {
Write-Output "
# Configuration for Kaspersky Endpoint
`$Global:SWMB_Custom.KesSecureString = '$EncryptedPass'
`$Global:SWMB_Custom.AgentSecureString = '$AgentEncryptedPass'
`$Global:SWMB_Custom.KesKeyFile = '$KeyFile'
" | Out-File -FilePath ".\Custom-VarOverload.psm1" -Append
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment