Autor Thema: Script-Bibliothek  (Gelesen 4316 mal)

Offline egehlhaar

  • Frischling
  • *
  • Beiträge: 31
  • Geschlecht: Männlich
  • Notes/Domino kicks ass!!
    • SWMS Systemtechnik Ingenieurgesellschaft mbH
Script-Bibliothek
« am: 01.11.02 - 17:14:10 »
hallo,

ist ist möglich in Lotus-Script eine externe OLE Klassenbibliothek zu importieren, und wenn ja wie?

konkret geht es um die "Microsoft WMI Scripting Library"

Ich will darüber in meinem Lotusscript Methoden aufrufen, die es ermöglichen sich mit einem WBEM Namespace zu verbinden und darüber ein WQL statement abzusetzen.

z.B.
CreateObject("WbemScripting.SWbemLocator")

link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp
--
2 Domino 6.0.2 CF1 W2K SP3
20 Notes 6.0.2. CF1

Offline ata

  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 5.092
  • Geschlecht: Männlich
  • drenaiondrufflos
    • Anton Tauscher Privat
Re:Script-Bibliothek
« Antwort #1 am: 01.11.02 - 18:38:38 »
Hallole,

wie man externe Bibliotheken einbindet kann ich dir nicht sagen, aber vielleicht sind die Objekte bereits verfügbar. Wenn du im Designer bist und ein LotusScript Objekt bearbeitest kannst du über die Referenz feststellen, welche OLE/COM Objekte zur Verfügung stehen.

ata
Grüßle Toni :)

Offline feargus

  • Aktives Mitglied
  • ***
  • Beiträge: 144
  • Geschlecht: Männlich
  • Und welche Farbe soll die Datenbank haben?
Re:Script-Bibliothek
« Antwort #2 am: 29.11.02 - 14:00:03 »
probier das mal :)
WMI muss Installiert sein

Sub wmi
     Set oArrBIOS = GetObject("winmgmts:").ExecQuery("Select * From Win32_BIOS Where PrimaryBIOS=true") 'get the primary machine bios chip properties
     file=Freefile()
     Open "C:\wmi.txt" For Output As file
     Print #file,""
     Print #file,"[Bios]"
     Print "WMI Auswertung : Bios"
     Forall oBIOS In oArrBIOS
          Print #file,"Manufacturer: " + oBIOS.Manufacturer
          Print #file,"Name:         " + oBIOS.Name
          Print #file,"ReleaseDate: " + oBIOS.ReleaseDate
          Print #file,"PrimaryBIOS:  " + oBIOS.PrimaryBIOS
          Print #file,"BIOSVersion:  " + oBIOS.SMBIOSBIOSVersion
          Print #file,"MajorVersion: " + oBIOS.SMBIOSMajorVersion
          Print #file,"Status:       " + oBIOS.Status
          Print #file,"Version:      " + oBIOS.Version
          Print #file,"Seriennummer: " + oBIOS.SerialNumber
     End Forall
     Print #file,""
     Print #file,"[ComputerSystem]"
     Print "WMI Auswertung : Computersytem"
     Forall item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_ComputerSystem")
          Print #file,"Caption: " & Item.Caption
          Print #file,"PrimaryOwnerName: " & Item.PrimaryOwnerName
          Print #file,"Domain: " & Item.Domain
          Print #file,"DomainRole: " & Item.DomainRole
          Print #file,"Manufacturer: " & Item.Manufacturer
          Print #file,"Model: " & Item.Model
          Print #file,"NumberofProcessors: " & Item.NumberofProcessors
          Print #file,"SystemType: " & Item.SystemType
          Print #file,"SystemStartupDelay: " & Item.SystemStartupDelay
          Print #file,"TotalPhysicalMemory: " & Item.TotalPhysicalMemory
     End Forall
     Print #file,""
     Print #file,"[VideoController]"
     Print "WMI Auswertung : Videocontroller"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_VideoController")
          Print #file,"Caption: " & Item.Caption
          Print #file,"CurrentHorizontalResolution: " & Item.CurrentHorizontalResolution
          Print #file,"CurrentVerticalResolution: " & Item.CurrentVerticalResolution
          Print #file,"CurrentNumberOfColors: " & Item.CurrentNumberOfColors
     End Forall  
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[DiskDrive]"
     Print "WMI Auswertung : Diskdrive"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_DiskDrive")
          Print #file,"Caption: " & Item.Caption
          Print #file,"Description: " & Item.Description
          Print #file,"InterfaceType: " & Item.InterfaceType
          Print #file,"Manufacturer: " & Item.Manufacturer
          Print #file,"Partitions: " & Item.Partitions
          Print #file,"Sectors: " & Item.Sectors
          Print #file,"ScsiBus: " & Item.ScsiBus
          Print #file,"ScsiTargetID: " & Item.ScsiTargetID
          Print #file,"Size: " & Item.Size
     End Forall    
 
2 x 6.5.5 Mail Server on Windos 2003
2 x 6.5.5 Application Server on Windos 2003

Clients:
500 User (Win.XP) 6.5.5

Offline feargus

  • Aktives Mitglied
  • ***
  • Beiträge: 144
  • Geschlecht: Männlich
  • Und welche Farbe soll die Datenbank haben?
