Du rufst den Abschnitt aber schon auf? Einfach nur den Abschnitt einfügen reicht nicht.
Also bspw. wie üblich in Product:
P.S. Könnte auch unsere Sicherheitseinstellung sein, aber wir mussten den Umweg gehen über quasi "Als Administrator ausführen":
Code: Select all
[Product]
#Set:Installation, DONTDELETE
#Reg:ActivateSecurityCenter,DONTDELETE
[Set:Installation]
AddMeter -1
CallHidden "cmd.exe" /c powershell.exe -executionpolicy bypass -File "%SRC%\wdefenderadmin.ps1"
WaitWhileProcessExists "cmd.exe",60
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status,OrgId") == "0" Then "Set:InstallErrorReg" EndIf
If "%ErrorLevel%" <> "0" Then "SET:InstallationError" EndIf
[Reg:ActivateSecurityCenter]
;Wartungscenter aktivieren
HKLM,"SYSTEM\CurrentControlSet\Services\wscsvc","Start",0x00010001,"0x00000002"
[Set:InstallErrorReg]
ErrorLogMsg "OrgId nicht in Registry gefunden"
Abort
[Set:InstallationError]
ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% wdefenderadmin.ps1
Abort
[Set:DeInstallationError]
-Abort
-ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText%
wdefenderadmin.ps1
Code: Select all
# Prüft ob administrativ ausgeführt wird. Wenn nicht ruft es sich selber nochmal so auf und macht unten weiter
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$princ = New-Object System.Security.Principal.WindowsPrincipal($identity)
if(!$princ.IsInRole( `
[System.Security.Principal.WindowsBuiltInRole]::Administrator))
{
$powershell = [System.Diagnostics.Process]::GetCurrentProcess()
$psi = New-Object System.Diagnostics.ProcessStartInfo $powerShell.Path
$script = $MyInvocation.MyCommand.Path
$prm = $script
foreach($a in $args) {
$prm += ' ' + $a
}
$psi.Arguments = $prm
$psi.Verb = "runas"
[System.Diagnostics.Process]::Start($psi) | Out-Null
return;
}
# Netzwerkstandort auf Privat setzen
invoke-item "C:\EmpirumAgent\Packages\<lokalerOrdner>\WindowsDefenderATPOnboardingScript.cmd"