Powershell: Active Directory; Flash, Chrome und Java Version prüfen
Für einen KMU ist es immer schwierig eine geeignete Software zu finden mit der man seine PC und deren Softwareversion kontrollieren kann. Einen einfachen Weg um z.B. Flash, Google Chrome und Java zu kontrollieren geht anstatt über eine spezielle Software oder WMI einfach über die Dateieigenschaften. Mit Powershell kann man sehr einfach die Dateiversion abfragen. Hängt man diese mit dem Active Directory zusammen erhält hat mein eine kostenlose alternative, vorausgesetzt man hat auf jedem Computer identisch aufgesetzt.
Voraussetzung für diese Script ist die installation des AD DS- und AD LDS-Tools inkl. Powershell Modul. Getestet wurde dies auf einem Windows Server 2012.
###################################################### # Author: Daniel Stastka # Datum: 15.07.2015 # Desc.: Testing some Fileversion over FSO, # All PC finding over AD with Wildcard # # Version # 1.0 Inital Version # 1.1 Adding AD-Support # 1.2 File to Array # ###################################################### cls function Pause { Read-Host 'Press Enter to continue...' | Out-Null } function Get-FileVersion { [CmdletBinding()] param( [parameter(mandatory=$false,position=0,valuefrompipelinebypropertyname=$true)]$ComputerName=$env:ComputerName ) begin { } process { $Desc = $ComputerName.Description $IPv4 = $ComputerName.IPv4Address $ComputerName = $ComputerName.Name [string[]]$filenames = @( "\\$ComputerName\c$\windows\system32\macromed\flash\Flash*.exe", "\\$ComputerName\c$\Program Files (x86)\Google\Chrome\Application\chrome.exe", "\\$ComputerName\c$\Program Files (x86)\Java\*\bin\java.exe" ) [string[]]$version = @() [string[]]$head = @() for($i=0 $i -lt $filenames.Count $i++){ $split = $filenames[$i].Split("\",[System.StringSplitOptions]::RemoveEmptyEntries) $head +=""+$split[$split.Length-1] } Write-Host Testing: $Computername if(Test-Connection $Computername -count 1 -ErrorAction SilentlyContinue) { for($i=0 $i -lt $filenames.Count $i++) { $filename = $filenames[$i] if(Test-Path $filename) { $file = Get-Item $filename $version += $file.versionInfo.fileversion -replace ",","." } else { $version += "Not Installed" } }#end for Write-Host OK.... } #end if Test-Connection else { $version += 'Offline' Write-Host Offline.... } #Add Object $object = New-Object -TypeName PSObject $object | Add-Member -MemberType NoteProperty -Name 'ComputerName' -Value $ComputerName $object | Add-Member -MemberType NoteProperty -Name 'Ipv4' -Value $IPv4 $object | Add-Member -MemberType NoteProperty -Name 'Desc' -Value $Desc for($i=0 $i -lt $filenames.Count $i++) { $object | Add-Member -MemberType NoteProperty -Name $head[$i] -Value $version[$i] } return $object } } $AllComputers = @() # AD Modul import Import-Module ActiveDirectory $ADPC = Get-ADComputer -Filter "Name -like 'notebook*' -or Name -like 'computer*'" -Properties Name,IPv4Address,Description foreach ($ADPCS in $ADPC) { $AllComputers += Get-FileVersion($ADPCS) } #Output $AllComputers | Out-GridView Pause
Quelle: http://jeffwouters.nl/index.php/2014/07/get-flash-version-with-powershell/
×
...auch noch interessant
- Windows // 01.11.2022VMware Aria Automation 8.x: VMPSMasterWorkflow32 MachineProvisioned SysPrep
- Windows // 31.10.2022Windows 2022 Disk Layout from Hell (update)
- Powershell // 22.04.2022Opnsense: Backup mit Rest-API (os-api-backup)
- Powershell // 01.04.2022Powershell Where-Object mit Warp 7 beschleunigen
Tippsammlung
Kleine Tippsammlung für mich und dijenige die sich auf meine Webseite verirrt haben.Archiv
Jahr
Tag(s):- Sep 2023 (1)
- Jul 2023 (1)
- Apr 2023 (1)
- Feb 2023 (1)
- Nov 2022 (2)
- Oct 2022 (1)
- Jul 2022 (1)
- Jun 2022 (2)
- May 2022 (2)
- Apr 2022 (6)
- Dec 2021 (3)
- Jun 2021 (2)
- May 2021 (1)
- Apr 2021 (2)
- tipps (30)
- synology (27)
- linux (22)
- Windows (19)
- Powershell (15)
- tool (14)
- Windows 10 (12)
- coding (9)
- csharp (c#) (8)
- security (6)
- ad (6)
- Windows 2012 R2 (5)
- vpn (5)
- Ubuntu (5)
- Pi (5)
- gitea (5)
- git (5)
- Windows 2012 (4)
- opnsense (4)
- openpgp.js (4)
- docker (4)
- Xubuntu (3)
- Windows 2016 (3)
- Ubuntu 22.04 (3)
- seo (3)
- Japanisch (3)
- ipkg (3)
- app (3)
- Android (3)
- Zertifizierungsstelle (2)
- wsus (2)
- Windows Updates (2)
- windows 2022 (2)
- Windows 2008 (2)
- web2 (2)
- VMware (2)
- verschlüsselung (2)
- Scripts (2)
- php (2)
- pgp (2)
- perl (2)
- mysql (2)
- LMS (2)
- Kanji (2)
- javascript (2)
- GnuPgP (2)
- Firewall (2)
- Excel (2)
- bash (2)
- assp (2)
Nichts gefunden
Es wurde zur Story Powershell: Active Directory; Flash, Chrome und Java Version prüfen kein Kommentar gefundenInformation
Werbung oder Ähnliches sind nicht erlaubt, daher wird jeder Beitrag geprüft und freigegeben.Advertising, etc. are not allowed, so any contribution is reviewed and approved.
Facebook-Webadress are not allowed, Facebook als Webadresse ist nicht erlaubt
* Die E-Mail wird nicht veröffentlicht / The email will not be published
** Bitte Zahl eintragen / Please enter the number
Modal Header
Some text in the Modal Body
Some other text...
(c)2023 stastka.ch // help system