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,

ich möchte per Powershell Script unseren Forest nach Computernamen durchsuchen.

Ich habe eine Excelliste mit den Computernamen und möchte diese Liste in Powershell einlesen und danach alle Domänen in dem Forest nach dem Namen durchsuchen.

Kenne mich leider nicht so mit Powershell aus.
Kann mir jemand helfen bzw. hat irgendwo noch ein Scrpit rumliegen, dass ich abändern kann.

Vielen Dank.

Grüße
Agilolfinger

  • Autor
vor 43 Minuten schrieb Caskett:

Da werden dir die AE wohl eher helfen können, da du in dem Script Schleifen etc. brauchst um die Excel-Datei komplett durchzugehen. Also könnt ich mir jetzt vorstellen :D

Verdammt ich hab au ne einfachere Lösung gehoft :D

Moin, 

wenn ich richtig verstehe was du machen möchtest geht das ganz einfach:

Pack die Computernamen in ein .txt File. FQDN muss nicht ein, einfach der plain name.

$computers = get-content C:\pfad\zum\txtfile\file.txt

foreach ($computer in $computers) { 
	get-adcomputer $computer 
    
    }

 

Du kannst die Excel auch einfach als CSV speichern und mit import-csv direkt in die PS einlesen, das geht ggf. besser, gerade wenn du die Objektstruktur aus der Excel übernehmen willst. 

Alternativ kannst du auch das Excel einlesen, das ist aber etwas komplexer.

Der Rest ist dann klassisches foreach...

 

Bearbeitet von -JP-

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.