Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
resinfo-gt
swmb
resinfo-swmb
Commits
56aa88b5
Commit
56aa88b5
authored
May 11, 2022
by
Gabriel Moreau
Browse files
Case if no key and empty pass
parent
ed4fd2cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
dists/uninstall-kaspersky/set-password-encrypted.ps1
dists/uninstall-kaspersky/set-password-encrypted.ps1
+17
-11
No files found.
dists/uninstall-kaspersky/set-password-encrypted.ps1
View file @
56aa88b5
...
...
@@ -19,25 +19,29 @@ If ($KesKeyFile) {
If
(
$KesAgentPassword
.
Length
-ne
0
)
{
$KesAgentSecureString
=
ConvertFrom-SecureString
-SecureString
$KesAgentPassword
-Key
$Key
}
}
Else
{
# Default values if no key file
$KesEndpointSecureString
=
ConvertFrom-SecureString
-SecureString
$KesEndpointPassword
-AsPlainText
$KesAgentSecureString
=
ConvertFrom-SecureString
-SecureString
$KesAgentPassword
-AsPlainText
If
(
$KesEndpointPassword
.
Length
-ne
0
)
{
$KesEndpointSecureString
=
ConvertFrom-SecureString
-SecureString
$KesEndpointPassword
-AsPlainText
}
If
(
$KesAgentPassword
.
Length
-ne
0
)
{
$KesAgentSecureString
=
ConvertFrom-SecureString
-SecureString
$KesAgentPassword
-AsPlainText
}
}
Write-Output
""
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
"# Configuration for Kaspersky Endpoint and Network Agent"
Write-Output
"
`$
Global:SWMB_Custom.KesPassword = '
$KesEndpointSecureString
'"
Write-Output
"
`$
Global:SWMB_Custom.KesAgentPass = '
$KesAgentSecureString
'"
Write-Output
"
`$
Global:SWMB_Custom.KesKeyFile = '
$KesKeyFile
'"
Write-Output
""
Write-Output
"
# Lines to add in your configuration file Custom-VarOverload.psm1
# or in the auto delete one Custom-VarAutodel.psm1
# Configuration for Kaspersky Endpoint and Network Agent
#
`$
Global:SWMB_Custom.KesLogin = 'KLAdmin'
#
`$
Global:SWMB_Custom.KesLogFile = ''
`$
Global:SWMB_Custom.KesPassword = '
$KesEndpointSecureString
'
`$
Global:SWMB_Custom.KesAgentPass = '
$KesAgentSecureString
'
`$
Global:SWMB_Custom.KesKeyFile = '
$KesKeyFile
'
"
If
(
!
(
Test-Path
-LiteralPath
".\Custom-VarAutodel.psm1"
))
{
$Query
=
Read-Host
-Prompt
"Do you want to create an auto-delete configuration file (Custom-VarAutodel) in the current folder [Y|n]"
If
(
$Query
.
ToLower
()
-ne
"n"
)
{
Write-Output
"
# Configuration for Kaspersky Endpoint and Network Agent
#
`$
Global:SWMB_Custom.KesLogin = 'KLAdmin'
#
`$
Global:SWMB_Custom.KesLogFile = ''
`$
Global:SWMB_Custom.KesPassword = '
$KesEndpointSecureString
'
`$
Global:SWMB_Custom.KesAgentPass = '
$KesAgentSecureString
'
`$
Global:SWMB_Custom.KesKeyFile = '
$KesKeyFile
'
...
...
@@ -48,6 +52,8 @@ If (!(Test-Path -LiteralPath ".\Custom-VarAutodel.psm1")) {
If
(
$Query
.
ToLower
()
-ne
"n"
)
{
Write-Output
"
# Configuration for Kaspersky Endpointand Network Agent
#
`$
Global:SWMB_Custom.KesLogin = 'KLAdmin'
#
`$
Global:SWMB_Custom.KesLogFile = ''
`$
Global:SWMB_Custom.KesPassword = '
$KesEndpointSecureString
'
`$
Global:SWMB_Custom.KesAgentPass = '
$KesAgentSecureString
`$
Global:SWMB_Custom.KesKeyFile = '
$KesKeyFile
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment