Jump to content

stefan4711

Members
  • Gesamte Inhalte

    80
  • Registriert seit

  • Letzter Besuch

Beiträge erstellt von stefan4711

  1. Hallo liebe Leute,

     

    irgenwie will mich mein Rechner mich veräppeln, ich habe eine simple If Anweisung, die aber im Else Fall einfach rausspringt, und ich weiss nicht warum, vielleicht siehr ja jemand den Fehler. Das Script sieht so aus:

     

    @Echo Off
    CD /D %~dp0
    SET "AF=C:\Users\Administrator\Downloads"
    
     FOR /f %%a in ('schtasks /query /TN _01_Regwerte_setzen /XML ^| findstr "UserId"') DO ( Set xml=%%a )
     set var2=%xml:~8,8%
     echo %var2%
     
    IF %var2%==S-1-5-18 (
      
      ECHO - Aufgabe laeuft bereits unter Systemaccount -
    	 Echo Es ist nichts zu machen
    	 pause
    	 EXIT
    	 
     	 ) ELSE (
     
       ECHO.
    	 ECHO - Aufgabe auf System umtragen
    	 pause
    	 FOR %%L in ( _01_Regwerte_setzen ) do SCHTASKS /Create /TN %%L /f /xml "%AF%\Aufgaben\%%L.xml">nul 2>&1
       pause
       )
     
    
     ECHO ALLES erledigt
     PAUSE
    EXIT	

    Das Ding ist, vor ein paar Monaten hat diese Logik bei mir noch funktioniert, ich denke wirklich langsam es sind die Updates, die Scripte plötlich nicht mehr funktionieren lassen

     

     

    lg

     

    Stefan

  2. @sunny: ja bei dem ersten hättest du recht gehabt, aber über das startscript als system, brauch ich ja keine credentials (SCHTASKS /Create /TN %L /f /xml "C:\Users\Administrator\Downloads\Aufgaben\%L.xml"), ist mir auch lieber so, werde natürlch den Teufel tun in ein Startscript so etwas zu hinterlegen.

     

    Danke noch mal für die interessante Diskussion die sich hieraus entwickelt hat

     

    lg und schöne Woche noch

  3. Ja aber ist doch klar, dass die user sich mit Name und Passwort anmelden, dass passiert doch in jedem Falle, ich denke wir reden an einander vorbei. Wie soll ich das denn auch verhindern. Aber da die Aufgabenstellung ja nun bekannt ist, lasse ich mich auch gerne von einem besseren Script überzeugen. Im wesentlichen geht es um die für jeden Rechner installierten Programme, schön wären natürlich auch noch so grundlegendes Sachen wie Speicher, Rechnername, CPU, Harddisk Freier Speicher..

     

    Und noch mal, was ist schlimm an der Reparaturinstallation? Also ich bekomme davon nichts mit, macht MS da was schlimmes, ihr habt doch hoffentlich Vertrauen zu MS? Sonst müsste ich extrem kalte Füße bekommen lach (Also ich versteh unter einer Reparaturinstallation eine ziemlich langwierige Angelegenheit, bei der ich aufgefordert werde ein Installationmedium zu präsentieren, sowas ist bei mir nicht der Fall.)

     

    lg

     

     

    Stefan

  4. Das mit den Scans stimmt tatsächlich, aber die Frage die sich mir jetzt stellt, ist folgende: Ist das jetzt wirklich schklimm? Zumindest bemerke ich davon beim Scan nichts als User, also ist auch die schlechte Performance beim Auslesen nicht so schlimm.

     

    @MurdocX: An welcher Stelle werden denn hier genau Credentials gespeichert? Du meinst jetzt im Script? Ich gebe an keiner Stelle Credentials ein, weder im Script, noch bei der Aufgabenerstellung. Die sind ja dann schon vorher da, und haben mit dem Script hier nichts zu tun, oder?

     

     

    lg

     

     

    Stefan

  5. So vielen Dank erstmal für die vielen Erkenntnisse und Ratschläge, es funktioniert jetzt so wie es soll. Ich will auch keine Credentials auf unsicheren Clients speichern. Das Sript wurde mir hier im Forum unter einer anderem Posting, vorgeschlagen, dass muss man nicht mutmaßen, dass hatte ich geschrieben, mittlerweile habe ich das natürlich auch längst reduziert. Aber auch wenn ich jetzt nicht der PS Crack bin konnte ich dort nicht erkennen was da nun angeblich für schlimme Sachen gemacht werden, ausser ein paar Abfragen.

     

    Das mit der Reparaturinstallation ist sicherlich ein interessanter Aspekt.

     

     

    Danke noch mal

     

    und schöne Woche

  6. Ok dann hat mir der letzte Beitrag doch noch indirekt geholfen, es funktioniert jetzt nämlich doch als System, aber nur wenn die Zielangabe auf den jeweiligen Lokalen PC zeig, d.h. jetzt fpr mich eines: Entweder eine Aufgabe mit Systemrechten fühhrt generell keien PS aus die auf Netzwerkfreigaben verweisen oder die Syntax der Zeile

     

    $DestinationFolder = "\\DFS.Dom.de\Freigaben\Daten\inv\$env:computername"

     

    ist nicht korrekt ?

     

     

    lg und Danke nochmal

     

     

    lg

     

    Stefan

  7. ok, also dass Script ist nicht von mir, ich meine es wurde mir hier im Forum in einem anderen Zusammenhang mal vorgeschlagen, vielleicht irre ich mich. Also liegt es am Script oder wie soll ich Deine Antwort verstehen? "Dumm ist der, der Dummes tut" ist ja erst mal nur ne Floskel und keine konkrete Anwort, aus meiner Sicht macht das Script genau was es soll. Was macht es denn dummes, mal direkt gefragt?

     

     

    lg

     

    Stefan

  8. Hallo erstmal,

     

    ok dann poste ich mal das PS das ausgeführt werden soll. Dachte zwar eigentlich sollte nichts zu dem Problem beitragen, aber in der EDV ist ja offenbar nichts so b***d, als dass es nicht irgendwie doch  sein könnte. Wie gesagt das Script soll für jeden User zu einer bestimmten Zeit, einmal die Woche ausgeführt werden.

     

    $DestinationTXT = Test-Path .\dest.txt
        If ($DestinationTXT -eq $false) {
            $DestinationFolder = "\\DFS.Dom.de\Freigaben\Daten\inv\$env:computername"
        }
        else {
            $DestinationFolder = Get-Content .\dest.txt
        }
    function Get-Inventory {
        [CmdletBinding()]
        param (
        [PSDefaultValue(Help = 'Current directory')]
        $DestinationFolder = '.\Computers\$env:computername'
        )
    
    $DestinationFolderPath = Test-Path $DestinationFolder
        If ($DestinationFolderPath -eq 'True') {
            Write-Verbose "Using existing folder: $($DestinationFolder)" -Verbose
        } 
        Else {
            mkdir "$($DestinationFolder)"
        }
    
    
    $ComputerName = hostname
    $user = $env:username
    $DesktopPath = [Environment]::GetFolderPath("Desktop")
    
    #Date
        $Date =  Get-Date -Format "yyyy-MM-dd HH:mm:ss"
    
    #CIM
        $System = Get-CimInstance Win32_ComputerSystem
        $BIOS = Get-CimInstance Win32_BIOS
        $SoftwareLicensing = Get-WmiObject SoftwareLicensingService
        $Win32Processor = Get-CimInstance Win32_Processor
        $Win32DiskDrive = Get-CimInstance Win32_DiskDrive
        $Win32MSFTPhysicalDisk = Get-CimInstance MSFT_PhysicalDisk -Namespace Root\Microsoft\Windows\Storage
        $WinOperatingSystem = Get-CimInstance Win32_OperatingSystem
        $Win32PhysicalMemory = Get-CimInstance Win32_PhysicalMemory
        $VideoController = Get-CimInstance win32_VideoController
        $NetAdapterConf = Get-WmiObject -Class "Win32_NetworkAdapterConfiguration" -Filter "IpEnabled = $true"
    
    #IP octets
        $ipID = ipconfig | Where-Object {$_ -match "IPv4 Address"} | ForEach-Object{$_.Split(":")[1]}
        $oct0 = $ipID.trim().Split(".")[0]
        $oct1 = $ipID.trim().Split(".")[1]
        $oct2 = $ipID.trim().Split(".")[2]
        $oct3 = $ipID.trim().Split(".")[3]
    
        $PublicIP = (Invoke-WebRequest -uri "http://icanhazip.com/").Content
    
    
    Get-Disk | Select-Object DiskNumber, PartitionStyle, ProvisioningType, OperationalStatus, HealthStatus, BusType, UniqueIdFormat, OfflineReason, ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace, PassThroughServer, UniqueId, AdapterSerialNumber, AllocatedSize, BootFromDisk, FirmwareVersion, FriendlyName, Guid, IsBoot, IsClustered, IsHighlyAvailable, IsOffline, IsReadOnly, IsScaleOut, IsSystem, LargestFreeExtent, Location, LogicalSectorSize, Manufacturer, Model, Number, NumberOfPartitions, Path, PhysicalSectorSize, SerialNumber, Signature, Size,
     @{label='CompSerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Export-Csv -Path $DestinationFolder\CompDisk.csv -Append -NoTypeInformation
    
    Get-Volume |Select-Object OperationalStatus, HealthStatus, DriveType, FileSystemType, DedupMode, ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace, PassThroughServer, UniqueId, AllocationUnitSize, DriveLetter, FileSystem, FileSystemLabel, Path, Size, SizeRemaining, PSComputerName,
    
     @{label='CompSerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Export-Csv -Path $DestinationFolder\CompVolume.csv -Append -NoTypeInformation
    
    $Win32DiskDrive | Select-Object PSComputerName, ConfigManagerErrorCode, LastErrorCode, NeedsCleaning, Status, DeviceID, StatusInfo, Partitions, BytesPerSector, ConfigManagerUserConfig, DefaultBlockSize, Index, InstallDate, InterfaceType, MaxBlockSize, MaxMediaSize, MinBlockSize, NumberOfMediaSupported, SectorsPerTrack, Size, TotalCylinders, TotalHeads, TotalSectors, TotalTracks, TracksPerCylinder, __GENUS, __CLASS, __SUPERCLASS, __DYNASTY, __RELPATH, __PROPERTY_COUNT, __DERIVATION, __SERVER, __NAMESPACE, __PATH, Availability, Capabilities, CapabilityDescriptions, Caption, CompressionMethod, CreationClassName, Description, ErrorCleared, ErrorDescription, ErrorMethodology, FirmwareRevision, Manufacturer, MediaLoaded, MediaType, Model, Name, PNPDeviceID, PowerManagementCapabilities, PowerManagementSupported, SCSIBus, SCSILogicalUnit, SCSIPort, SCSITargetId, SerialNumber, Signature, SystemCreationClassName, SystemName, Scope, Path, Options, ClassPath, Properties, SystemProperties, Qualifiers, Site, Container,
    
     @{label='CompSerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Export-Csv -Path $DestinationFolder\CompDrive.csv -Append -NoTypeInformation
    
    $Win32MSFTPhysicalDisk |Select-Object ClassName, Usage, OperationalStatus, UniqueIdFormat, HealthStatus, BusType, CannotPoolReason, SupportedUsages, MediaType, SpindleSpeed, ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace, PassThroughServer, UniqueId, Description, FriendlyName, Manufacturer, Model, OperationalDetails, PhysicalLocation, SerialNumber, AdapterSerialNumber, AllocatedSize, CanPool, DeviceId, EnclosureNumber, FirmwareVersion, IsIndicationEnabled, IsPartial, LogicalSectorSize, OtherCannotPoolReasonDescription, PartNumber, PhysicalSectorSize, Size, SlotNumber, SoftwareVersion, StoragePoolUniqueId, VirtualDiskFootprint, PSComputerName,
    
     @{label='CompSerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Export-Csv -Path $DestinationFolder\PhysicalDisk.csv -Append -NoTypeInformation
    
    
    
    
    #System
    Write-Output "Windows: $($SoftwareLicensing.Version)"
    $ProductKey = $SoftwareLicensing.OA3xOriginalProductKey 
    Write-Verbose "Key: $ProductKey" -Verbose
    
    
    Write-Output "CPU: $( $Win32Processor.Name)"
    $MaxGHz =  $Win32Processor | ForEach-Object {[math]::Round($_.MaxClockSpeed / 10)}    #Rounds the clock speed to go from MHz to GHz.
    $MaxGHz = "$($MaxGHz / 100) GHz"    #Adds the decimal place and GHz label.
    
    #Memory
    $memory = Get-WmiObject Win32_computersystem | ForEach-Object {[math]::round($_.totalPhysicalMemory / 1GB)}   #Displays the amount of system memory rounded to the nearest gigabyte.
    Write-Output "RAM: $($memory) GB"
    
    $FreeMemory = [math]::Round($WinOperatingSystem.FreePhysicalMemory/1mb,2)
    $FreeMemoryPercent = [math]::Round(($WinOperatingSystem.FreePhysicalMemory/$WinOperatingSystem.TotalVisibleMemorySize)*100,2)
    
    <#Memory#>
        $Win32PhysicalMemory | Select-Object Description, 
            InstallDate,
            Manufacturer,
            Model, 
            PartNumber,
            SerialNumber,
            Tag,
            FormFactor,
            BankLabel,
            Capacity,
            DataWidth,
            InterleavePosition,
            MemoryType,
            PositionInRow,
            Speed,
            TotalWidth,
            Attributes,
            ConfiguredClockSpeed,
            ConfiguredVoltage,
            DeviceLocator,
            InterleaveDataDepth,
            MaxVoltage,
            MinVoltage,
            SMBIOSMemoryType,
            TypeDetail,
            @{label = 'ComputerName'; e = { $ComputerName } },
            @{label = 'CompSerialNumber'; e = { $bios.SerialNumber } },
            @{label = 'Timestamp'; e = { $Date } } | Export-Csv -Path $DestinationFolder\Memory.csv -Append -NoTypeInformation
    
    
    <#CPU#>
        $CompCPU = [PSCustomObject]@{
            'ExtClock'                                = $Win32Processor.ExtClock;
            'L2CacheSize'                             = $Win32Processor.L2CacheSize
            'L2CacheSpeed'                            = $Win32Processor.L2CacheSpeed
            'MaxClockSpeed'                           = $Win32Processor.MaxClockSpeed;
            'PowerManagementSupported'                = $Win32Processor.PowerManagementSupported;
            'ProcessorType'                           = $Win32Processor.ProcessorType;
            'Revision'                                = $Win32Processor.Revision;
            'SocketDesignation'                       = $Win32Processor.SocketDesignation;
            'VoltageCaps'                             = $Win32Processor.VoltageCaps;
            'Architecture'                            = $Win32Processor.Architecture;
            'Caption'                                 = $Win32Processor.Caption;
            'CurrentVoltage'                          = $Win32Processor.CurrentVoltage;   
            'CurrentClockSpeed'                       = $Win32Processor.CurrentClockSpeed;
            'Description'                             = $Win32Processor.Description;
            'Family'                                  = $Win32Processor.Family;
            'L3CacheSize'                             = $Win32Processor.L3CacheSize;
            'L3CacheSpeed'                            = $Win32Processor.L3CacheSpeed;
            'Level'                                   = $Win32Processor.Level;
            'Manufacturer'                            = $Win32Processor.Manufacturer;
            'Name'                                    = $Win32Processor.Name;
            'NumberOfCores'                           = $Win32Processor.NumberOfCores;
            'NumberOfLogicalProcessors'               = $Win32Processor.NumberOfLogicalProcessors;
            'OtherFamilyDescription'                  = $Win32Processor.OtherFamilyDescription;
            'PartNumber'                              = $Win32Processor.PartNumber;
            'PNPDeviceID'                             = $Win32Processor.PNPDeviceID;
            'PowerManagementCapabilities'             = $Win32Processor.PowerManagementCapabilities;
            'ProcessorId'                             = $Win32Processor.ProcessorId;
            'SecondLevelAddressTranslationExtensions' = $Win32Processor.SecondLevelAddressTranslationExtensions;
            'SerialNumber'                            = $Win32Processor.SerialNumber;
            'Stepping'                                = $Win32Processor.Stepping;
            'SystemName'                              = $Win32Processor.SystemName;
            'ThreadCount'                             = $Win32Processor.ThreadCount;
            'UniqueId'                                = $Win32Processor.UniqueId;
            'UpgradeMethod'                           = $Win32Processor.UpgradeMethod;
            'ComputerSerialNumber'                    = $bios.SerialNumber;
            'Timestamp'                               = $date;
        }
    
    <#     $TestCPUCSV = Test-Path ".\Computers\CompCPU.csv"
        If ($TestCPUCSV -eq $true) {
            Write-Verbose "Using existing folder: .\Computers\CompCPU.csv" -Verbose
        } 
        Else {
            New-Item -ItemType File -Path .\Computers -Name CompCPU.csv
        }
        $GetCompCPU = Get-Content .\Computers\CompCPU.csv | Select-String -Pattern ($Win32Processor.Name)
        if ($null -eq $GetCompCPU) { #>
            $CompCPU | Export-Csv -Path $DestinationFolder\CPU.csv -Append -NoTypeInformation
    <#     }
        else {
            Write-Verbose "CPU already in database. Skipping..."
        } #>
    
    <#GPU#>  
        $VideoController | Select-Object InstallDate,
            Name,
            Status,
            Availability,
            ConfigManagerErrorCode,
            ConfigManagerUserConfig,
            DeviceID,
            CurrentHorizontalResolution,
            CurrentNumberOfColors,
            CurrentNumberOfColumns,
            CurrentNumberOfRows,
            CurrentRefreshRate,
            CurrentScanMode,
            CurrentVerticalResolution,
            MaxRefreshRate,
            MinRefreshRate,
            VideoMemoryType,
            VideoProcessor,
            VideoArchitecture,
            AdapterCompatibility,
            AdapterDACType,
            AdapterRAM,
            DitherType,
            DriverDate,
            DriverVersion,
            InfFilename,
            InfSection,
            VideoModeDescription,
            @{label = 'CompSerialNumber'; e = { $bios.SerialNumber } },
            @{label = 'Timestamp'; e = { $Date } } | Export-Csv -Path $DestinationFolder\GPU.csv -Append -NoTypeInformation
    
    <#Network Adapter#>
        Get-NetAdapter | Select-Object MacAddress,
            Status,
            LinkSpeed,
            MediaType,
            PhysicalMediaType,
            AdminStatus,
            MediaConnectionState,
            DriverInformation,
            DriverFileName,
            NdisVersion,
            InterfaceAlias,
            ifName,
            DriverVersion,
            Name,
            OperatingStatus,
            OperationalStatus,
            EnabledDefault,
            EnabledState,
            RequestedState,
            TimeOfLastStateChange,
            TransitioningToState,
            Speed,
            FullDuplex,
            PortNumber,
            ComponentID,
            ConnectorPresent,
            DeviceWakeUpEnable,
            DriverDate,
            DriverDateData,
            DriverProvider,
            EndPointInterface,
            HardwareInterface,
            Hidden,
            IMFilter,
            InterfaceDescription,
            InterfaceGuid,
            InterfaceIndex,
            iSCSIInterface,
            MediaDuplexState,
            MtuSize,
            PromiscuousMode,
            VlanID,
            @{label = 'CompSerialNumber'; e = { $bios.SerialNumber } },
            @{label = 'Timestamp'; e = { $Date } } | Export-Csv -Path $DestinationFolder\NetAdapter.csv -Append -NoTypeInformation
    
    
    <#IP Address#>
        Get-NetIPAddress | Select-Object PrefixOrigin,
            SuffixOrigin,
            Type,
            Store,
            AddressFamily,
            AddressState,
            EnabledDefault,
            EnabledState,
            RequestedState,
            TimeOfLastStateChange,
            TransitioningToState,
            AddressOrigin,
            IPv4Address,
            IPv6Address,
            PrefixLength,
            SubnetMask,
            InterfaceAlias,
            InterfaceIndex,
            IPAddress,
            PreferredLifetime,
            SkipAsSource,
            ValidLifetime,
            @{label = 'CompSerialNumber'; e = { $bios.SerialNumber } },
            @{label = 'Timestamp'; e = { $Date } } | Export-Csv -Path $DestinationFolder\NetIP.csv -Append -NoTypeInformation
    
    
            $NetAdapterConf |Select-Object DHCPLeaseExpires,
            Index,
            Description,
            DHCPEnabled,
            DHCPLeaseObtained,
            DHCPServer,
            DNSDomain,
            DNSDomainSuffixSearchOrder,
            DNSEnabledForWINSResolution,
            DNSServerSearchOrder,
            DomainDNSRegistrationEnabled,
            FullDNSRegistrationEnabled,
            IPAddress,
            IPConnectionMetric,
            IPEnabled,
            IPFilterSecurityEnabled,
            WINSEnableLMHostsLookup,
            WINSHostLookupFile,
            WINSPrimaryServer,
            WINSScopeID,
            WINSSecondaryServer,
            ArpAlwaysSourceRoute,
            ArpUseEtherSNAP,
            DatabasePath,
            DeadGWDetectEnabled,
            DefaultIPGateway,
            GatewayCostMetric,
            IGMPLevel,
            InterfaceIndex,
            IPPortSecurityEnabled,
            IPSecPermitIPProtocols,
            IPSecPermitTCPPorts,
            IPSecPermitUDPPorts,
            IPSubnet,
            KeepAliveInterval,
            KeepAliveTime,
            MACAddress,
            MTU,
            NumForwardPackets,
            PMTUBHDetectEnabled,
            PMTUDiscoveryEnabled,
            ServiceName,
            SettingID,
            TcpipNetbiosOptions,
            TcpMaxConnectRetransmissions,
            TcpMaxDataRetransmissions,
            TcpNumConnections,
            TcpUseRFC1122UrgentPointer,
            TcpWindowSize,
            @{label = 'CompSerialNumber'; e = { $bios.SerialNumber } },
            @{label = 'Timestamp'; e = { $Date } } | Export-Csv -Path $DestinationFolder\NetConf.csv -Append -NoTypeInformation
    
    <#
    Get-CimInstance Win32_ComputerSystem |Select-Object AdminPasswordStatus, BootupState, ChassisBootupState, KeyboardPasswordStatus, PowerOnPasswordStatus, PowerSupplyState, PowerState, FrontPanelResetStatus, ThermalState, Status, Name, PowerManagementCapabilities, PowerManagementSupported, Caption, Description, InstallDate, CreationClassName, NameFormat, PrimaryOwnerContact, PrimaryOwnerName, Roles, InitialLoadInfo, LastLoadInfo, ResetCapability, AutomaticManagedPagefile, AutomaticResetBootOption, AutomaticResetCapability, BootOptionOnLimit, BootOptionOnWatchDog, BootROMSupported, BootStatus, ChassisSKUNumber, CurrentTimeZone, DaylightInEffect, DNSHostName, Domain, DomainRole, EnableDaylightSavingsTime, HypervisorPresent, InfraredSupported, Manufacturer, Model, NetworkServerModeEnabled, NumberOfLogicalProcessors, NumberOfProcessors, OEMLogoBitmap, OEMStringArray, PartOfDomain, PauseAfterReset, PCSystemType, PCSystemTypeEx, ResetCount, ResetLimit, SupportContactDescription, SystemFamily, SystemSKUNumber, SystemStartupDelay, SystemStartupOptions, SystemStartupSetting, SystemType, TotalPhysicalMemory, UserName, WakeUpType, Workgroup, PSComputerName,  @{label='SerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date} | Export-Csv -Path $DestinationFolder\CompSystem.csv -Append -NoTypeInformation
    #>
    
     #Printers
    $Printer = Get-Printer
    <#$Printer |Select-Object RenderingMode, PrinterStatus, Type, DeviceType, Caption, Description, ElementName, InstanceID, CommunicationStatus, DetailedStatus, HealthState, InstallDate, Name, OperatingStatus, OperationalStatus, PrimaryStatus, Status, StatusDescriptions, BranchOfficeOfflineLogSizeMB, Comment, ComputerName, Datatype, DefaultJobPriority, DisableBranchOfficeLogging, DriverName, JobCount, KeepPrintedJobs, Location, PermissionSDDL, PortName, PrintProcessor, Priority, Published, SeparatorPageFile, Shared, ShareName, StartTime, UntilTime, WorkflowPolicy, PSComputerName,  @{label='SerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date} | Export-Csv -Path $DestinationFolder\CompPrinters.csv -Append -NoTypeInformation;
     #>
     
    
    #Flash
       #Pulls the currently installed version of Flash from the registry.
        #http://www.adobe.com/software/flash/about/?UPCDeviceType=Homepage&UPCLocale=en_US&UPCInstallLocale=en_US&
        $Flash =  Get-ItemProperty 'HKLM:\SOFTWARE\Macromedia\FlashPlayer\'
        $Flash = if ([string]::IsNullOrEmpty($Flash.CurrentVersion)) {
                     Write-Output 'NULL'
                 }
                 else {
                     Write-Output $Flash.CurrentVersion | ForEach-Object {$_ -replace ",", "."}     #Replaces commas “,” with periods “.” for consistency.
                 }
            Write-Verbose "Old Flash: $($Flash)"
    
        $FlashNPAPIKey = 'HKLM:\SOFTWARE\Macromedia\FlashPlayerPlugin'    #NPAPI Flash registry key
        $FlashNPAPITest = Test-Path $FlashNPAPIKey    #Check if it is instlled
        If ($FlashNPAPITest -eq "True") {
                $FlashNPAPI = Get-ItemProperty $FlashNPAPIKey
                Write-Verbose "Flash NPAPI: $($FlashNPAPI.Version)"
            }
            Else {
                $FlashNPAPI = Write-Output 'NULL'
                Write-Verbose "Flash NPAPI: NULL"
            }
    
    
        $FlashPPAPIKey = 'HKLM:\SOFTWARE\Macromedia\FlashPlayerPepper'
        $FlashPPAPITest = Test-Path $FlashPPAPIKey
        If ($FlashPPAPITest -eq "True") {
                $FlashPPAPI = Get-ItemProperty $FlashPPAPIKey
                Write-Verbose  "Flash PPAPI (Pepper): $($FlashPPAPI.Version)"
            }
             Else {
                $FlashPPAPI = Write-Output 'NULL'
                Write-Verbose "Flash PPAPI (Pepper): NULL"
            }
    
    
        $FlashActiveXKey = 'HKLM:\SOFTWARE\Macromedia\FlashPlayerActiveX'
        $FlashActiveXTest = Test-Path $FlashNPAPIKey
        If($FlashActiveXTest -eq "True") {
                $FlashActiveX = Get-ItemProperty $FlashActiveXKey
                Write-Verbose "Flash ActiveX: $($FlashActiveX.Version)"         
            }
            Else {
                $FlashActiveX = Write-Output 'NULL'
                Write-Verbose "Flash ActiveX: NULL"
            }
    
    
    #Java
        #OLDer $Java = Get-WmiObject Win32_Product -Filter "Name like 'Java % Update %'" | where {$_.Name -notlike '* Development Kit *'} | Sort-Object Version
        #OLD $Java = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F64180111F0}'    #may need to make the key a variable with *
        
        IF ($system.SystemType -eq "X86-based PC") {
            $JavaKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F*}'    #Use this key if on a 32-bit system
        }
        Else {
            $JavaKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F*}'    #Use this key if on a 64-bit system    
        }
    
        $JavaTest = Test-Path $JavaKey    #test to see if Java is installed
        If ($JavaTest -eq "True") {    #if it is... 
            $Java = Get-ItemProperty $JavaKey | Where-Object {$_.DisplayName -like 'Java *'}    #Get the properties of the correct registry key
            Write-Verbose "Java Runtime Environment (JRE): $($Java.DisplayVersion)"    #Display the version of JRE to the console
        }
        Else {
            $Java = Write-Output 'NULL'
            Write-Verbose "Java Runtime Environment (JRE): NULL or incorect '*bit' version installed"
        }
    
    
    #Chrome
        IF ($system.SystemType -eq "X86-based PC") 
        {
    	    $ChromeKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome'
        }
        Else 
        {
            $ChromeKey = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\'
        }      
        $ChromeTest = Test-Path $ChromeKey
            If ($ChromeTest -eq "True")
            {
                $Chrome = Get-ItemProperty $ChromeKey
                Write-Verbose "Chrome: $($Chrome.Version)" -Verbose         
            } 
            Else 
            {
                $Chrome = Write-Output 'NULL'
                Write-Verbose "Chrome: NULL" -Verbose
            }
    
    
    #Firefox
        $FirefoxKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox*'
        $Firefox64Key = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox*'
    
        $FirefoxTest = Test-Path $FirefoxKey
        If ($FirefoxTest -eq "True")
        {
            $Firefox = Get-ItemProperty $FirefoxKey
            Write-Verbose "$($Firefox.Displayname)" -Verbose
        } 
        Else 
        {
                $Firefox = 'NULL'
                Write-Verbose "Firefox 32-bit: NULL" -Verbose
        }
    
        $Firefox64Test = Test-Path $Firefox64Key
        If ($Firefox64Test -eq "True")
        {
            $Firefox64 = Get-ItemProperty $Firefox64Key
            Write-Verbose "$($Firefox64.Displayname)" -Verbose
        } 
        Else 
        {
            $Firefox64 = 'NULL'
            Write-Verbose "Firefox 64-bit: NULL" -Verbose
        }
    
    
    #Internet Explorer
        $IE = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explorer'
    
    #Adobe Reader
        #$Reader = Get-WmiObject Win32_Product -Filter "Name like '% Reader %'"
        IF ($system.SystemType -eq "X86-based PC")
        {
            $ReaderKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1*}'
        }
        Else
        {
            $ReaderKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7*}'
        }
        $ReaderTest = Test-Path $ReaderKey
            If ($ReaderTest -eq "True") 
            {
                $Reader = Get-ItemProperty $ReaderKey
                Write-Verbose "Adobe Reader: $($Reader.DisplayVersion)" -Verbose
            } 
            Else
            {
                $Reader = Write-Output 'NULL'
                Write-Verbose "Adobe Reader: NULL" -Verbose
            }
    
    #Google Drive
        $GoogleDrive = Get-Process *googledrive*
        If ([string]::IsNullOrEmpty($GoogleDrive)) {
            $GoogleDrive = Write-Output "Stopped"
            Write-Verbose "Googele Drive: Stopped" -Verbose
        }
        Else {
            $GoogleDrive = Write-Output "Running"
            Write-Verbose "Googele Drive: Running" -Verbose
        }
    
    
    #G Suite Sync
        IF ($system.SystemType -eq "X86-based PC") {
            $GSuiteKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CCE9211C-DF42-46CF-B0C5-4800C4882881}'
        }
        Else{
            $GSuiteKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CCE9211C-DF42-46CF-B0C5-4800C4882881}'
        }
        $GSuiteTest = Test-Path $GSuiteKey
            If ($GSuiteTest -eq "True") {
                $GSuite = Get-ItemProperty $GSuiteKey
                Write-Verbose "G Suite Sync: $($GSuite.DisplayVersion)"
            } 
            Else {
                $GSuite = Write-Output 'N/A'
                Write-Verbose "G Suite Sync not installed"
            }
    
    
    #McAfee
        $McAfeeKey = 'HKLM:\SOFTWARE\Wow6432Node\McAfee\Agent\'
        $McAfeeTest = Test-Path $McAfeeKey
            If ($McAfeetest -eq 'True') 
            {
                $McAfeeAgent = (Get-ItemProperty $McAfeeKey).AgentVersion
                Write-Verbose "McAfee Agent: $($McAfeeAgent)" -Verbose
            }
            Else 
            {
                $McAfeeAgent = 'NULL'
                Write-Verbose "McAfee Agent: NULL" -Verbose
            }
    
    #Network
    If ($PSVersionTable.PSVersion.Major -gt 4) {
        $EthernetAdapter = Get-NetAdapter -Name Ethernet
        $WiFiAdapter = Get-NetAdapter -Name Wi-Fi
    
        $EthernetIPv4 = Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4
        $EthernetIPv6 = Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv6
        $WiFiIPv4 = Get-NetIPAddress -InterfaceAlias Wi-Fi -AddressFamily IPv4
        $WiFiIPv6 = Get-NetIPAddress -InterfaceAlias Wi-Fi -AddressFamily IPv6
     }
    
        
            If ($NetAdapterConf.Description -like "*Wireless*") {
                $netAdapter = "Wireless"
            } 
            Else {
                $AdapterType = Get-WmiObject win32_networkadapter -filter "netconnectionstatus = 2" | Select-Object AdapterType | Select-Object -first 1
                $netAdapter =  $AdapterType.AdapterType
            }
    
        $FirstIP = if ([string]::IsNullOrEmpty($NetAdapterConf.IPAddress[0])) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.IPAddress[0]}
        $SecondIP = if ([string]::IsNullOrEmpty($NetAdapterConf.IPAddress[1])) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.IPAddress[1]}
        $FirstSub = if ([string]::IsNullOrEmpty($NetAdapterConf.IPSubnet[0])) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.IPSubnet[0]}
        $SecondSub = if ([string]::IsNullOrEmpty($NetAdapterConf.IPSubnet[1])) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.IPSubnet[1]}
    
        $WINS = if ([string]::IsNullOrEmpty($NetAdapterConf.WINSPrimaryServer)) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.WINSPrimaryServer}
        $WINSBackup = if ([string]::IsNullOrEmpty($NetAdapterConf.WINSSecondaryServer)) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.WINSSecondaryServer}
        $DNS = if ([string]::IsNullOrEmpty($NetAdapterConf.DNSServerSearchOrder[0])) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.DNSServerSearchOrder[0]}
        $DNSBackup = if ([string]::IsNullOrEmpty($NetAdapterConf.DNSServerSearchOrder[1])) {Write-Output 'NULL'} else {Write-Output $NetAdapterConf.DNSServerSearchOrder[1]}
    
        
    #TeamViewer
        $TeamViewerKey = 'HKLM:\SOFTWARE\WOW6432Node\TeamViewer'
        $TeamViewerTest = Test-Path $TeamViewerKey
            If ($TeamViewerTest -eq "True") {
                $TeamViewerVersion = (Get-ItemProperty $TeamViewerKey).Version
                $TeamViewerID = (Get-ItemProperty $TeamViewerKey).ClientID           
            }
            Else{
                Write-Output "TeamViewer not installed"
            }
    
            Write-Verbose "TeamViewer Version: $TeamViewerVersion" -Verbose
            Write-Verbose "TeamViewer 14 ID: $TeamViewerID" -Verbose
    
    
    
    
    #Firewall
        $FirewallState = netsh advfirewall show allprofiles | Where-Object {$_ -match "State"} |ForEach-Object {$_ -replace "State                                 ",""}
            $DomainFW = $FirewallState[0]
            $PrivateFW = $FirewallState[1]
            $PublicFW = $FirewallState[2]    
    
    #Storage
    
    
    $CDisk = Get-Disk -Number 0     #https://docs.microsoft.com/en-us/powershell/module/storage/get-disk?view=win10-ps
    
    $BootDrive = Get-Disk |Where-Object {$_.BootFromDisk -eq $true}
    
        #$Volume = Get-Volume    #Requires Windows 8 or newer. Using "Get-PSDrive" instead.
        $CDriveModel = ($Win32DiskDrive | Where-Object {$_.deviceID -eq "\\.\PHYSICALDRIVE0"}).Model
        $CDrive = Get-PSDrive -Name C
            $CDriveUsed = $CDrive | ForEach-Object {[math]::Round($_.used / 1GB)}
            $CDriveFree = $CDrive | ForEach-Object {[math]::Round($_.free / 1GB)}
            $CDriveCapacity = $CDrive.Used+$CDrive.Free
                $CDriveCapacity = ForEach-Object {[math]::Round($CDriveCapacity / 1GB)}
    
            $CDrivePercentUsed = ($CDriveUsed/$CDriveCapacity).ToString("P")
    
    $CMediaType = (Get-CimInstance MSFT_PhysicalDisk -Namespace Root\Microsoft\Windows\Storage |Where-Object {$_.model -eq $CDriveModel}).MediaType
            
            <#Get-Volume -DriveLetter C | select @{L="PercentUsed";E={($_.sizeremaining/$_.size).ToString("P")}}#>
            <#https://blogs.technet.microsoft.com/heyscriptingguy/2014/10/11/weekend-scripter-use-powershell-to-calculate-and-display-percentages/#>
    
    
            
    
    
    #ADD FORMAT TYPE (GPT, MBR, ETC.) FROM GET-DISK TO LOGICAL DIRVES
    
    #Drives
        $LogicalDrives = $Win32DiskDrive | ForEach-Object {
            $disk = $_
            $partitions = "ASSOCIATORS OF " +
            "{Win32_DiskDrive.DeviceID='$($disk.DeviceID)'} " +
            "WHERE AssocClass = Win32_DiskDriveToDiskPartition"
            Get-WmiObject -Query $partitions | ForEach-Object {
                $partition = $_
                $drives = "ASSOCIATORS OF " +
                "{Win32_DiskPartition.DeviceID='$($partition.DeviceID)'} " +
                "WHERE AssocClass = Win32_LogicalDiskToPartition"
                Get-WmiObject -Query $drives | ForEach-Object {
                    [PSCustomObject]@{
                        Disk                   = $disk.DeviceID;
                        DiskModel              = $disk.Model;
                        Partition              = $partition.Name -replace ",", "";
                        RawSize                = $partition.Size | ForEach-Object { [math]::Round($_ / 1GB, 2) }
                        DriveLetter            = $_.DeviceID
                        VolumeName             = $_.VolumeName
                        Size                   = $_.Size | ForEach-Object { [math]::Round($_ / 1GB, 2) }
                        FreeSpace              = $_.FreeSpace | ForEach-Object { [math]::Round($_ / 1GB, 2) }
                        FileSystem             = $_.FileSystem
                        MaximumComponentLength = $_.MaximumComponentLength
                        MediaType              = $_.MediaType
                        VolumeSerialNumber     = $_.VolumeSerialNumber
                        Partitions             = $disk.Partitions;
                        BytesPerSector         = $disk.BytesPerSector;
                        InterfaceType          = $disk.InterfaceType;
                        SectorsPerTrack        = $disk.SectorsPerTrack;
                        TotalCylinders         = $disk.TotalCylinders;
                        TotalHeads             = $disk.TotalHeads;
                        TotalSectors           = $disk.TotalSectors;
                        TotalTracks            = $disk.TotalTracks;
                        TracksPerCylinder      = $disk.TracksPerCylinder;
                        'ComputerName'         = $ComputerName;
                        'ComputerSerialNumber' = $bios.SerialNumber;
                        'Timestamp'            = $date;
                    }
                }
            }
        }
        $LogicalDrives | Export-Csv -Path $DestinationFolder\LogicalDrives.csv -Append -NoTypeInformation
    
    #https://stackoverflow.com/questions/31088930/combine-get-disk-info-and-logicaldisk-info-in-powershell
    
    
    
    #BitLocker
    $PowerShellAdmin = [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544")     #check if PowerShell is running as an administrator
        #https://superuser.com/questions/749243/detect-if-powershell-is-running-as-administrator
    if ($PowerShellAdmin -eq $true) {
        Get-BitLockerVolume |Select-Object ComputerName, MountPoint, EncryptionMethod, AutoUnlockEnabled, AutoUnlockKeyStored, MetadataVersion, VolumeStatus, ProtectionStatus, LockStatus, EncryptionPercentage, WipePercentage, VolumeType, CapacityGB, @{label='CompSerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Export-Csv -Path $DestinationFolder\CompBitLocker.csv -Append -NoTypeInformation
    
        $FixedDrives = Get-Volume | Where-Object {$_.DriveType -eq "Fixed"}
            If ($FixedDrives.driveletter -eq "D") {
                $DBitLocker = Get-BitLockerVolume -MountPoint D:
                $DBLVolumeStatus = $DBitLocker.VolumeStatus
                $DBLProtectionStatus = $DBitLocker.ProtectionStatus
                $DBLEncryptionPercentage = $DBitLocker.EncryptionPercentage
            }
    
        $CBitLocker = Get-BitLockerVolume -MountPoint C:
        $CBLVolumeStatus = $CBitLocker.VolumeStatus
        $CBLProtectionStatus = $CBitLocker.ProtectionStatus
        $CBLEncryptionPercentage = $CBitLocker.EncryptionPercentage
    }
    else{
        Write-Output "skipping BitLocker..."
    }
    
    #Video Driver
        
    
            $AMDVidDriver = $VideoController | Where-Object {$_.Name -like "*AMD*" -or $_.Name -like "*Radeon*"}
            If ([string]::IsNullOrEmpty($AMDVidDriver))    #Sees if an AMD GPU is instlled
            {
                $AMDVidDriver = 'NULL'    #If not, mark as empty
            }
            Else
            {
                
                $AMDVidDriverVersion = $AMDVidDriver | Select-Object DriverVersion -First 1
                $AMDVidDriverName = $AMDVidDriver | Select-Object Name -First 1
                Write-Output "$($AMDVidDriverName.Name)"
                Write-Verbose "AMD Driver: $($AMDVidDriverVersion.DriverVersion)" -Verbose
            }
    
    
            
            If ([string]::IsNullOrEmpty($($VideoController | Where-Object {$_.Name -Like "*Intel*"})))    #Sees if an Intel GPU is instlled
            {
                $IntelVidDriver = 'NULL'
            } 
            Else 
            {
                $IntelVidDriver = $VideoController | Where-Object {$_.Name -Like "*Intel*"}
                $IntelVidDriverVersion = $IntelVidDriver | Select-Object DriverVersion -First 1
                $IntelVidDriverName = $IntelVidDriver | Select-Object Name -First 1
                Write-Output "$($IntelVidDriverName.Name)"    #GPU model name
                Write-Verbose "Intel Driver: $($IntelVidDriverVersion.DriverVersion)" -Verbose    #GPU driver version
    
            }
                
            
            If ([string]::IsNullOrEmpty($($VideoController | Where-Object {$_.Name -Like "*NVIDIA*"})))    #Sees if a NVIDIA GPU is instlled
            {
                $NVIDIAVidDriver = 'NULL'
            }
            Else
            {
                $NVIDIAVidDriver = $VideoController | Where-Object {$_.Name -Like "*NVIDIA*"}
                $NVIDIAVidDriverVersion = $NVIDIAVidDriver | Select-Object DriverVersion -First 1
                $NVIDIAVidDriverName = $NVIDIAVidDriver | Select-Object Name -First 1
                Write-Output "$($NVIDIAVidDriverName.Name)"
                Write-Verbose "NVIDIA Driver: $($NVIDIAVidDriverVersion.DriverVersion)" -Verbose
                
            }
    
    
    #Microsoft Office 2013
        $Office2013RegKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90150000-0012-0000-0000-0000000FF1CE}'
        $Office2013Test = Test-Path $Office2013RegKey
            If ($Office2013Test -eq "True") {
                $Office2013 = Get-ItemProperty $Office2013RegKey
                Write-Verbose "Office 2013: $($Office2013.DisplayVersion)"
            } 
            Else {
                $Office2013 = Write-Output 'N/A'
                Write-Verbose "Office 2013 not installed"
            }
    
    
    #Malwarebytes Anti-Malware
        $MBAMRegKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{35065F43-4BB2-439A-BFF7-0F1014F2E0CD}_is1'
        $MBAMTest = Test-Path $MBAMRegKey
            If ($MBAMTest -eq "True") {
                $MBAM = Get-ItemProperty $MBAMRegKey
                Write-Verbose "Malwarebytes Anti-Malware: $($MBAM.DisplayVersion)"
            } 
            Else {
                $MBAM = Write-Output 'N/A'
                Write-Verbose "Malwarebytes Anti-Malware not installed"
            }
    
    
    #Account Permissions
        $AdminUsers = net localgroup administrators
        $AdminPrivileges = $AdminUsers -ccontains $env:USERNAME    
            If ($AdminPrivileges -eq "True") 
            {
                Write-Error -Message "Current user has administrator privileges."
            } 
            Else 
            {
                Write-Output "Current user does not have administrator privileges."
            }
    
    
    #Support Website
        If ($System.Manufacturer -Like "Dell Inc.") {
            $SupportWebsite =  "https://www.dell.com/support/home/us/en/19/product-support/servicetag/$($bios.SerialNumber)/warranty"
        }
    
    
    #Output
        <#CompHardware#>
        $CompHardware = [PSCustomObject]@{
            'Hostname'          = $ComputerName;
            'SerialNumber'      = $bios.SerialNumber;
            'Manufacturer'      = $System.Manufacturer -replace ",", "";
            'ModelNumber'       = $system.Model -replace ",", ".";
            'EthernetAdapter'   = $EthernetAdapter.InterfaceDescription;
            'EthernetState'     = $EthernetAdapter.Status;
            'EthernetMAC'       = $EthernetAdapter.MacAddress;
            'EthernetSpeed'     = $EthernetAdapter.LinkSpeed;
            'WiFiAdapter'       = $WiFiAdapter.InterfaceDescription;
            'WiFiState'         = $WiFiAdapter.Status;
            'WiFiMAC'           = $WiFiAdapter.MacAddress;
            'WiFiSpeed'         = $WiFiAdapter.LinkSpeed;
            'CPUName'           = $Win32Processor.Name;
            'PhysicalCores'     = $Win32Processor.NumberOfCores;
            'LogicalCores'      = $Win32Processor.NumberOfLogicalProcessors;
            'MaxFrequency'      = $MaxGHz;
            'Memory'            = "$memory GB";
            'AMDGPU'            = $AMDVidDriverName.Name;
            'NVIDIAGPU'         = $NVIDIAVidDriverName.Name;
            'IntelGPU'          = $IntelVidDriverName.Name;
            'PrimaryDriveModel' = $CDriveModel -replace ",", "";
            'MediaType'         = $CMediaType;
            'BusType'           = $CDisk.BusType;
            'Capacity'          = "$CDriveCapacity GB";
            'WindowsKey'        = $ProductKey;
            'OSName'            = $WinOperatingSystem.Caption -replace 'Microsoft ', '';
            'Architecture'      = $system.SystemType;
            'SupportWebsite'    = $SupportWebsite;
            'Timestamp'         = $date;
        }
        Write-Verbose $CompHardware
    
    <# $TestHardwareCSV = Test-Path ".\Computers\CompHardware.csv"
    If ($TestHardwareCSV -eq $true) {
        Write-Verbose "Using existing folder: .\Computers\CompHardware.csv" -Verbose
    } 
    Else {
        New-Item -ItemType File -Path .\Computers -Name CompHardware.csv
    }
    $GetCompHardware = Get-Content .\Computers\CompHardware.csv | Select-String -Pattern $BIOS.SerialNumber
    if ($null -eq $GetCompHardware) { #>
        $CompHardware | Export-Csv -Path $DestinationFolder\CompHardware.csv -Append -NoTypeInformation
    <# }
    else {
        Write-Verbose "Device already in database. Skipping hardware..."
    } #>
    
    
    <#CompSystem#>
        $CompSystem = [PSCustomObject]@{
            'Hostname'                                  = $ComputerName;
            'SerialNumber'                              = $bios.SerialNumber;
            'EthernetIPv4'                              = $EthernetIPv4;
            'EthtIPv4Prefix'                            = $EthernetIPv4.PrefixLength;
            'EthIPv4PrefixOrigin'                       = $EthernetIPv4.PrefixOrigin;
            'EthernetIPv6'                              = $EthernetIPv6;
            'EthtIPv6Prefix'                            = $EthernetIPv6.PrefixLength;
            'EthtIPv6PrefixOrigin'                      = $EthernetIPv6.PrefixOrigin;
            'WiFiIPv4'                                  = $WiFiIPv4;
            'WiFiIPv4Prefix'                            = $WiFiIPv4.PrefixLength;
            'WiFiIPv4PrefixOrigin'                      = $WiFiIPv4.PrefixOrigin;
            'WiFiIPv6'                                  = $WiFiIPv6;
            'WiFiIPv6Prefix'                            = $WiFiIPv6.PrefixLength;
            'WiFiIPv6PrefixOrigin'                      = $WiFiIPv6.PrefixOrigin;
            'DefaultGateway'                            = $NetAdapterConf.DefaultIPGateway[0];
            'PrimaryDNS'                                = $DNS;
            'BackupDNS'                                 = $DNSBackup;
            'Domain'                                    = $system.Domain;
            'FreeMemory'                                = "$FreeMemory GB";
            'MemPctUsed'                                = "$FreeMemoryPercent %";
            'Username'                                  = $user;
            'AdminPrivileges'                           = $AdminPrivileges;
            'DesktopPath'                               = $DesktopPath;
            'TeamViewerVersion'                         = $TeamViewerVersion
            'TeamViewerID'                              = $TeamViewerID;
            'GoogeleDrive'                              = $GoogleDrive;
            'GSuite'                                    = $GSuite.DisplayVersion;
            'DiskUsed'                                  = "$CDriveUsed GB";
            'DiskFree'                                  = "$CDriveFree GB";
            'DiskPctUsed'                               = $CDrivePercentUsed;
            'PartitionStyle'                            = $BootDrive.PartitionStyle;
            'DomainFW'                                  = $DomainFW;
            'PrivateFW'                                 = $PrivateFW;
            'PublicFW'                                  = $PublicFW;
            'C_BitLocker'                               = $CBLProtectionStatus;
            'C_BLVolume'                                = $CBLVolumeStatus;
            'C_BLProtection'                            = $CDBLProtectionStatus;
            'C_BLPct'                                   = $CBLEncryptionPercentage;
            'D_BitLocker'                               = $DBLProtectionStatus;
            'D_BLVolume'                                = $DBLVolumeStatus;
            'D_BLProtection'                            = $DDBLProtectionStatus;
            'D_BLPct'                                   = $DBLEncryptionPercentage;
            'OS_Version'                                = $SoftwareLicensing.Version;
            'OS_Build'                                  = $WinOperatingSystem.BuildNumber;
            'SMBIOS'                                    = $bios.SMBIOSBIOSVersion;
            'BIOS Version'                              = $bios.Version;
            'BIOS Date/Name'                            = $bios.Name;
            'Internet Explorer'                         = $IE.svcVersion;
            'Firefox 32-bit'                            = $Firefox.DisplayVersion;
            'Firefox 64-bit'                            = $Firefox64.DisplayVersion;
            'Chrome'                                    = $Chrome.Version;
            'Flash'                                     = $Flash;
            'Flash NPAPI'                               = $FlashNPAPI.Version;
            'Flash PPAPI'                               = $FlashPPAPI.Version;
            'Java'                                      = $Java.DisplayVersion;
            'Adobe Reader'                              = $Reader.DisplayVersion;
            'PowerShell'                                = $PSVersionTable.PSVersion;
            'AMD Driver'                                = $AMDVidDriverVersion.DriverVersion;
            'NVIDIA Driver'                             = $NVIDIAVidDriverVersion.DriverVersion;
            'Intel Driver'                              = $IntelVidDriverVersion.DriverVersion;
            'McAfee'                                    = $McAfeeAgent;
            'Office2013Name'                            = $Office2013.DisplayName;
            'Office2013Ver'                             = $Office2013.DisplayVersion;
            'MBAM'                                      = $MBAM.DisplayVersion;
            'IP1'                                       = $oct0;
            'IP2'                                       = $oct1;
            'IP3'                                       = $oct2;
            'IP4'                                       = $oct3;
            'Timestamp'                                 = $date;
            'FreePhysicalMemory'                        = $WinOperatingSystem.FreePhysicalMemory;
            'FreeSpaceInPagingFiles'                    = $WinOperatingSystem.FreeSpaceInPagingFiles;
            'FreeVirtualMemory'                         = $WinOperatingSystem.FreeVirtualMemory;
            'OSInstallDate'                             = $WinOperatingSystem.InstallDate;
            'CurrentTimeZone'                           = $WinOperatingSystem.CurrentTimeZone;
            'LastBootUpTime'                            = $WinOperatingSystem.LastBootUpTime;
            'Distributed'                               = $WinOperatingSystem.Distributed;
            'LocalDateTime'                             = $WinOperatingSystem.LocalDateTime;
            'MaxNumberOfProcesses'                      = $WinOperatingSystem.MaxNumberOfProcesses;
            'MaxProcessMemorySize'                      = $WinOperatingSystem.MaxProcessMemorySize;
            'NumberOfLicensedUsers'                     = $WinOperatingSystem.NumberOfLicensedUsers;
            'NumberOfProcesses'                         = $WinOperatingSystem.NumberOfProcesses;
            'NumberOfUsers'                             = $WinOperatingSystem.NumberOfUsers;
            'OSType'                                    = $WinOperatingSystem.OSType;
            'OtherTypeDescription'                      = $WinOperatingSystem.OtherTypeDescription;
            'Caption'                                   = $WinOperatingSystem.Caption;
            'SizeStoredInPagingFiles'                   = $WinOperatingSystem.SizeStoredInPagingFiles;
            'TotalSwapSpaceSize'                        = $WinOperatingSystem.TotalSwapSpaceSize;
            'TotalVirtualMemorySize'                    = $WinOperatingSystem.TotalVirtualMemorySize;
            'TotalVisibleMemorySize'                    = $WinOperatingSystem.TotalVisibleMemorySize;
            'BootDevice'                                = $WinOperatingSystem.BootDevice;
            'BuildType'                                 = $WinOperatingSystem.BuildType;
            'CodeSet'                                   = $WinOperatingSystem.CodeSet;
            'CountryCode'                               = $WinOperatingSystem.CountryCode;
            'CSDVersion'                                = $WinOperatingSystem.CSDVersion;
            'DataExecutionPrevention_32BitApplications' = $WinOperatingSystem.DataExecutionPrevention_32BitApplications;
            'DataExecutionPrevention_Available'         = $WinOperatingSystem.DataExecutionPrevention_Available;
            'DataExecutionPrevention_Drivers'           = $WinOperatingSystem.DataExecutionPrevention_Drivers;
            'DataExecutionPrevention_SupportPolicy'     = $WinOperatingSystem.DataExecutionPrevention_SupportPolicy;
            'Debug'                                     = $WinOperatingSystem.Debug;
            'EncryptionLevel'                           = $WinOperatingSystem.EncryptionLevel;
            'ForegroundApplicationBoost'                = $WinOperatingSystem.ForegroundApplicationBoost;
            'LargeSystemCache'                          = $WinOperatingSystem.LargeSystemCache;
            'Locale'                                    = $WinOperatingSystem.Locale;
            'Manufacturer'                              = $WinOperatingSystem.Manufacturer;
            'MUILanguages'                              = $WinOperatingSystem.MUILanguages;
            'OperatingSystemSKU'                        = $WinOperatingSystem.OperatingSystemSKU;
            'Organization'                              = $WinOperatingSystem.Organization;
            'OSArchitecture'                            = $WinOperatingSystem.OSArchitecture;
            'OSLanguage'                                = $WinOperatingSystem.OSLanguage;
            'OSProductSuite'                            = $WinOperatingSystem.OSProductSuite;
            'PortableOperatingSystem'                   = $WinOperatingSystem.PortableOperatingSystem;
            'Primary'                                   = $WinOperatingSystem.Primary;
            'ProductType'                               = $WinOperatingSystem.ProductType;
            'RegisteredUser'                            = $WinOperatingSystem.RegisteredUser;
            'SerialNumber;'                             = $WinOperatingSystem.SerialNumber;
            'ServicePackMajorVersion'                   = $WinOperatingSystem.ServicePackMajorVersion;
            'ServicePackMinorVersion'                   = $WinOperatingSystem.ServicePackMinorVersion;
            'SuiteMask'                                 = $WinOperatingSystem.SuiteMask;
            'SystemDevice'                              = $WinOperatingSystem.SystemDevice;
            'SystemDirectory'                           = $WinOperatingSystem.SystemDirectory;
            'SystemDrive'                               = $WinOperatingSystem.SystemDrive;
            'WindowsDirectory'                          = $WinOperatingSystem.WindowsDirectory;
            'DHCP'                                      = $NetAdapterConf.DHCPEnabled[0];
            'IPAddress'                                 = $FirstIP;
            'SubnetMask'                                = $FirstSub;
            'SecondIP'                                  = $SecondIP;
            'SecondSubnet'                              = $SecondSub;
            'PrimaryWINS'                               = $WINS[0];
            'BackupWINS'                                = $WINSBackup[0];
            'ActiveMACAddress'                          = $NetAdapterConf.MACAddress[0];
            'NetworkAdapter'                            = $NetAdapterConf.Description[0];
            'AdapterType'                               = $netAdapter;
            'PublicIP'                                  = $PublicIP.trim();
        }
        Write-Output $CompSystem
        $CompSystem | Export-Csv -Path $DestinationFolder\CompSystem.csv -Append -NoTypeInformation
    
    
    
    <#Inventory Full -- Remove once all items have moved to other respective tables#>
        $InventoryFull = [PSCustomObject]@{
            'Hostname'            = $ComputerName;
            'Timestamp'           = $date;
            'Serial Number'       = $bios.SerialNumber;
            'Manufacturer'        = $system.Manufacturer;
            'Model Number'        = $system.Model;
            'DHCP'                = $NetAdapterConf.DHCPEnabled[0];
            'IP Address'          = $FirstIP;
            'Subnet Mask'         = $FirstSub;
            'Second IP'           = $SecondIP;
            'Second Subnet'       = $SecondSub;
            'Default Gateway'     = $NetAdapterConf.DefaultIPGateway[0];
            'Primary DNS'         = $DNS;
            'Backup DNS'          = $DNSBackup;
            'Primary WINS'        = $WINS;
            'Backup WINS'         = $WINSBackup;
            'Domain'              = $system.Domain;
            'MAC Address'         = $NetAdapterConf.MACAddress;
            'Network Adapter'     = $NetAdapterConf.Description;
            'Adapter Type'        = $netAdapter;
            'CPU Name'            = $Win32Processor.Name;
            'Physical Cores'      = $Win32Processor.NumberOfCores;
            'Logical Cores'       = $Win32Processor.NumberOfLogicalProcessors;
            'Max Frequency'       = $MaxGHz;
            'Memory'              = "$memory GB";
            'Free Memory'         = "$FreeMemory GB";
            'Pct Used'            = "$FreeMemoryPercent %";    
            'System Type'         = $system.SystemType
            'Username'            = $user;
            'Admin Privileges'    = $AdminPrivileges;
            'Desktop Path'        = $DesktopPath;
            'TeamViewer'          = $TeamViewerID;
            'AMD GPU'             = $AMDVidDriverName.Name;
            'NVIDIA GPU'          = $NVIDIAVidDriverName.Name;
            'Intel GPU'           = $IntelVidDriverName.Name;
            'Googele Drive'       = $GoogleDrive;
            'Primary Drive Model' = $CDriveModel;
            'Capacity'            = "$CDriveCapacity GB";
            'Used'                = "$CDriveUsed GB";
            'Free'                = "$CDriveFree GB";
            'Percent Used'        = $CDrivePercentUsed;
            'C BitLocker'         = $CBLProtectionStatus;
            'C BL Volume'         = $CBLVolumeStatus;
            'C BL Protection'     = $CDBLProtectionStatus;
            'C BL Percentage'     = $CBLEncryptionPercentage;
            'D BitLocker'         = $DBLProtectionStatus;
            'D BL Volume'         = $DBLVolumeStatus;
            'D BL Protection'     = $DDBLProtectionStatus;
            'D BL Percentage'     = $DBLEncryptionPercentage;
            'BL ID'               = '';
            'BL Key'              = '';
            'Windows Key'         = $ProductKey;
            'OS Name'             = $WinOperatingSystem.Caption -replace 'Microsoft ', '';
            'OS Number'           = $SoftwareLicensing.version;
            'OS Build'            = $WinOperatingSystem.BuildNumber;
            'SMBIOS'              = $bios.SMBIOSBIOSVersion;
            'BIOS Version'        = $bios.Version;
            'BIOS Date/Name'      = $bios.Name;
            'Internet Explorer'   = $IE.svcVersion;
            'Firefox 32-bit'      = $Firefox.DisplayVersion;
            'Firefox 64-bit'      = $Firefox64.DisplayVersion;
            'Chrome'              = $Chrome.Version;
            'Flash'               = $Flash;
            'Flash NPAPI'         = $FlashNPAPI.Version;
            'Flash PPAPI'         = $FlashPPAPI.Version;
            'Java'                = $Java.DisplayVersion;
            'Adobe Reader'        = $Reader.DisplayVersion;
            'PowerShell'          = $PSVersionTable.PSVersion;
            'AMD Driver'          = $AMDVidDriverVersion.DriverVersion;
            'NVIDIA Driver'       = $NVIDIAVidDriverVersion.DriverVersion;
            'Intel Driver'        = $IntelVidDriverVersion.DriverVersion;
            'McAfee'              = $McAfeeAgent;
            'IP1'                 = $oct0;
            'IP2'                 = $oct1;
            'IP3'                 = $oct2;
            'IP4'                 = $oct3;
        }
        $InventoryFull | Export-Csv -Path $DestinationFolder\InventoryFull.csv -Append -NoTypeInformation
    
    
    #Apps
        $32bit = "32-bit"
        $GetApps32bit = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
        $apps32bit = $GetApps32bit | Select-Object displayname, displayversion, @{label='Bit';e={$32bit}}, @{label='ComputerName';e={$ComputerName}}, @{label='SerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Sort-object -Property DisplayName
        $apps32bit | Export-Csv -Path $DestinationFolder\Apps.csv -Append -NoTypeInformation
    
        $64bit = "64-bit"
        $GetApps64bit = Get-ItemProperty 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' 
        $apps64bit = $GetApps64bit | Select-Object displayname, displayversion, @{label='Bit';e={$64bit}}, @{label='ComputerName';e={$ComputerName}}, @{label='SerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}} | Sort-object -Property DisplayName
        $apps64bit | Export-Csv -Path $DestinationFolder\Apps.csv -Append -NoTypeInformation
    
    #Printers
        $CompPrinters = $Printer | Select-Object Name, DriverName, PortName, Shared, @{label='ComputerName';e={$ComputerName}}, @{label='SerialNumber';e={$bios.SerialNumber}}, @{label='Timestamp';e={$Date}}
        $CompPrinters | Export-Csv -Path $DestinationFolder\Printers.csv -Append -NoTypeInformation
    
    # remove quotes
        foreach ($file in Get-ChildItem $DestinationFolder\*.csv)    #Selects the files
        {
            (Get-Content $file) -replace '"','' | Set-Content $file    #Replaces quotes with a blank space
            (Get-Content $file) -replace "VMware, Inc.","VMware Inc." | Set-Content $file   #remove once NetAdapter is in table object
        }
    
    # #Errors
    #     $LogFile = "$DestinationFolder\details\log.txt"
    #         Get-Date | Out-File $LogFile -Append
    #         $ComputerName | Out-File $LogFile -Append
    #         #$Error | Out-File $LogFile -Append
    #         $erFlash | Out-File $LogFile -Append
    #         $erJava | Out-File $LogFile -Append
    }
    
    
    Get-Inventory -DestinationFolder $DestinationFolder -Verbose

     

    Hoffe das verkompliziert die Sache nicht unnötig, aber vielleicht wird ja jetzt klar, warum es nicht als system geht.

     

     

    lg

     

     

    Stefan

  9. Tja ominös weiss ich nicht, hatte in nem anderen Forum gelesen, per GPO schript die Aufgabe zu verteilen, wäre das intelligenteste, aber ich lasse mich gerne belehren, was intelligenter ist. Auf jedem Rechner die Aufgabe manuel einzutragen sicher nicht. Und wie ich schon schrieb, die Aufgabe läuft nicht unter System, sie soll ja bei jedem User einmal die Woche gestartet werden, und das tut er eben nur wenn ich die Aufgabe im Kontext des  Admins ausführen lasse, alles lokal zigfach getestet. Und noch mal, es soll lediglich ein Powershellscript gestartet werden, dass für die jeweiligen Rechner periodisch diverse Werte ausliest und im NAS speichert. Ich kann gerne das PS scipt posten, aber denke das würde jetzt auch nicht weiterführen. Lokal in der Aufgabenplanung angestartet funktioniert es. Ich hoffe das war jetzt deutlich geworden, auch wenns im Prizip nur Wiederholung war. Ich befürchte aber fast, nachdem was Sunny sagte, dass es keine Lösung gibt.

     

    lg und schönes Wochenende

  10. Hallo allerseits, ich versuche die letzten Tage verzweifelt eine Aufgabe remote zu erstellen, und zwar istn es eine aufgabe die als dom\Administrator, und bei jedem User ausgeführt werden soll. Ich habe es per PSEXEC versucht und auch als Startscript, beides mal ging in die Hose. Die Aufgabe soll erstellt werden aus einer auf dem Zielrechner vorhandenen XML.

     

    Versuch 1:

    per psexec

    psexec64 \\ZielPC -u dom\administrator -p <pass> -h cmd /c FOR %L in ( DataCollect ) do SCHTASKS /Create /TN %L /f /xml "C:\Users\Administrator\Downloads\Aufgaben\%L.xml"

     

    Ergebnis: Benutzer oder Kennwort ist falsch, ist definitiv nicht falsch

     

    Versuch2:

    FOR %L in ( DataCollect ) do SCHTASKS /Create /TN %L /f /xml "C:\Users\Administrator\Downloads\Aufgaben\%L.xml"

    Bei dem versuch es über ein GPO Startscript zu versuchen passiert nichts.

     

    Es soll lediglich ein Powershellscript aufgerufen, das einmal wöchentlich gestartet wird. Vielleicht weiss ja jemand  Rat? Warum muss denn dass so kompliziert sein

     

     

    lg

     

     

    Stefen

     

     

     

  11. danke erstmal, dass das primär nix mit dem AD zu tun hat ist mir klar, hätte ja sein können, dass in der AD Datenbank freie Felder zu definieren sind, dass ist anscheinend aber nicht der Fall, dann muss ich zu meiner Batchlösung zurück und dafür sorgen, dass per Aufgabe diese regelmäßig in eine externe Datenbank geschrieben wird. Dann weiß ich Bescheid

     

    @Bof: Das mit der Inventarisierungs-Software wäre theoretisch fein, solche Lösungen wurden auch schon mal diskutiert, scheiterte letztlich daran, dass hier meistens halt nur die gängigsten Softwarepakete, wie zB auch Java etc. unterstützt werden, das war von mir ja auch nur ein Beispiel gewesen, aber eher keine Spezial Software Anwendungen, deshalb wurde bei uns auf solche Lösungen verzichtet.

     

    lg und danke an alle, 

    schönes Rest WE noch

     

    Stefan

  12. Hallo allerseits,

     

    ich muss meine Aussage übrigens zurücknehmen, dass das OS falsch ist bei dem Rechner des Kollegen, es hat sich herausgestellt, dass der Rechner intern getauscht wurde, und dann entsprechend umbenannt. Aber ich habe mal eine andere Frage. Powershell scheint ja in irgend einer Form schon mächtig zu sein, aber ist es auch möglich in der AD Datenbank eigene Felder definieren zu lassen und entsprechend auslesen zu lassen. Genauer gesagt folgendes:

     

    Ich möchte gerne eine Liste erstellen mit der Programmversion einer bestimmten Software. Mittels Batch geht das ja zB.: mittels Regquery, aber da kann ich mittels Schleife ja nur die Rechner abfragen die zufällig gerade an sind, das sind aufgrund der aktuellen Lage ja nicht gerade viele, und ich wollte es gerne intelligenter machen. Gibt es da eine Möglichkeit? 

     

    lg und schönes langes WE

    Stefan

  13. @Bof: das war ja nur mit nem Augenzwinkern gemeint; ;)

     

    @all: aber ja ich werde gleich mal in der GUI schauen bei dem entsprechenden Rechner, auch wenn es mich wundern würde, wenn da was anderes steht.

    Danke noch mal an alle,

     

    So habe eben nachgeschaut, und Tatsache, es steht im OS Feld Enterprise (nicht Bezeichnung). Da ich diesen per Image aufgesetzt habe weiß ich genau dass dort Pro drauf ist. Ich kann mir nicht vorstellen, dass der Kollege, obwohl bei uns kein Enterprise mehr installiert werden soll, nachträglich dieses installiert hat. So schön diese PS Lösung auch ist, im Gegensatz zu Batchlösungen, bringt natürlich nichts wenn am Ende Kokolores rauskommt.

     

    Um zu zeigen, dass ich ansatzweise auch mal mein Gehirn benutze, stelle ich mir nun die Frage, und werfe diese gleich mal in die Runde: Gibt es Einstellungen an den Clients, die die korrekte Übermittlung des OS verhindern könnten?

     

    lg

     

    Stefan

  14. Zitat

    Naja, Du darfst natürlich Dein Gehirn auch ein bissl anstrengen

    ich habe es ja versucht, da mit Logik ranzugehen und den Befehl entsprechend nach dem gleichen Schema zu ergänzen, aber da kommt man bei Powershell eben nicht weiter, es sei denn man hat natürlich jahrelang gesammelte Kenntnisse in Powershell.  Es ist natürlich immer schön auf Leuten rumzuhacken, die in der MAterie noch nicht so firm sind, das scheint ja eine diebische Freude zu bereiten, was ich persönlich nicht so nachvollziehen kann, aber ich kann auch gönnen. Trotzdem bedanke ich mich herzlichst für die versuchte Hilfestellung.

     

    Was mich viel mehr beunruhigt, ist die Tatsache, dass die  Egebnisse mit dieswm Cmdlet anscheinend nicht stimmig sind. Beispielsweise weiss ich 100 prozentig, dass ein Kollege von mir pro auf seinem Rechner hat, da ich es selber installiert habe, und dieser Rechner wird mit Enterprise ausgegeben, schon komisch. Na möglicheweise hat der Kollege es ja neu installiert, werde ich am Montag überprüfen, bevor ich was faslches sage.

     

     

    lg und schönes WE noch

     

    Stefan

    • Like 1
  15. klar habe ich, funktioniert ja jetzt auch, wenn man aber nun noch eine zusätzliche Spalte haben möchet mit Operating System haben möchte, zB so :Get-ADComputer -Filter "OperatingSystem -like '*Windows 10 Enterprise*'" -Properties Description | Select-Object -Property DNSHostName , OperatingSystem , Description

     

    dann wirds wieder schwierig

     

    lg und schönes Wochenende

    und danke noch ma

     

    stefan

    Bevor jetz die Antwort kommt, na ja Du hast ja schon nach Windows Enterprise gefiltert, ja aber es gibt ja mehere, zb auch enterprise ltsc. Mit würde es auch genügen eine Liste zu erhalten mit allen Rechnern, un dden spalten OS sowie Bezeichnung, dies nur zur Ergänzung. Die Hilfe hilft da auch nur rudimentär.

  16. So, da ja offensichtlich hier hauptsächlich PS Experten sitzen, stelle ich doch mal eine Powershell Frage. Ich versuche über Powershell eine Liste mit allen Rechnern zu erstellen an denen Windows 10 Enterprise installiert ist, es sollen die Namen der PCs und die Spalte Bezeichnung ausgegeben werden. Der Ausdruck Get-ADComputer -Filter "OperatingSystem -like '*Windows 10 Enterprise*'" | select DNSHostName , Description  funktioniert nicht, hat jemand ne Idee?

     

    lg

     

     

    Stefan

×
×
  • Neu erstellen...