• Почему не отрабатывает VBS скрипт?

    @HightWolt Автор вопроса
    varByteArray = web.ResponseBody
       Set web = Nothing
       'Now save the file with any available method
       On Error Resume Next
       Set ado = Nothing
       Set ado = CreateObject("ADODB.Stream")
       If ado Is Nothing Then
          Set fs = CreateObject("Scripting.FileSystemObject")
          Set ts = fs.OpenTextFile(baseName(strUrl), ForWriting, True)
          strData = ""
          strBuffer = ""
          For lngCounter = 0 to UBound(varByteArray)
             ts.Write Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1)))
          Next
          ts.Close
       Else
          ado.Type = adTypeBinary
          ado.Open
          ado.Write varByteArray
          ado.SaveToFile CreateObject("WScript.Shell").ExpandEnvironmentStrings("%TEMP%") & "\" & strSetup, adSaveCreateOverWrite
          ado.Close
       End If
       SaveWebBinary = True
    End Function
    
    Function ShowMessage(strMessage)
       If LCase(Verbose) <> "no" Then
          WScript.Echo strMessage
       End If
    End Function
    
    '
    '
    ' MAIN
    '
    '
    
    Dim nMinutesToAdvance, strCmd, strSystemArchitecture, strTempDir, WshShell, objFSO
    Set WshShell = WScript.CreateObject("WScript.shell")
    
    nMinutesToAdvance = 5
    
    ' Get system architecture
    strSystemArchitecture = GetSystemArchitecture()
    If (strSystemArchitecture <> "x86") And (strSystemArchitecture <> "x64") Then
       ShowMessage("The system architecture is unknown or not supported.")
       ShowMessage("Deployment aborted!")
       WScript.Quit 1
    Else
       ShowMessage("System architecture detected: " & strSystemArchitecture)
    End If
    
    ' Check and auto detect SetupArchitecture
    Select Case LCase(SetupArchitecture)
       Case "x86"
          ' The setup architecture is 32-bit
          SetupArchitecture = "x86"
          Setup = Replace(Setup, "x86", SetupArchitecture, 1, 1, vbTextCompare)
          ShowMessage("Setup architecture: " & SetupArchitecture)
       Case "x64"
          ' The setup architecture is 64-bit
          SetupArchitecture = "x64"
          Setup = Replace(Setup, "x64", SetupArchitecture, 1, 1, vbTextCompare)
          ShowMessage("Setup architecture: " & SetupArchitecture)
       Case "auto"
          ' Auto detection of SetupArchitecture
          SetupArchitecture = strSystemArchitecture
          Setup = Replace(Setup, "Auto", SetupArchitecture, 1, 1, vbTextCompare)
          ShowMessage("Setup architecture detected: " & SetupArchitecture)
       Case Else
          ' The setup architecture is not supported
          ShowMessage("The setup architecture '" & SetupArchitecture & "' is not supported.")
          WScript.Quit 2
    End Select
    
    ' Check the relation between strSystemArchitecture and SetupArchitecture
    If (strSystemArchitecture = "x86") And (SetupArchitecture = "x64") Then
       ' It isn't possible to execute a 64-bit setup on a 32-bit operative system
       ShowMessage("It isn't possible to execute a 64-bit setup on a 32-bit operative system.")
       ShowMessage("Deployment aborted!")
       WScript.Quit 3
    End If
    
    If IsSelectedForce() Or IsInstallationNeeded(SetupVersion, SetupArchitecture, strSystemArchitecture) Then
       If isHttp(SetupLocation) Then
          ShowMessage("Downloading: " & SetupLocation & "/" & Setup)
          If SaveWebBinary(SetupLocation, Setup) Then
             strCmd = WshShell.ExpandEnvironmentStrings("%ComSpec%")
             strTempDir = WshShell.ExpandEnvironmentStrings("%TEMP%")
             ShowMessage("Running: """ & strTempDir & "\" & Setup & """ " & SetupOptions)
             WshShell.Run """" & strTempDir & "\" & Setup & """ " & SetupOptions, 0, True
             ShowMessage("Scheduling: DEL /Q /F """ & strTempDir & "\" & Setup & """")
             WshShell.Run "AT.EXE " & AdvanceTime(nMinutesToAdvance) & " " & strCmd & " /C ""DEL /Q /F """"" & strTempDir & "\" & Setup & """""", 0, True
             ShowMessage("Deployment done!")
          Else
             ShowMessage("Error downloading '" & SetupLocation & "\" & Setup & "'!")
          End If
       Else
          Set objFSO = CreateObject("Scripting.FileSystemObject")
          strTempDir = WshShell.ExpandEnvironmentStrings("%TEMP%")
          ShowMessage("Copying: " & SetupLocation & "\" & Setup & " to " & strTempDir & "\" & Setup)
          objFSO.CopyFile SetupLocation & "\" & Setup, strTempDir & "\" & Setup, true
          ShowMessage("Running: """ & strTempDir & "\" & Setup & """ " & SetupOptions)
          WshShell.Run "CMD.EXE /C """ & strTempDir & "\" & Setup & """ " & SetupOptions, 0, True
          ShowMessage("Deployment done!")
       End If
    Else
       ShowMessage("It isn't needed the installation of '" & Setup & "'.")
    End If
    
    WScript.Quit 0
    Написано
  • Как изменить пароль от учётной записи AD 150 пользователям???

    @HightWolt Автор вопроса
    Alexey Dmitriev, Проверял работает ли он с помощью:
    Get-ADUser test -Properties * | select name, pass*
    Построчно тоже проверял, в файл скрипт попадает, читает тоже без проблем.
    Пробовал убрать "ConvertTo-SecureString", так-же без изменений.
    Написано
  • Как сделать ограничение на кол-во неправильно введённых паролей Active Directory?

    @HightWolt Автор вопроса
    Применяю в DefaultDomainPolicy. Так-же пробовал создавать отдельную политику, после назначал её в фильтрах безопасности для всех, и прописывал gpupdate /force. При просмотре gpresult /r в политиках ничего не меняется...
    Написано
  • Почему может самостоятельно скопироваться конфиг с 1 свича на другой??

    @HightWolt Автор вопроса
    В логах нет никаких подозрительных действий, он не перезапускался, никто не заходил... тем более мне в телеграм приходят уведомления о пользователях которые подключаются на свитч.
    Изменился именно конфиг, IP остался тот-же, и некоторые порты(6шт) почему-то не были затронуты...
    Мистика не иначе
    Написано
  • Почему бот отправляет &amp;amp;quot;0&amp;amp;quot;?

    @HightWolt Автор вопроса
    К сожалению watchdog работает лишь с python3.7+ мне необходимо оставить python2.7, но спасибо за наводку!
    Написано
  • Как переместить определённые файлы в CentOS-7?

    @HightWolt Автор вопроса
    Большое спасибо!
    Написано
  • Есть ли инструменты для ротации логов кроме logrotate?

    @HightWolt Автор вопроса
    А как это по человечески проверить? Ели я пишу logrotate -f /etc/logrotate.d/example то ротация не проходит, несмотря на то, что в логе есть новые записи...
    Написано
  • Как отправить письмо postfix не от root пользователя?

    @HightWolt Автор вопроса
    Нашёл решение в итоге, мне нужно было внимательнее читать...
    Делаем:
    #nano /etc/postfix/generic
    В последнюю строку вписываем
    root@mail.mydomainname.com нужныйнамадрес@mydomainname.com
    # postmap generic
    Написано
  • Из за чего возникает ошибка PHP Warning – yii\base\ErrorException?

    @HightWolt Автор вопроса
    Проблема решилась с помощью выдачи прав httpd на чтение и запись в /opt (папка в которой всё что мне нужно)

    ls -lZ
    chcon -R -t httpd_sys_rw_content_t /opt
    ls -lZ
    Написано