Re:Script-Bibliothek
« Antwort #3 am: 29.11.02 - 14:00:29 »
TEIL 2:

   Print #file,"-----------------------------------------------------------------------"
     Print #file,"[LogicalDisk]"
     Print "WMI Auswertung : Logical Disk"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_LogicalDisk")
          Print #file,"DriveType: " & Item.DriveType
          Print #file,"FileSystem: " & Item.FileSystem
          Print #file,"Freespace: " & Item.Freespace
          Print #file,"Name: " & Item.Name
          Print #file,"Size: " & Item.Size
          Print #file,"VolumeName: " & Item.VolumeName  'This item is Read/Write
          Print #file,"VolumeSerialNumber: " & Item.VolumeSerialNumber
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[NetworkAdapter]"
     Print "WMI Auswertung : Network Adapter"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_NetworkAdapter")
          Print"Description: " & Item.Description
          Print"MACAddress: " & Item.MACAddress
     End Forall
     
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[NetworkAdapterConfiguration]"
     Print "WMI Auswertung : Network Adapter Konfiguration"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_NetworkAdapterConfiguration")
          Print #file,"DefaultIpGateway: " & Item.DefaultIpGateway
          Print #file,"DNSServerSearchOrder: " & Item.DNSServerSearchOrder
          Print #file,"IPaddress: " & Item.IPaddress
          Print #file,"IPsubnet: " & Item.IPsubnet
          Print #file,"WinsPrimaryServer: " & Item.WinsPrimaryServer
          Print #file,"Description: " & Item.Description
          Print #file,"DHCPenabled: " & Item.DHCPenabled  'This item is Read/Write (-1: if DHCP is not enabled, 0: not enabled, 1: DHCP enabled)
          Print #file,"DHCPLeaseObtained: " & Item.DHCPLeaseObtained
          Print #file,"DHCPLeaseExpires: " & Item.DHCPLeaseExpires
          Print #file,"DHCPServer: " & Item.DHCPServer
          Print #file,"DNSHostname: " & Item.DNSHostname
          Print #file,"DNSDomain: " & Item.DNSDomain
          Print #file,"IPenabled: " & Item.IPenabled
          Print #file,"MACAddress: " & Item.MACAddress
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[NetworkLoginProfile]"
     Print "WMI Auswertung : Network Login Profile"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_NetworkLoginProfile")
          Print"Name: " & Item.Name
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[OperatingSystem]"
     Print "WMI Auswertung : Operating System"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_OperatingSystem")
          Print #file,"BootDevice: " & Item.BootDevice
          Print #file,"BuildNumber: " & Item.BuildNumber
          Print #file,"BuildType: " & Item.BuildType
          Print #file,"Caption: " & Item.Caption
          Print #file,"CSName: " & Item.CSname
          Print #file,"CsdVersion: " & Item.CsdVersion
          Print #file,"CurrentTimeZone: " & Item.CurrentTimeZone
          Print #file,"FreePhysicalMemory: " & Item.FreePhysicalMemory
          Print #file,"FreeVirtualMemory: " & Item.FreeVirtualMemory
          Print #file,"InstallDate: " & Item.InstallDate
          Print #file,"LastBootUpTime: " & Item.LastBootUpTime
          Print #file,"NumberofProcesses: " & Item.NumberofProcesses
          Print #file,"Organization: " & Item.Organization
          Print #file,"OsLanguage: " & Item.OsLanguage
          Print #file,"Primary: " & Item.Primary
          Print #file,"RegisteredUser: " & Item.RegisteredUser
          Print #file,"SerialNumber: " & Item.SerialNumber
          Print #file,"SystemDevice: " & Item.SystemDevice
          Print #file,"SystemDirectory: " & Item.SystemDirectory
          Print #file,"TotalVirtualMemorySize: " & Item.TotalVirtualMemorySize
          Print #file,"Version: " & Item.Version
          Print #file,"WindowsDirectory: " & Item.WindowsDirectory
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[Printer]"
     Print "WMI Auswertung : Printer"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_Printer")
          Print"Description: " & Item.Description
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"Processor"
     Print "WMI Auswertung : Prozessor"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_Processor")
          Print #file,"AddressWidth: " & Item.AddressWidth
          Print #file,"CurrentClockSpeed: " & Item.CurrentClockSpeed
          Print #file,"Extclock: " & Item.Extclock
          Print #file,"DeviceID: " & Item.DeviceID
          Print #file,"Description: " & Item.Description
          Print #file,"L2CacheSize: " & Item.L2CacheSize
          Print #file,"L2CacheSpeed: " & Item.L2CacheSpeed
          Print #file,"Name: " & Item.Name
          Print #file,"UpgradeMethod: " & Item.UpgradeMethod
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[Process]"
     Print "WMI Auswertung : Prozess"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_Process")
          Print #file,"Caption: " & Item.Caption
          Print #file,"CreationDate: " & Item.CreationDate
          Print #file,"Name: " & Item.Name
          Print #file,"Priority: " & Item.Priority
          Print #file,"ProcessID: " & ProcessID
          Print #file,"ThreadCount: " & Item.ThreadCount
          Print #file,"WorkingSetSize: " & Item.WorkingSetSize
     End Forall
     
     Print #file,"-----------------------------------------------------------------------"
     Print #file,"[Services]"
     Print "WMI Auswertung : Services"
     Forall Item In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_Service")
          Print #file,"Description: " & Item.Description
          Print #file,"DisplayName: " & Item.DisplayName
          Print #file,"ServiceType: " & Item.ServiceType
          Print #file,"State: " & Item.State
          Print #file,"Status: " & Item.Status
          Print #file,"StartMode: " & Item.StartMode
          Print #file,"StartName: " & Item.StartName
     End Forall
     Close file
     taskid=Shell("notepad.exe c:\wmi.txt" ,1)
End Sub
2 x 6.5.5 Mail Server on Windos 2003
2 x 6.5.5 Application Server on Windos 2003

Clients:
500 User (Win.XP) 6.5.5

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz