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.

Script zum auslesen von WMI

Empfohlene Antworten

Veröffentlicht

Hi,

suche ein Perl Script was mittels WMI, Festplatten im Netz inventarisiert also von den Rechnern und diese dann ausgibt mit Prozentualen Werten wieviel Speicher noch frei ist. HAt jemand sowas oder weiss einer wo ich sowas finde ?

  • Autor

use Win32::OLE ('in');


	#   Angaben zum PC anpassen !

	$pc       = "192.168.077.128";			# Namen oder IP. Aktueller PC = "."

	$benutzer = "wmiadmin";	   		# Benutzeraccount

	$passwort = "adminwmi";           	# Passwort



use warnings;

use Win32::NetAdmin qw[GetServers GetError SV_TYPE_ALL];


my @servers;

GetServers("", "it-boerde", SV_TYPE_ALL, \@servers) or die "Failed to browse servers: " . GetError() . "\n";


print join "\n", @servers, "" if @servers and shift;

print scalar @servers . " client(s) found.\n";


print "@servers";


$anzahl = scalar @servers;


#

#   Variante 3. Besorgen der SWbemLocators funktioniert mit allen Skripting Hosts. 

    $wbemlocator =  Win32::OLE->new("WbemScripting.SWbemLocator") or

        die "can't create locator object: ".Win32::OLE->LastError(  )."\n";

#

#   Besorgen des WbemServices aus dem WbemLocator. Fuer Variante 2 und 3 Kommentare entfernen

#   Moegliche Parameter: Maschine, "root/cimv2", User, Passwort. NUR REMOTE AUFRUFE

    $wbemservices = $wbemlocator->ConnectServer($pc,"root/cimv2",$benutzer,$passwort) 

        or die "can't create server object: ".Win32::OLE->LastError(  )."\n"; 




    if ($wbemservices eq "") {

    	print ("Keine Verbindung moeglich! \nÜberpruefe User und Passwort.\nSiehe auch C:\\WINNT\\system32\\wbem\Logs");

    }




	else {

		$wbemObject = $wbemservices->InstancesOf("Win32_PerfFormattedData_PerfDisk_LogicalDisk");


		foreach $wbemObject (in $wbemObjectSet)

		{


			print("Freie Festplattenkapazitaet Partition $Partition: " . $wbemObject->PercentFreeSpace);

			$Partition = $Partition + 1;


			if ($wbemObject->PercentFreeSpace < 10){

				print(" !!!!!!!!!!\n");

			}

			else {

				print("\n");

			}

		}

	}

print("Ende");

Soweit bin ich schon wie kann ich denn nun Rechner aus dem Netz auslesen und hier integrieren ? Kann mir da einer BIDDE helfen ?

viele....vielleicht, aber bisher war scheinbar keiner von denen Online.

Vielleicht beschreibst du dein Problem mal genauer, was genau willst du wie integrieren ?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.