first commit
This commit is contained in:
Executable
+5
@@ -0,0 +1,5 @@
|
||||
$MyVariable="CZC94881W3"
|
||||
echo $MyVariable
|
||||
Get-Service -Name klnagent -ComputerName $MyVariable
|
||||
Get-Service -Name klnagent -ComputerName $MyVariable | Set-Service -Status Running
|
||||
Get-Service -Name klnagent -ComputerName $MyVariable
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
$FOLDER = 'C:\TMP'
|
||||
$MICRO = 'C:\Program Files (x86)\Trend Micro\Security Agent\PccNTMon.exe'
|
||||
$FOLDERS = 'C:\Sony\Sonaps'
|
||||
|
||||
if (Test-Path -Path $FOLDER) {
|
||||
"Adresar TMP existuje"
|
||||
} else {
|
||||
mkdir c:\TMP
|
||||
}
|
||||
|
||||
Get-WmiObject -Class Win32_Product | where Name -like ("Kaspersky Endpoint Security*") |select IdentifyingNumber | ft -hide > C:\TMP\uuid_kasp.txt
|
||||
(gc C:\TMP\uuid_kasp.txt ) | ? {$_.trim() -ne "" } | set-content C:\TMP\uuid_kasp.txt
|
||||
$KES = Get-Content -Path C:\TMP\uuid_kasp.txt -TotalCount 1
|
||||
if ($KES) {
|
||||
start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList '/x', $KES, 'KLLOGIN=KLAdmin', 'KLPASSWD=I.*nform1976', '/qn' -Wait
|
||||
} else {
|
||||
"Nenalezen : Kaspersky Endpoint Security pro systém Windows"
|
||||
}
|
||||
|
||||
Get-WmiObject -Class Win32_Product | where Name -eq "Kaspersky Security Center Network Agent" |select IdentifyingNumber | ft -hide > C:\TMP\uuid_netagent.txt
|
||||
(gc C:\TMP\uuid_netagent.txt ) | ? {$_.trim() -ne "" } | set-content C:\TMP\uuid_netagent.txt
|
||||
$AGENT = Get-Content -Path C:\TMP\uuid_netagent.txt -TotalCount 1
|
||||
|
||||
if ($AGENT) {
|
||||
cp \\pn03\Instalace\Kaspersky\Cleaner\cleaner.exe c:\TMP\
|
||||
start-Process -FilePath "C:\TMP\cleaner.exe" -ArgumentList '/pc', $AGENT
|
||||
} else {
|
||||
"Nenalezen : Kaspersky Security Center Network Agent"
|
||||
}
|
||||
|
||||
|
||||
if (Test-Path -Path $MICRO ) {
|
||||
"Antivir je jiz naistalovany"
|
||||
} else {
|
||||
|
||||
if (Test-Path -Path $FOLDERS) {
|
||||
Write-Output "Počítč má adresáč $FOLDERS"
|
||||
$parms=@("/quiet", "/norestart" , "/lv", "C:\ApexOne.log";"/i";"\\pn03\Instalace\TrendMicro\Agents\AgentsApexCentral\Standalone\sonaps_agent_cloud_x64.msi")
|
||||
(Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList $parms -Wait -Passthru).ExitCode
|
||||
|
||||
}else{
|
||||
Write-Output "Počítč NEmá adresáč $FOLDERS"
|
||||
$parms=@("/quiet", "/norestart" , "/lv", "C:\ApexOne.log";"/i";"\\pn03\Instalace\TrendMicro\Agents\AgentsApexCentral\Standalone\agent_cloud_x64.msi")
|
||||
(Start-Process -FilePath "$env:systemroot\system32\msiexec.exe" -ArgumentList $parms -Wait -Passthru).ExitCode
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Wait-Event -SourceIdentifier "ProcessStarted" -Timeout 30
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
$serverlist = get-content ServerList.txt
|
||||
#$file = debug.txt
|
||||
foreach ($server in $serverlist) {
|
||||
if (@(Get-ADComputer $server -ErrorAction SilentlyContinue).Count) {
|
||||
$errorActionPreference = "SilentlyContinue"
|
||||
|
||||
}
|
||||
else {
|
||||
Write-Host $server
|
||||
#$server | Out-File $file
|
||||
write-output $server | add-content $home\Desktop\NejsouVAD.txt
|
||||
}
|
||||
}
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
function check-chassis {
|
||||
BEGIN {}
|
||||
PROCESS {
|
||||
#Write-Output "Processing $_ which is a:-"
|
||||
$computer = "$_"
|
||||
$chassis = Get-WmiObject win32_systemenclosure -computer $computer | select chassistypes
|
||||
if ($chassis.chassistypes -contains '3'){Write-Output "Desktop"}
|
||||
elseif ($chassis.chassistypes -contains '4'){Write-Output "Low Profile Desktop"}
|
||||
elseif ($chassis.chassistypes -contains '5'){Write-Output "Pizza Box"}
|
||||
elseif ($chassis.chassistypes -contains '6'){Write-Output "Mini Tower"}
|
||||
elseif ($chassis.chassistypes -contains '7'){Write-Output "Tower"}
|
||||
elseif ($chassis.chassistypes -contains '8'){Write-Output "Portable"}
|
||||
elseif ($chassis.chassistypes -contains '9'){Write-Output "Laptop"}
|
||||
elseif ($chassis.chassistypes -contains '10'){Write-Output "Notebook"}
|
||||
elseif ($chassis.chassistypes -contains '11'){Write-Output "Hand Held"}
|
||||
elseif ($chassis.chassistypes -contains '12'){Write-Output "Docking Station"}
|
||||
elseif ($chassis.chassistypes -contains '13'){Write-Output "All in One"}
|
||||
elseif ($chassis.chassistypes -contains '14'){Write-Output "Sub Notebook"}
|
||||
elseif ($chassis.chassistypes -contains '15'){Write-Output "Space-Saving"}
|
||||
elseif ($chassis.chassistypes -contains '16'){Write-Output "Lunch Box"}
|
||||
elseif ($chassis.chassistypes -contains '17'){Write-Output "Main System Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '18'){Write-Output "Expansion Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '19'){Write-Output "Sub Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '20'){Write-Output "Bus Expansion Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '21'){Write-Output "Peripheral Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '22'){Write-Output "Storage Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '23'){Write-Output "Rack Mount Chassis"}
|
||||
elseif ($chassis.chassistypes -contains '24'){Write-Output "Sealed-Case PC"}
|
||||
else {Write-output "Unknown"}
|
||||
|
||||
}
|
||||
END{}
|
||||
}
|
||||
|
||||
$a = "localhost" | check-chassis
|
||||
|
||||
Write-output $a
|
||||
Reference in New Issue
Block a user