Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich bin seid längerer Zeit auf der Suche nach einen guten Script das mir ein paar DNS einträge in einer alten Zone die ggf. ausgemistet werden soll durchcheckt. alte DNS einträge (Ü500) manuel ausmisten ist eklig :D

da wir IT'ler ja allgemein faul sind aber uns die faulheit erst erarbeiten müssen, zerbrech ich mir seid einer gewissen Zeit den kopf über sämtliche Scripts.. nungut, ich hab das mal in pseudocode veranschaulicht.

Zustand 1 = ok.

Zustand 0 = nicht ok.

ping "hostname" + domainname

case1: (0)

--> schreibe in logdatei

case2: (1)

do nslookup --> schreibe in loggdatei

wäre für .vbs - .ps1 für alle schweinerein offen ;-)

habe schon diverse Sachen probiert, aber bin leider immer mal wieder auf die schnautze gefallen :(

Vieleicht kann mir einer von euch schlauen FIAE helfen :)))))

  • Autor

z.b.


Set objExcel = CreateObject("Excel.Application")

 objExcel.Visible = True

 objExcel.Workbooks.Add

 intRow = 2


 objExcel.Cells(1, 1).Value = "Machine Name"

 objExcel.Cells(1, 2).Value = "Results"


 Set Fso = CreateObject("Scripting.FileSystemObject")

 Set InputFile = fso.OpenTextFile("MachineList.Txt")


 Do While Not (InputFile.atEndOfStream)

 HostName = InputFile.ReadLine


 Set WshShell = WScript.CreateObject("WScript.Shell")

 Ping = WshShell.Run("ping -n 1 " & HostName, 0, True)


 objExcel.Cells(intRow, 1).Value = HostName


 Select Case Ping

 Case 0 objExcel.Cells(intRow, 2).Value = "On Line"

 Case 1 objExcel.Cells(intRow, 2).Value = "Off Line"

 End Select


 intRow = intRow + 1

 Loop


 objExcel.Range("A1:B1").Select

 objExcel.Selection.Interior.ColorIndex = 19

 objExcel.Selection.Font.ColorIndex = 11

 objExcel.Selection.Font.Bold = True

 objExcel.Cells.EntireColumn.AutoFit 

tut mein ping aber bekomm den nslookup nicht rein.

ich habe jetzt hier leider keinen vernünftigen vbs debugger und kenn jetzt auch nicht die ganzen excel-objekt-befehle auswendig....

wirf mal den ganzen quatsch von wegen inputfile und outputfile raus, setzte den nslookup-befehl rein und setzte die zu überprüfenden einträge ntweder mit ner inputbox oder hart per const rein. (und den output per msgbox) dann poste mal den debugger-output. wenn das alles sauber läuft und auch die fallunterscheidung sauber implementiert ist, dann kannste dich um den rest kümmern.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.