Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support (Russian)
  3. Есть идеи как достать "original install date" Windows?

Есть идеи как достать "original install date" Windows?

Scheduled Pinned Locked Moved Support (Russian)
3 Posts 1 Posters 4.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    A
    Akira
    wrote on last edited by
    #1

    Т.е. дату установки системы.
    Через NetXMS, естественно.

    UPD:
    Кое-что придумал, через внешнюю команду reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v InstallDate

    Получил число 0x542a4c6f. Чешу репу, что с ним делать в Transformation.

    1 Reply Last reply
    0
    • A
      A
      Akira
      wrote on last edited by
      #2

      Все. Расходимся. Смотреть больше не на что.

      Решение найдено самостоятельно.

      На случай если кому понадобится:

      Содержимое файла install_date.cmd

      @echo OFF
      
      setlocal ENABLEEXTENSIONS
      set KEY_NAME=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
      set VALUE_NAME=InstallDate
      
      FOR /F "skip=2 tokens=1,2*" %%A IN ('REG QUERY "%KEY_NAME%" /v "%VALUE_NAME%" 2^>nul') DO (
          set ValueName=%%A
          set ValueType=%%B
          set ValueValue=%%C
      )
      
      
      SETLOCAL
      set /a dec=%ValueValue%
      ( ENDLOCAL & REM RETURN VALUES
          IF "%~2" NEQ "" (SET %~2=%dec%) ELSE ECHO.%dec%
      )
      

      Строка в агенте
      ExternalParameter = InstallDate:C:\scripts\install_date.cmd

      DCI значение
      String

      Transformation в DCI
      strftime("%Y.%m.%d", $1)

      Получаем значение вида 2015.01.19

      1 Reply Last reply
      0
      • A
        A
        Akira
        wrote on last edited by
        #3

         ;D

        оказалось можно еще проще

        в агенте
        SubAgent = wmi.nsm

        DCI
        WMI.Query(root\CIMV2,SELECT * FROM Win32_OperatingSystem,InstallDate)

        Transformation
        substr($1, 0, 4).".".substr($1, 5, 2).".".substr($1, 7, 2)

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups