uj könyvtär Scripts
This commit is contained in:
33
Scripts/powershell/Benutzer_Data.ps1
Normal file
33
Scripts/powershell/Benutzer_Data.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
Import-Module ActiveDirectory -ErrorAction Stop
|
||||
|
||||
$out = 'C:\Apps\all_ad_users.csv'
|
||||
|
||||
Get-ADUser -Filter * -Properties mail,telephoneNumber,mobile,fax,physicalDeliveryOfficeName,department,title,Enabled |
|
||||
Select-Object @{
|
||||
Name='Name';Expression={$_.Name}
|
||||
}, @{
|
||||
Name='SamAccountName';Expression={$_.SamAccountName}
|
||||
}, @{
|
||||
Name='Mail';Expression={$_.mail}
|
||||
}, @{
|
||||
Name='Telephone';Expression={$_.telephoneNumber}
|
||||
}, @{
|
||||
Name='Mobile';Expression={$_.mobile}
|
||||
}, @{
|
||||
Name='Fax_business';Expression={$_.fax}
|
||||
}, @{
|
||||
Name='Office';Expression={$_.physicalDeliveryOfficeName}
|
||||
}, @{
|
||||
Name='Department';Expression={$_.department}
|
||||
}, @{
|
||||
Name='Title';Expression={$_.title}
|
||||
}, @{
|
||||
Name='Enabled';Expression={$_.Enabled}
|
||||
} |
|
||||
Tee-Object -Variable Results |
|
||||
Export-Csv -Path $out -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# konzolra formázott megjelenítés (szükség szerint szűrj)
|
||||
$Results | Format-Table Name,SamAccountName,Mail,Telephone,Mobile,Fax_business,Office,Department,Title,Enabled -AutoSize
|
||||
|
||||
Write-Host "Kimenet: $out ($($Results.Count) felhasználó)"
|
||||
58
Scripts/powershell/Benutzer_Data_from_group_email.ps1
Normal file
58
Scripts/powershell/Benutzer_Data_from_group_email.ps1
Normal file
@@ -0,0 +1,58 @@
|
||||
Import-Module ActiveDirectory -ErrorAction Stop
|
||||
|
||||
# --- Állítsd be a csoport e-mail címét vagy nevét ---
|
||||
$groupEmail = "abteilungsleitungen-jenfeld@aps-hh.de"
|
||||
$out = "C:\Tools\group_members.csv"
|
||||
|
||||
# --- Csoport objektum lekérése az e-mail cím alapján ---
|
||||
$group = Get-ADGroup -Filter "mail -eq '$groupEmail'" -Properties mail
|
||||
|
||||
if (-not $group) {
|
||||
Write-Host "Nem található csoport ezzel az e-mail címmel: $groupEmail" -ForegroundColor Red
|
||||
exit
|
||||
}
|
||||
|
||||
Write-Host "Csoport megtalálva: $($group.Name) ($($group.DistinguishedName))"
|
||||
|
||||
# --- Csoporttagok lekérése ---
|
||||
$members = Get-ADGroupMember -Identity $group.DistinguishedName -Recursive | Where-Object { $_.ObjectClass -eq 'user' }
|
||||
|
||||
if (-not $members) {
|
||||
Write-Host "Nincsenek felhasználók a csoportban vagy nincs jogosultság a lekérdezéshez." -ForegroundColor Yellow
|
||||
exit
|
||||
}
|
||||
|
||||
# --- AD-felhasználói adatok lekérése ---
|
||||
$Results = $members | ForEach-Object {
|
||||
Get-ADUser -Identity $_.SamAccountName -Properties mail,telephoneNumber,mobile,fax,physicalDeliveryOfficeName,department,title,Enabled |
|
||||
Select-Object @{
|
||||
Name='Name';Expression={$_.Name}
|
||||
}, @{
|
||||
Name='SamAccountName';Expression={$_.SamAccountName}
|
||||
}, @{
|
||||
Name='Mail';Expression={$_.mail}
|
||||
}, @{
|
||||
Name='Telephone';Expression={$_.telephoneNumber}
|
||||
}, @{
|
||||
Name='Mobile';Expression={$_.mobile}
|
||||
}, @{
|
||||
Name='Fax_business';Expression={$_.fax}
|
||||
}, @{
|
||||
Name='Office';Expression={$_.physicalDeliveryOfficeName}
|
||||
}, @{
|
||||
Name='Department';Expression={$_.department}
|
||||
}, @{
|
||||
Name='Title';Expression={$_.title}
|
||||
}, @{
|
||||
Name='Enabled';Expression={$_.Enabled}
|
||||
}
|
||||
}
|
||||
|
||||
# --- Export CSV ---
|
||||
$Results | Export-Csv -Path $out -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# --- Konzolos megjelenítés ---
|
||||
$Results | Format-Table Name,SamAccountName,Mail,Telephone,Mobile,Fax_business,Office,Department,Title,Enabled -AutoSize
|
||||
|
||||
Write-Host "`nCsoport: $($group.Name)"
|
||||
Write-Host "Kimenet: $out ($($Results.Count) felhasználó)" -ForegroundColor Green
|
||||
39
Scripts/powershell/Benutzer_Data_from_txt.ps1
Normal file
39
Scripts/powershell/Benutzer_Data_from_txt.ps1
Normal file
@@ -0,0 +1,39 @@
|
||||
Import-Module ActiveDirectory -ErrorAction Stop
|
||||
|
||||
$in = 'C:\Tools\users.txt'
|
||||
$out = 'C:\Tools\selected_users.csv'
|
||||
|
||||
# Felhasználónevek beolvasása a txt-ből, üres sorokat kihagyva, szóközöket levágva
|
||||
$userList = Get-Content -Path $in | Where-Object { $_.Trim() -ne "" } | ForEach-Object { $_.Trim() }
|
||||
|
||||
# AD-lekérdezés és szűrés a txt alapján
|
||||
Get-ADUser -Filter * -Properties mail,telephoneNumber,mobile,fax,physicalDeliveryOfficeName,department,title,Enabled |
|
||||
Where-Object { $userList -contains $_.Name } |
|
||||
Select-Object @{
|
||||
Name='Name';Expression={$_.Name}
|
||||
}, @{
|
||||
Name='SamAccountName';Expression={$_.SamAccountName}
|
||||
}, @{
|
||||
Name='Mail';Expression={$_.mail}
|
||||
}, @{
|
||||
Name='Telephone';Expression={$_.telephoneNumber}
|
||||
}, @{
|
||||
Name='Mobile';Expression={$_.mobile}
|
||||
}, @{
|
||||
Name='Fax_business';Expression={$_.fax}
|
||||
}, @{
|
||||
Name='Office';Expression={$_.physicalDeliveryOfficeName}
|
||||
}, @{
|
||||
Name='Department';Expression={$_.department}
|
||||
}, @{
|
||||
Name='Title';Expression={$_.title}
|
||||
}, @{
|
||||
Name='Enabled';Expression={$_.Enabled}
|
||||
} |
|
||||
Tee-Object -Variable Results |
|
||||
Export-Csv -Path $out -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# konzolra formázott megjelenítés
|
||||
$Results | Format-Table Name,SamAccountName,Mail,Telephone,Mobile,Fax_business,Office,Department,Title,Enabled -AutoSize
|
||||
|
||||
Write-Host "Kimenet: $out ($($Results.Count) felhasználó)"
|
||||
47
Scripts/powershell/Drucker_Überwachung_0.1.ps1
Normal file
47
Scripts/powershell/Drucker_Überwachung_0.1.ps1
Normal file
@@ -0,0 +1,47 @@
|
||||
$events = Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational" -MaxEvents 500 |
|
||||
Where-Object { $_.Id -eq 307 }
|
||||
|
||||
$logList = @()
|
||||
|
||||
foreach ($event in $events) {
|
||||
$message = $event.Message
|
||||
$user = ""
|
||||
$document = ""
|
||||
$printer = ""
|
||||
$pages = ""
|
||||
|
||||
# Felhasználó (pl. L.Vogt auf APS-NB072)
|
||||
if ($message -match "im Besitz von (.+?) wurde auf") {
|
||||
$user = $matches[1].Trim()
|
||||
}
|
||||
|
||||
# Nyomtató neve (pl. Jasenitz)
|
||||
if ($message -match "wurde auf (.+?) über Port") {
|
||||
$printer = $matches[1].Trim()
|
||||
}
|
||||
|
||||
# Oldalszám (pl. Gedruckte Seiten: 1)
|
||||
if ($message -match "Gedruckte Seiten:\s+(\d+)") {
|
||||
$pages = $matches[1]
|
||||
}
|
||||
|
||||
# Dokumentum sorszám (pl. Dokument 62) – jobb híján
|
||||
if ($message -match "^Dokument\s+(\d+)") {
|
||||
$document = "Dokument " + $matches[1]
|
||||
}
|
||||
|
||||
$logList += [PSCustomObject]@{
|
||||
Datum = $event.TimeCreated
|
||||
Benutzer = $user
|
||||
Dokument = $document
|
||||
Drucker = $printer
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
|
||||
# Exportálás CSV-be
|
||||
$exportPfad = "$env:USERPROFILE\Desktop\drucklog_export.csv"
|
||||
$logList | Export-Csv -Path $exportPfad -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Write-Host "Exportálás kész: $exportPfad"
|
||||
|
||||
54
Scripts/powershell/Drucker_Überwachung_0.2.ps1
Normal file
54
Scripts/powershell/Drucker_Überwachung_0.2.ps1
Normal file
@@ -0,0 +1,54 @@
|
||||
$events = Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational" -MaxEvents 500 |
|
||||
Where-Object { $_.Id -eq 307 }
|
||||
|
||||
$logList = @()
|
||||
|
||||
foreach ($event in $events) {
|
||||
$message = $event.Message
|
||||
$user = ""
|
||||
$computer = ""
|
||||
$document = ""
|
||||
$printer = ""
|
||||
$pages = ""
|
||||
|
||||
# Felhasználó és gép különválasztása
|
||||
if ($message -match "im Besitz von (.+?) wurde auf") {
|
||||
$fullUser = $matches[1].Trim()
|
||||
if ($fullUser -match "^(.+?) auf (.+)$") {
|
||||
$user = $matches[1].Trim()
|
||||
$computer = $matches[2].Trim()
|
||||
} else {
|
||||
$user = $fullUser
|
||||
}
|
||||
}
|
||||
|
||||
# Nyomtató neve (pl. Jasenitz)
|
||||
if ($message -match "wurde auf (.+?) über Port") {
|
||||
$printer = $matches[1].Trim()
|
||||
}
|
||||
|
||||
# Oldalszám (pl. Gedruckte Seiten: 1)
|
||||
if ($message -match "Gedruckte Seiten:\s+(\d+)") {
|
||||
$pages = $matches[1]
|
||||
}
|
||||
|
||||
# Dokument sorszám (pl. Dokument 62)
|
||||
if ($message -match "^Dokument\s+(\d+)") {
|
||||
$document = "Dokument " + $matches[1]
|
||||
}
|
||||
|
||||
$logList += [PSCustomObject]@{
|
||||
Datum = $event.TimeCreated
|
||||
Benutzer = $user
|
||||
Computer = $computer
|
||||
Dokument = $document
|
||||
Drucker = $printer
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
|
||||
# Exportálás CSV-be
|
||||
$exportPfad = "$env:USERPROFILE\Desktop\drucklog_export.csv"
|
||||
$logList | Export-Csv -Path $exportPfad -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Write-Host "Exportálás kész: $exportPfad"
|
||||
75
Scripts/powershell/Drucker_Überwachung_0.3.ps1
Normal file
75
Scripts/powershell/Drucker_Überwachung_0.3.ps1
Normal file
@@ -0,0 +1,75 @@
|
||||
# Printer Log Report 0.3
|
||||
#
|
||||
# Get-WinEvent on Englische Windows : Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational"
|
||||
# Get-WinEvent on Deutsche Windows : Get-WinEvent -LogName "Microsoft-Windows-PrintService/Betriebsbereit"
|
||||
|
||||
$events = Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational" -MaxEvents 500 |
|
||||
Where-Object { $_.Id -eq 307 }
|
||||
|
||||
$logList = @()
|
||||
|
||||
foreach ($event in $events) {
|
||||
$message = $event.Message
|
||||
$user = ""
|
||||
$computer = ""
|
||||
$document = ""
|
||||
$printer = ""
|
||||
$pages = 0
|
||||
|
||||
# Felhasználó és gép különválasztása
|
||||
if ($message -match "im Besitz von (.+?) wurde auf") {
|
||||
$fullUser = $matches[1].Trim()
|
||||
if ($fullUser -match "^(.+?) auf (.+)$") {
|
||||
$user = $matches[1].Trim()
|
||||
$computer = $matches[2].Trim()
|
||||
} else {
|
||||
$user = $fullUser
|
||||
}
|
||||
}
|
||||
|
||||
# Nyomtató neve (pl. Jasenitz)
|
||||
if ($message -match "wurde auf (.+?) über Port") {
|
||||
$printer = $matches[1].Trim()
|
||||
}
|
||||
|
||||
# Oldalszám (pl. Gedruckte Seiten: 1)
|
||||
if ($message -match "Gedruckte Seiten:\s+(\d+)") {
|
||||
$pages = [int]$matches[1]
|
||||
}
|
||||
|
||||
# Dokument sorszám (pl. Dokument 62)
|
||||
if ($message -match "^Dokument\s+(\d+)") {
|
||||
$document = "Dokument " + $matches[1]
|
||||
}
|
||||
|
||||
$logList += [PSCustomObject]@{
|
||||
Datum = $event.TimeCreated
|
||||
Benutzer = $user
|
||||
Computer = $computer
|
||||
Dokument = $document
|
||||
Drucker = $printer
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
|
||||
# Export részletes lista
|
||||
$exportPfad = "$env:USERPROFILE\Desktop\drucklog_export.csv"
|
||||
$logList | Export-Csv -Path $exportPfad -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# ✅ Összesítés felhasználónként
|
||||
$summary = $logList | Group-Object -Property Benutzer | ForEach-Object {
|
||||
$userGroup = $_.Group
|
||||
[PSCustomObject]@{
|
||||
Benutzer = $_.Name
|
||||
Anzahl_Dokumente = $userGroup.Count
|
||||
Gesamt_Seiten = ($userGroup | Measure-Object -Property Seiten -Sum).Sum
|
||||
}
|
||||
}
|
||||
|
||||
# Export összesítés
|
||||
$summaryPfad = "$env:USERPROFILE\Desktop\drucklog_summary.csv"
|
||||
$summary | Export-Csv -Path $summaryPfad -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Write-Host "Exportálás kész:"
|
||||
Write-Host "- Részletes lista: $exportPfad"
|
||||
Write-Host "- Felhasználónkénti összesítés: $summaryPfad"
|
||||
152
Scripts/powershell/Drucker_Überwachung_0.4.ps1
Normal file
152
Scripts/powershell/Drucker_Überwachung_0.4.ps1
Normal file
@@ -0,0 +1,152 @@
|
||||
# Printer Log Report 0.3
|
||||
#
|
||||
# Get-WinEvent on Englische Windows : Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational"
|
||||
# Get-WinEvent on Deutsche Windows : Get-WinEvent -LogName "Microsoft-Windows-PrintService/Betriebsbereit"
|
||||
|
||||
|
||||
$events = Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational" -MaxEvents 2000 |
|
||||
Where-Object { $_.Id -eq 307 }
|
||||
|
||||
$logList = @()
|
||||
|
||||
foreach ($event in $events) {
|
||||
$message = $event.Message
|
||||
$user = ""
|
||||
$computer = ""
|
||||
$document = ""
|
||||
$printer = ""
|
||||
$pages = 0
|
||||
|
||||
if ($message -match "im Besitz von (.+?) wurde auf") {
|
||||
$fullUser = $matches[1].Trim()
|
||||
if ($fullUser -match "^(.+?) auf (.+)$") {
|
||||
$user = $matches[1].Trim()
|
||||
$computer = $matches[2].Trim()
|
||||
} else {
|
||||
$user = $fullUser
|
||||
}
|
||||
}
|
||||
|
||||
if ($message -match "wurde auf (.+?) über Port") {
|
||||
$printer = $matches[1].Trim()
|
||||
}
|
||||
|
||||
if ($message -match "Gedruckte Seiten:\s+(\d+)") {
|
||||
$pages = [int]$matches[1]
|
||||
}
|
||||
|
||||
if ($message -match "^Dokument\s+(\d+)") {
|
||||
$document = "Dokument " + $matches[1]
|
||||
}
|
||||
|
||||
$logList += [PSCustomObject]@{
|
||||
Datum = $event.TimeCreated
|
||||
Tag = $event.TimeCreated.Date.ToString("yyyy-MM-dd")
|
||||
Woche = Get-Date $event.TimeCreated -UFormat "%Y-W%V"
|
||||
Benutzer = $user
|
||||
Computer = $computer
|
||||
Dokument = $document
|
||||
Drucker = $printer
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
|
||||
# 🔹 Export részletes lista
|
||||
$exportPfad = "$env:USERPROFILE\Desktop\drucklog_export.csv"
|
||||
$logList | Export-Csv -Path $exportPfad -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# 🔸 Összesítés felhasználónként (teljes)
|
||||
$summary = $logList | Group-Object -Property Benutzer | ForEach-Object {
|
||||
$userGroup = $_.Group
|
||||
[PSCustomObject]@{
|
||||
Benutzer = $_.Name
|
||||
Anzahl_Dokumente = $userGroup.Count
|
||||
Gesamt_Seiten = ($userGroup | Measure-Object -Property Seiten -Sum).Sum
|
||||
}
|
||||
}
|
||||
$summary | Export-Csv -Path "$env:USERPROFILE\Desktop\drucklog_summary.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# 🔸 Napi összesítés felhasználónként
|
||||
$dailySummary = $logList | Group-Object -Property Tag, Benutzer | ForEach-Object {
|
||||
$day = $_.Group[0].Tag
|
||||
$user = $_.Group[0].Benutzer
|
||||
$pages = ($_.Group | Measure-Object -Property Seiten -Sum).Sum
|
||||
$docs = $_.Count
|
||||
|
||||
[PSCustomObject]@{
|
||||
Datum = $day
|
||||
Benutzer = $user
|
||||
Dokumente = $docs
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
$dailySummary | Export-Csv -Path "$env:USERPROFILE\Desktop\drucklog_daily.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# 🔸 Heti összesítés felhasználónként (ISO hét formátum: pl. 2025-W30)
|
||||
$weeklySummary = $logList | Group-Object -Property Woche, Benutzer | ForEach-Object {
|
||||
$week = $_.Group[0].Woche
|
||||
$user = $_.Group[0].Benutzer
|
||||
$pages = ($_.Group | Measure-Object -Property Seiten -Sum).Sum
|
||||
$docs = $_.Count
|
||||
|
||||
[PSCustomObject]@{
|
||||
Woche = $week
|
||||
Benutzer = $user
|
||||
Dokumente = $docs
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
$weeklySummary | Export-Csv -Path "$env:USERPROFILE\Desktop\drucklog_weekly.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Write-Host "Exportálás kész:"
|
||||
Write-Host "- Részletes lista: drucklog_export.csv"
|
||||
Write-Host "- Összesítés: drucklog_summary.csv"
|
||||
Write-Host "- Napi összesítés: drucklog_daily.csv"
|
||||
Write-Host "- Heti összesítés: drucklog_weekly.csv"
|
||||
|
||||
# 🔸 Nyomtatónkénti összesítés
|
||||
$printerSummary = $logList | Group-Object -Property Drucker | ForEach-Object {
|
||||
$printer = $_.Name
|
||||
$pages = ($_.Group | Measure-Object -Property Seiten -Sum).Sum
|
||||
$docs = $_.Count
|
||||
|
||||
[PSCustomObject]@{
|
||||
Drucker = $printer
|
||||
Dokumente = $docs
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
|
||||
$printerSummary | Export-Csv -Path "$env:USERPROFILE\Desktop\drucklog_by_printer.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# 🔸 Napi összesítés nyomtatónként
|
||||
$dailyPrinterSummary = $logList | Group-Object -Property Tag, Drucker | ForEach-Object {
|
||||
$day = $_.Group[0].Tag
|
||||
$printer = $_.Group[0].Drucker
|
||||
$pages = ($_.Group | Measure-Object -Property Seiten -Sum).Sum
|
||||
$docs = $_.Count
|
||||
|
||||
[PSCustomObject]@{
|
||||
Datum = $day
|
||||
Drucker = $printer
|
||||
Dokumente = $docs
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
$dailyPrinterSummary | Export-Csv -Path "$env:USERPROFILE\Desktop\drucklog_daily_by_printer.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# 🔸 Heti összesítés nyomtatónként
|
||||
$weeklyPrinterSummary = $logList | Group-Object -Property Woche, Drucker | ForEach-Object {
|
||||
$week = $_.Group[0].Woche
|
||||
$printer = $_.Group[0].Drucker
|
||||
$pages = ($_.Group | Measure-Object -Property Seiten -Sum).Sum
|
||||
$docs = $_.Count
|
||||
|
||||
[PSCustomObject]@{
|
||||
Woche = $week
|
||||
Drucker = $printer
|
||||
Dokumente = $docs
|
||||
Seiten = $pages
|
||||
}
|
||||
}
|
||||
$weeklyPrinterSummary | Export-Csv -Path "$env:USERPROFILE\Desktop\drucklog_weekly_by_printer.csv" -NoTypeInformation -Encoding UTF8
|
||||
98
Scripts/powershell/Drucker_Überwachung_mit_SqlLite_0.1.ps1
Normal file
98
Scripts/powershell/Drucker_Überwachung_mit_SqlLite_0.1.ps1
Normal file
@@ -0,0 +1,98 @@
|
||||
# Drucklog_Export.ps1
|
||||
# Nyomtatási napló beolvasása Event Log-ból, feldolgozása és mentése SQLite adatbázisba duplikációk nélkül
|
||||
# Fontos modul SQLite feldolgozäshoz
|
||||
# Install-Module -Name SQLite -Scope CurrentUser
|
||||
# Import-Module SQLite
|
||||
|
||||
# --- Beállítások ---
|
||||
$logName = "Microsoft-Windows-PrintService/Operational"
|
||||
$dbPath = "$env:USERPROFILE\Desktop\drucklog_APS-PRINT01.db"
|
||||
# $dbPath = "$env:USERPROFILE\Desktop\drucklog_APS-PRINT02.db"
|
||||
|
||||
# --- SQLite kapcsolat ---
|
||||
# Add-Type -Path "C:\Tools\SQLite\System.Data.SQLite.dll"
|
||||
$connectionString = "Data Source=$dbPath;Version=3;"
|
||||
$connection = New-Object System.Data.SQLite.SQLiteConnection($connectionString)
|
||||
$connection.Open()
|
||||
|
||||
# --- Tábla létrehozása, ha nem létezik ---
|
||||
$createTableCmd = $connection.CreateCommand()
|
||||
$createTableCmd.CommandText = @"
|
||||
CREATE TABLE IF NOT EXISTS drucklog (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
event_id INTEGER UNIQUE,
|
||||
datum TEXT,
|
||||
tag TEXT,
|
||||
woche TEXT,
|
||||
benutzer TEXT,
|
||||
computer TEXT,
|
||||
dokument TEXT,
|
||||
drucker TEXT,
|
||||
seiten INTEGER
|
||||
);
|
||||
"@
|
||||
$createTableCmd.ExecuteNonQuery()
|
||||
|
||||
# --- Események lekérdezése ---
|
||||
$events = Get-WinEvent -LogName $logName -ErrorAction SilentlyContinue | Where-Object { $_.Id -eq 307 }
|
||||
|
||||
# --- Adatok feldolgozása ---
|
||||
$logList = foreach ($event in $events) {
|
||||
$msg = $event.Message
|
||||
|
||||
if ($msg -match "im Besitz von (.+?) auf (.+?) wurde auf (.+?) über Port") {
|
||||
$benutzer = $matches[1]
|
||||
$computer = $matches[2]
|
||||
$drucker = $matches[3]
|
||||
}
|
||||
else {
|
||||
continue
|
||||
}
|
||||
|
||||
$dokument = if ($msg -match "Dokument (.+?), Dokument drucken") { $matches[1] } else { "Unbekannt" }
|
||||
$seiten = if ($msg -match "Gedruckte Seiten: (\d+)") { [int]$matches[1] } else { 0 }
|
||||
|
||||
$calendar = [System.Globalization.CultureInfo]::CurrentCulture.Calendar
|
||||
$weekRule = [System.Globalization.CalendarWeekRule]::FirstFourDayWeek
|
||||
$firstDay = [System.DayOfWeek]::Monday
|
||||
$woche = $calendar.GetWeekOfYear($event.TimeCreated, $weekRule, $firstDay)
|
||||
|
||||
[PSCustomObject]@{
|
||||
Id = $event.RecordId
|
||||
Datum = $event.TimeCreated.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
Tag = $event.TimeCreated.ToString("yyyy-MM-dd")
|
||||
Woche = $woche
|
||||
Benutzer = $benutzer
|
||||
Computer = $computer
|
||||
Dokument = $dokument
|
||||
Drucker = $drucker
|
||||
Seiten = $seiten
|
||||
}
|
||||
}
|
||||
|
||||
# --- Adatok mentése adatbázisba, duplikáció nélkül ---
|
||||
foreach ($row in $logList) {
|
||||
$checkCmd = $connection.CreateCommand()
|
||||
$checkCmd.CommandText = "SELECT COUNT(*) FROM drucklog WHERE event_id = @id"
|
||||
$checkCmd.Parameters.AddWithValue("@id", $row.Id)
|
||||
$exists = $checkCmd.ExecuteScalar()
|
||||
|
||||
if ($exists -eq 0) {
|
||||
$insertCmd = $connection.CreateCommand()
|
||||
$insertCmd.CommandText = "INSERT INTO drucklog (event_id, datum, tag, woche, benutzer, computer, dokument, drucker, seiten)
|
||||
VALUES (@id, @datum, @tag, @woche, @benutzer, @computer, @dokument, @drucker, @seiten)"
|
||||
$insertCmd.Parameters.AddWithValue("@id", $row.Id)
|
||||
$insertCmd.Parameters.AddWithValue("@datum", $row.Datum)
|
||||
$insertCmd.Parameters.AddWithValue("@tag", $row.Tag)
|
||||
$insertCmd.Parameters.AddWithValue("@woche", $row.Woche)
|
||||
$insertCmd.Parameters.AddWithValue("@benutzer", $row.Benutzer)
|
||||
$insertCmd.Parameters.AddWithValue("@computer", $row.Computer)
|
||||
$insertCmd.Parameters.AddWithValue("@dokument", $row.Dokument)
|
||||
$insertCmd.Parameters.AddWithValue("@drucker", $row.Drucker)
|
||||
$insertCmd.Parameters.AddWithValue("@seiten", $row.Seiten)
|
||||
$insertCmd.ExecuteNonQuery()
|
||||
}
|
||||
}
|
||||
|
||||
$connection.Close()
|
||||
Write-Host "Sikeresen frissítve: $($logList.Count) esemény feldolgozva."
|
||||
101
Scripts/powershell/Drucker_Überwachung_mit_SqlLite_0.2.ps1
Normal file
101
Scripts/powershell/Drucker_Überwachung_mit_SqlLite_0.2.ps1
Normal file
@@ -0,0 +1,101 @@
|
||||
# Drucklog_Export.ps1
|
||||
# Nyomtatási napló beolvasása Event Log-ból, feldolgozása és mentése SQLite adatbázisba duplikációk nélkül
|
||||
# Fontos modul SQLite feldolgozäshoz
|
||||
# Install-Module -Name SQLite -Scope CurrentUser
|
||||
# Import-Module SQLite
|
||||
|
||||
# --- Beállítások ---
|
||||
$logName = "Microsoft-Windows-PrintService/Operational"
|
||||
$dbPath = "$env:USERPROFILE\Desktop\drucklog_APS-PRINT01.db"
|
||||
# $dbPath = "$env:USERPROFILE\Desktop\drucklog_APS-PRINT02.db"
|
||||
|
||||
# --- SQLite kapcsolat ---
|
||||
# Add-Type -Path "C:\Tools\SQLite\System.Data.SQLite.dll"
|
||||
$connectionString = "Data Source=$dbPath;Version=3;"
|
||||
$connection = New-Object System.Data.SQLite.SQLiteConnection($connectionString)
|
||||
$connection.Open()
|
||||
|
||||
# --- Tábla létrehozása, ha nem létezik ---
|
||||
$createTableCmd = $connection.CreateCommand()
|
||||
$createTableCmd.CommandText = @"
|
||||
CREATE TABLE IF NOT EXISTS drucklog (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
event_id INTEGER UNIQUE,
|
||||
datum TEXT,
|
||||
tag TEXT,
|
||||
woche TEXT,
|
||||
benutzer TEXT,
|
||||
computer TEXT,
|
||||
dokument TEXT,
|
||||
drucker TEXT,
|
||||
seiten INTEGER
|
||||
);
|
||||
"@
|
||||
$createTableCmd.ExecuteNonQuery()
|
||||
|
||||
# --- Események lekérdezése ---
|
||||
$events = Get-WinEvent -LogName $logName -ErrorAction SilentlyContinue | Where-Object { $_.Id -eq 307 }
|
||||
|
||||
# --- Adatok feldolgozása ---
|
||||
$logList = foreach ($event in $events) {
|
||||
$msg = $event.Message
|
||||
|
||||
if ($msg -match "im Besitz von (.+?) auf (.+?) wurde auf (.+?) über Port") {
|
||||
$benutzer = $matches[1]
|
||||
$computer = $matches[2]
|
||||
$drucker = $matches[3]
|
||||
}
|
||||
else {
|
||||
continue
|
||||
}
|
||||
|
||||
$dokument = if ($msg -match "Dokument (.+?), Dokument drucken") { $matches[1] } else { "Unbekannt" }
|
||||
$seiten = if ($msg -match "Gedruckte Seiten: (\d+)") { [int]$matches[1] } else { 0 }
|
||||
|
||||
$calendar = [System.Globalization.CultureInfo]::CurrentCulture.Calendar
|
||||
$weekRule = [System.Globalization.CalendarWeekRule]::FirstFourDayWeek
|
||||
$firstDay = [System.DayOfWeek]::Monday
|
||||
$woche = $calendar.GetWeekOfYear($event.TimeCreated, $weekRule, $firstDay)
|
||||
|
||||
[PSCustomObject]@{
|
||||
Id = $event.RecordId
|
||||
Datum = $event.TimeCreated.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
Tag = $event.TimeCreated.ToString("yyyy-MM-dd")
|
||||
Woche = $woche
|
||||
Benutzer = $benutzer
|
||||
Computer = $computer
|
||||
Dokument = $dokument
|
||||
Drucker = $drucker
|
||||
Seiten = $seiten
|
||||
}
|
||||
}
|
||||
|
||||
# --- Adatok mentése adatbázisba, duplikáció nélkül ---
|
||||
$ujBejegyzesek = 0
|
||||
foreach ($row in $logList) {
|
||||
$checkCmd = $connection.CreateCommand()
|
||||
$checkCmd.CommandText = "SELECT COUNT(*) FROM drucklog WHERE event_id = @id"
|
||||
$checkCmd.Parameters.AddWithValue("@id", $row.Id)
|
||||
$exists = $checkCmd.ExecuteScalar()
|
||||
|
||||
if ($exists -eq 0) {
|
||||
$insertCmd = $connection.CreateCommand()
|
||||
$insertCmd.CommandText = "INSERT INTO drucklog (event_id, datum, tag, woche, benutzer, computer, dokument, drucker, seiten)
|
||||
VALUES (@id, @datum, @tag, @woche, @benutzer, @computer, @dokument, @drucker, @seiten)"
|
||||
$insertCmd.Parameters.AddWithValue("@id", $row.Id)
|
||||
$insertCmd.Parameters.AddWithValue("@datum", $row.Datum)
|
||||
$insertCmd.Parameters.AddWithValue("@tag", $row.Tag)
|
||||
$insertCmd.Parameters.AddWithValue("@woche", $row.Woche)
|
||||
$insertCmd.Parameters.AddWithValue("@benutzer", $row.Benutzer)
|
||||
$insertCmd.Parameters.AddWithValue("@computer", $row.Computer)
|
||||
$insertCmd.Parameters.AddWithValue("@dokument", $row.Dokument)
|
||||
$insertCmd.Parameters.AddWithValue("@drucker", $row.Drucker)
|
||||
$insertCmd.Parameters.AddWithValue("@seiten", $row.Seiten)
|
||||
$insertCmd.ExecuteNonQuery()
|
||||
$ujBejegyzesek++
|
||||
}
|
||||
}
|
||||
|
||||
$connection.Close()
|
||||
Write-Host "Sikeresen frissítve: $($logList.Count) esemény feldolgozva."
|
||||
Write-Host "Új bejegyzések az adatbázisban: $ujBejegyzesek"
|
||||
81
Scripts/powershell/Drucklog_MySQL_0.1-from-Dev.ps1
Normal file
81
Scripts/powershell/Drucklog_MySQL_0.1-from-Dev.ps1
Normal file
@@ -0,0 +1,81 @@
|
||||
# Drucklog_MySQL.ps1
|
||||
# Install-Module MySQLCmdlets
|
||||
# Nyomtatási napló export MySQL adatbázisba
|
||||
# Aufgabeplannung: Taglich um 8.00 Uhr
|
||||
# Name: Drucklog_MySQL_0.1.ps1
|
||||
# powershell.exe -ExecutionPolicy Bypass -File "-ExecutionPolicy Bypass -File "C:\Tools\drucklog_export_0.1.ps1"
|
||||
|
||||
# Beállítások
|
||||
$logName = "Microsoft-Windows-PrintService/Operational"
|
||||
$mysqlHost = "10.101.0.82"
|
||||
$mysqlUser = "druckloguser"
|
||||
$mysqlPassword = "Test123#"
|
||||
$mysqlDatabase = "drucklog"
|
||||
$quelleServer = $env:COMPUTERNAME # vagy: "Szerver01"
|
||||
|
||||
# MySQL .NET csomag betöltése (előzetesen szükséges: MySql.Data.dll)
|
||||
# Add-Type -Path "C:\Tools\MySql.Data.dll"
|
||||
# Add-Type -Path "C:\Program Files (x86)\MySQL\MySQL Connector NET 9.4\MySql.Data.dll"
|
||||
[Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\MySQL\MySQL Connector NET 9.4\MySql.Data.dll") | Out-Null
|
||||
|
||||
# Kapcsolódás
|
||||
$connectionString = "server=$mysqlHost;user id=$mysqlUser;password=$mysqlPassword;database=$mysqlDatabase;SslMode=none"
|
||||
$connection = New-Object MySql.Data.MySqlClient.MySqlConnection($connectionString)
|
||||
$connection.Open()
|
||||
|
||||
# Lekérés a logból
|
||||
$events = Get-WinEvent -LogName $logName -ErrorAction SilentlyContinue | Where-Object { $_.Id -eq 307 }
|
||||
|
||||
# Kulturális beállítás a heti számításhoz
|
||||
$calendar = [System.Globalization.CultureInfo]::CurrentCulture.Calendar
|
||||
$weekRule = [System.Globalization.CalendarWeekRule]::FirstFourDayWeek
|
||||
$firstDay = [System.DayOfWeek]::Monday
|
||||
|
||||
$ujBejegyzes = 0
|
||||
|
||||
foreach ($event in $events) {
|
||||
$msg = $event.Message
|
||||
|
||||
if ($msg -match "im Besitz von (.+?) auf (.+?) wurde auf (.+?) über Port") {
|
||||
$benutzer = $matches[1]
|
||||
$computer = $matches[2]
|
||||
$drucker = $matches[3]
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
$dokument = if ($msg -match "Dokument (.+?), Dokument drucken") { $matches[1] } else { "Unbekannt" }
|
||||
$seiten = if ($msg -match "Gedruckte Seiten: (\d+)") { [int]$matches[1] } else { 0 }
|
||||
$woche = $calendar.GetWeekOfYear($event.TimeCreated, $weekRule, $firstDay)
|
||||
$datum = $event.TimeCreated.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
$tag = $event.TimeCreated.ToString("yyyy-MM-dd")
|
||||
$id = $event.RecordId
|
||||
|
||||
# Duplikáció ellenőrzés
|
||||
$checkCmd = $connection.CreateCommand()
|
||||
$checkCmd.CommandText = "SELECT COUNT(*) FROM drucklog WHERE event_id = @id AND quelle_server = @qs"
|
||||
$checkCmd.Parameters.AddWithValue("@id", $id)
|
||||
$checkCmd.Parameters.AddWithValue("@qs", $quelleServer)
|
||||
$exists = $checkCmd.ExecuteScalar()
|
||||
|
||||
if ($exists -eq 0) {
|
||||
$insertCmd = $connection.CreateCommand()
|
||||
$insertCmd.CommandText = "INSERT INTO drucklog (event_id, datum, tag, woche, benutzer, computer, dokument, drucker, seiten, quelle_server)
|
||||
VALUES (@id, @datum, @tag, @woche, @benutzer, @computer, @dokument, @drucker, @seiten, @qs)"
|
||||
$insertCmd.Parameters.AddWithValue("@id", $id)
|
||||
$insertCmd.Parameters.AddWithValue("@datum", $datum)
|
||||
$insertCmd.Parameters.AddWithValue("@tag", $tag)
|
||||
$insertCmd.Parameters.AddWithValue("@woche", $woche)
|
||||
$insertCmd.Parameters.AddWithValue("@benutzer", $benutzer)
|
||||
$insertCmd.Parameters.AddWithValue("@computer", $computer)
|
||||
$insertCmd.Parameters.AddWithValue("@dokument", $dokument)
|
||||
$insertCmd.Parameters.AddWithValue("@drucker", $drucker)
|
||||
$insertCmd.Parameters.AddWithValue("@seiten", $seiten)
|
||||
$insertCmd.Parameters.AddWithValue("@qs", $quelleServer)
|
||||
$insertCmd.ExecuteNonQuery()
|
||||
$ujBejegyzes++
|
||||
}
|
||||
}
|
||||
|
||||
$connection.Close()
|
||||
Write-Host "Feldolgozott események: $($events.Count) | Új bejegyzés: $ujBejegyzes"
|
||||
78
Scripts/powershell/Drucklog_MySQL_0.1.ps1
Normal file
78
Scripts/powershell/Drucklog_MySQL_0.1.ps1
Normal file
@@ -0,0 +1,78 @@
|
||||
# Drucklog_MySQL.ps1
|
||||
# Install-Module MySQLCmdlets
|
||||
# Nyomtatási napló export MySQL adatbázisba
|
||||
|
||||
# Beállítások
|
||||
$logName = "Microsoft-Windows-PrintService/Operational"
|
||||
$mysqlHost = "10.101.0.82"
|
||||
$mysqlUser = "druckloguser"
|
||||
$mysqlPassword = "Test123#"
|
||||
$mysqlDatabase = "drucklog"
|
||||
$quelleServer = $env:COMPUTERNAME # vagy: "Szerver01"
|
||||
|
||||
# MySQL .NET csomag betöltése (előzetesen szükséges: MySql.Data.dll)
|
||||
# Add-Type -Path "C:\Tools\MySql.Data.dll"
|
||||
# Add-Type -Path "C:\Program Files (x86)\MySQL\MySQL Connector NET 9.4\MySql.Data.dll"
|
||||
[Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\MySQL\MySQL Connector NET 9.4\MySql.Data.dll") | Out-Null
|
||||
|
||||
# Kapcsolódás
|
||||
$connectionString = "server=$mysqlHost;user id=$mysqlUser;password=$mysqlPassword;database=$mysqlDatabase;SslMode=none"
|
||||
$connection = New-Object MySql.Data.MySqlClient.MySqlConnection($connectionString)
|
||||
$connection.Open()
|
||||
|
||||
# Lekérés a logból
|
||||
$events = Get-WinEvent -LogName $logName -ErrorAction SilentlyContinue | Where-Object { $_.Id -eq 307 }
|
||||
|
||||
# Kulturális beállítás a heti számításhoz
|
||||
$calendar = [System.Globalization.CultureInfo]::CurrentCulture.Calendar
|
||||
$weekRule = [System.Globalization.CalendarWeekRule]::FirstFourDayWeek
|
||||
$firstDay = [System.DayOfWeek]::Monday
|
||||
|
||||
$ujBejegyzes = 0
|
||||
|
||||
foreach ($event in $events) {
|
||||
$msg = $event.Message
|
||||
|
||||
if ($msg -match "im Besitz von (.+?) auf (.+?) wurde auf (.+?) über Port") {
|
||||
$benutzer = $matches[1]
|
||||
$computer = $matches[2]
|
||||
$drucker = $matches[3]
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
$dokument = if ($msg -match "Dokument (.+?), Dokument drucken") { $matches[1] } else { "Unbekannt" }
|
||||
$seiten = if ($msg -match "Gedruckte Seiten: (\d+)") { [int]$matches[1] } else { 0 }
|
||||
$woche = $calendar.GetWeekOfYear($event.TimeCreated, $weekRule, $firstDay)
|
||||
$datum = $event.TimeCreated.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
$tag = $event.TimeCreated.ToString("yyyy-MM-dd")
|
||||
$id = $event.RecordId
|
||||
|
||||
# Duplikáció ellenőrzés
|
||||
$checkCmd = $connection.CreateCommand()
|
||||
$checkCmd.CommandText = "SELECT COUNT(*) FROM drucklog WHERE event_id = @id AND quelle_server = @qs"
|
||||
$checkCmd.Parameters.AddWithValue("@id", $id)
|
||||
$checkCmd.Parameters.AddWithValue("@qs", $quelleServer)
|
||||
$exists = $checkCmd.ExecuteScalar()
|
||||
|
||||
if ($exists -eq 0) {
|
||||
$insertCmd = $connection.CreateCommand()
|
||||
$insertCmd.CommandText = "INSERT INTO drucklog (event_id, datum, tag, woche, benutzer, computer, dokument, drucker, seiten, quelle_server)
|
||||
VALUES (@id, @datum, @tag, @woche, @benutzer, @computer, @dokument, @drucker, @seiten, @qs)"
|
||||
$insertCmd.Parameters.AddWithValue("@id", $id)
|
||||
$insertCmd.Parameters.AddWithValue("@datum", $datum)
|
||||
$insertCmd.Parameters.AddWithValue("@tag", $tag)
|
||||
$insertCmd.Parameters.AddWithValue("@woche", $woche)
|
||||
$insertCmd.Parameters.AddWithValue("@benutzer", $benutzer)
|
||||
$insertCmd.Parameters.AddWithValue("@computer", $computer)
|
||||
$insertCmd.Parameters.AddWithValue("@dokument", $dokument)
|
||||
$insertCmd.Parameters.AddWithValue("@drucker", $drucker)
|
||||
$insertCmd.Parameters.AddWithValue("@seiten", $seiten)
|
||||
$insertCmd.Parameters.AddWithValue("@qs", $quelleServer)
|
||||
$insertCmd.ExecuteNonQuery()
|
||||
$ujBejegyzes++
|
||||
}
|
||||
}
|
||||
|
||||
$connection.Close()
|
||||
Write-Host "Feldolgozott események: $($events.Count) | Új bejegyzés: $ujBejegyzes"
|
||||
2
Scripts/powershell/Exchange_Kalender.ps1
Normal file
2
Scripts/powershell/Exchange_Kalender.ps1
Normal file
@@ -0,0 +1,2 @@
|
||||
# Kalender Megosztäs
|
||||
Get-MailboxFolderPermission l.hintz:\Kalender
|
||||
8
Scripts/powershell/Exchange_User_Access.ps1
Normal file
8
Scripts/powershell/Exchange_User_Access.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$User = "i.meszely@aps-hh.de"
|
||||
|
||||
# Full Access
|
||||
Get-Mailbox | Get-MailboxPermission | Where-Object { $_.User -like $User -and $_.AccessRights -contains "FullAccess" } | Select-Object Identity, User, AccessRights
|
||||
# Send As
|
||||
Get-Mailbox | Get-ADPermission | Where-Object { $_.User -like $User -and $_.ExtendedRights -like "Send As" } | Select-Object Identity, User, ExtendedRights
|
||||
# Mitglied
|
||||
Get-DistributionGroup | Where-Object { (Get-DistributionGroupMember $_.Identity -ResultSize Unlimited) -contains $User } | Select-Object Name, PrimarySmtpAddress
|
||||
6
Scripts/powershell/Freie_Platz_Hard_Drive.ps1
Normal file
6
Scripts/powershell/Freie_Platz_Hard_Drive.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
Get-WmiObject -Class Win32_LogicalDisk | ? {$_. DriveType -eq 3} | select DeviceID, {$_.Size /1GB}, {$_.FreeSpace /1GB}
|
||||
|
||||
# z.B. ha csak a C meghajtó érdekel
|
||||
#DeviceID $_.Size /1GB $_.FreeSpace /1GB
|
||||
#-------- ------------ -----------------
|
||||
#C: 99,3974571228027 0,667621612548828
|
||||
33
Scripts/powershell/IMAP PDF attachment downloader.ps1
Normal file
33
Scripts/powershell/IMAP PDF attachment downloader.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
# IMAP PDF attachment downloader (requires MailKit DLL)
|
||||
|
||||
# Először töltsd le a MailKit DLL-t: https://www.nuget.org/packages/MailKit
|
||||
# Példa letöltés: https://github.com/jstedfast/MailKit/releases/latest
|
||||
|
||||
Add-Type -Path "C:\Apps\MailKit\MailKit.dll"
|
||||
Add-Type -Path "C:\Apps\MailKit\MimeKit.dll"
|
||||
|
||||
$imapServer = "your.exchange.server"
|
||||
$imapPort = 993
|
||||
$username = "your-username"
|
||||
$password = "your-password"
|
||||
|
||||
$client = New-Object MailKit.Net.Imap.ImapClient
|
||||
$client.Connect($imapServer, $imapPort, $true)
|
||||
$client.Authenticate($username, $password)
|
||||
$inbox = $client.Inbox
|
||||
$inbox.Open([MailKit.FolderAccess]::ReadOnly)
|
||||
|
||||
foreach ($msg in $inbox.Fetch(0, $inbox.Count - 1, [MailKit.MessageSummaryItems]::Full | [MailKit.MessageSummaryItems]::UniqueId)) {
|
||||
$email = $inbox.GetMessage($msg.UniqueId)
|
||||
foreach ($attachment in $email.Attachments) {
|
||||
if ($attachment.ContentType.MediaType -eq "application" -and $attachment.ContentType.MediaSubtype -eq "pdf") {
|
||||
$filePath = "C:\Downloads\" + $attachment.FileName
|
||||
$stream = [System.IO.File]::Create($filePath)
|
||||
$attachment.Content.DecodeTo($stream)
|
||||
$stream.Close()
|
||||
Write-Host "Downloaded: $filePath"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$client.Disconnect($true)
|
||||
32
Scripts/powershell/Oof_DROP_List.ps1
Normal file
32
Scripts/powershell/Oof_DROP_List.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
# This script retrieves message tracking logs for emails that were dropped by the transport service on the current day.
|
||||
|
||||
# --- Configuration ---
|
||||
# Define the path for the output CSV file.
|
||||
$OutputPath = "C:\Tools\oof_DROP.csv" # You can change this path
|
||||
|
||||
# --- Script ---
|
||||
|
||||
# Set the start and end times for the query to span the entire current day.
|
||||
$startOfDay = (Get-Date).Date
|
||||
$endOfDay = $startOfDay.AddDays(1).AddSeconds(-1)
|
||||
|
||||
Write-Host "Querying message tracking logs for dropped 'Automatic Reply' messages between $startOfDay and $endOfDay..."
|
||||
|
||||
# Query for dropped messages with "Automatische Antwort" in the subject, excluding the postmaster sender.
|
||||
$droppedMessages = Get-TransportService | Get-MessageTrackingLog -wa 0 -EventId "DROP" -MessageSubject "Automatische Antwort" -Start $startOfDay -End $endOfDay | Where-Object { $_.Sender -ne 'postmaster@aps.local' }
|
||||
|
||||
if ($droppedMessages) {
|
||||
# Select the desired properties for both console output and CSV export.
|
||||
$outputData = $droppedMessages | Select-Object Timestamp, EventId, Source, Sender, @{Name='Recipients';Expression={$_.Recipients -join ';'}}, RecipientStatus, MessageSubject, InternalMessageId
|
||||
|
||||
# Display the results in the console.
|
||||
Write-Host "Dropped 'Automatic Reply' messages found:"
|
||||
$outputData | Format-Table
|
||||
|
||||
# Export the results to a CSV file, overwriting if it exists.
|
||||
Write-Host "Exporting results to $OutputPath..."
|
||||
$outputData | Export-Csv -Path $OutputPath -NoTypeInformation -Encoding UTF8 -Force
|
||||
Write-Host "Export complete."
|
||||
} else {
|
||||
Write-Host "No dropped 'Automatic Reply' messages found for the current day."
|
||||
}
|
||||
42
Scripts/powershell/Oof_Enabled.ps1
Normal file
42
Scripts/powershell/Oof_Enabled.ps1
Normal file
@@ -0,0 +1,42 @@
|
||||
# Connect to Exchange Online (requires ExchangeOnlineManagement module)
|
||||
# Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber
|
||||
# Connect-ExchangeOnline -ShowProgress $true
|
||||
|
||||
# --- Script ---
|
||||
|
||||
# Get all user mailboxes
|
||||
Write-Host "Retrieving all user mailboxes..."
|
||||
$mailboxes = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq 'UserMailbox'}
|
||||
|
||||
# Create a container for the OOF enabled users
|
||||
$oofEnabledUsers = @()
|
||||
|
||||
Write-Host "Checking Out of Office status for each mailbox..."
|
||||
foreach ($mailbox in $mailboxes) {
|
||||
try {
|
||||
$oofSettings = Get-MailboxAutoReplyConfiguration -Identity $mailbox.UserPrincipalName
|
||||
|
||||
if ($oofSettings.AutoReplyState -ne "Disabled") {
|
||||
$oofEnabledUsers += [PSCustomObject]@{
|
||||
UserPrincipalName = $mailbox.UserPrincipalName
|
||||
AutoReplyState = $oofSettings.AutoReplyState
|
||||
StartTime = $oofSettings.StartTime
|
||||
EndTime = $oofSettings.EndTime
|
||||
InternalMessage = $oofSettings.InternalMessage
|
||||
ExternalMessage = $oofSettings.ExternalMessage
|
||||
}
|
||||
Write-Host " OOO enabled for $($mailbox.UserPrincipalName)"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Could not retrieve OOF settings for $($mailbox.UserPrincipalName). Error: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
|
||||
# Display the OOF configurations for all users where it's enabled
|
||||
Write-Host "`n--- Summary of Users with Enabled Out of Office ---"
|
||||
if ($oofEnabledUsers.Count -gt 0) {
|
||||
$oofEnabledUsers | Format-Table
|
||||
} else {
|
||||
Write-Host "No users found with Out of Office enabled."
|
||||
}
|
||||
2
Scripts/powershell/Powershell_Ver.ps1
Normal file
2
Scripts/powershell/Powershell_Ver.ps1
Normal file
@@ -0,0 +1,2 @@
|
||||
# Powershell Versio
|
||||
$PSVersionTable
|
||||
16
Scripts/powershell/RDP események exportálása CSV-be.ps1
Normal file
16
Scripts/powershell/RDP események exportálása CSV-be.ps1
Normal file
@@ -0,0 +1,16 @@
|
||||
# RDP események exportálása CSV-be
|
||||
Get-WinEvent -LogName "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" `
|
||||
| Where-Object { $_.Id -in 21,22,23,24,25,39,40,41 } `
|
||||
| Select-Object TimeCreated, Id, LevelDisplayName, Message `
|
||||
| Export-Csv "C:\Logs\RDP_LocalSessionManager.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Get-WinEvent -LogName "Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational" `
|
||||
| Select-Object TimeCreated, Id, LevelDisplayName, Message `
|
||||
| Export-Csv "C:\Logs\RDP_RemoteConnectionManager.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Get-WinEvent -LogName "System" | Where-Object { $_.Id -eq 56 -and $_.ProviderName -eq "TermDD" } `
|
||||
| Select-Object TimeCreated, Id, LevelDisplayName, Message `
|
||||
| Export-Csv "C:\Logs\RDP_TermDD.csv" -NoTypeInformation -Encoding UTF8
|
||||
|
||||
|
||||
|
||||
23
Scripts/powershell/SMTP Tester 02.ps1
Normal file
23
Scripts/powershell/SMTP Tester 02.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
$SMTPServer = "smtp.mail.me.com" # Az SMTP szerver címe
|
||||
$SMTPPort = 587 # SMTP port (általában 587 a TLS-hez)
|
||||
$Username = "imeszely@icloud.com" # SMTP felhasználónév
|
||||
$Password = "pandAmacI6774#" # SMTP jelszó
|
||||
|
||||
# SMTP kapcsolat létrehozása
|
||||
$SMTPClient = New-Object Net.Mail.SmtpClient($SMTPServer, $SMTPPort)
|
||||
$SMTPClient.EnableSsl = $true # TLS engedélyezése
|
||||
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($Username, $Password)
|
||||
|
||||
# Teszt e-mail küldése
|
||||
$MailMessage = New-Object System.Net.Mail.MailMessage
|
||||
$MailMessage.From = "imeszely@icloud.com"
|
||||
$MailMessage.To.Add("istvan@meszely.de")
|
||||
$MailMessage.Subject = "SMTP test"
|
||||
$MailMessage.Body = "Ez egy teszt üzenet SMTP kapcsolat tesztelésére."
|
||||
|
||||
try {
|
||||
$SMTPClient.Send($MailMessage)
|
||||
Write-Host "E-Mail gesendet!"
|
||||
} catch {
|
||||
Write-Host "Fehler : $_"
|
||||
}
|
||||
24
Scripts/powershell/SMTP Tester.ps1
Normal file
24
Scripts/powershell/SMTP Tester.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
$SMTPServer = "smtp.office365.com" # Az SMTP szerver címe
|
||||
$SMTPPort = 587 # SMTP port (általában 587 a TLS-hez)
|
||||
$Username = "Bestellung-Fax-Eingang@aps-hh.de" # SMTP felhasználónév
|
||||
# $Password = "eXBd4zJQyVXicQk" # SMTP jelszó
|
||||
$Password = "YqhlR@H~cH%maNF" # SMTP jelszó
|
||||
|
||||
# SMTP kapcsolat létrehozása
|
||||
$SMTPClient = New-Object Net.Mail.SmtpClient($SMTPServer, $SMTPPort)
|
||||
$SMTPClient.EnableSsl = $true # TLS engedélyezése
|
||||
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($Username, $Password)
|
||||
|
||||
# Teszt e-mail küldése
|
||||
$MailMessage = New-Object System.Net.Mail.MailMessage
|
||||
$MailMessage.From = "Bestellung-Fax-Eingang@aps-hh.de"
|
||||
$MailMessage.To.Add("istvan@meszely.de")
|
||||
$MailMessage.Subject = "SMTP test"
|
||||
$MailMessage.Body = "Ez egy teszt üzenet SMTP kapcsolat tesztelésére."
|
||||
|
||||
try {
|
||||
$SMTPClient.Send($MailMessage)
|
||||
Write-Host "E-Mail gesendet!"
|
||||
} catch {
|
||||
Write-Host "Fehler : $_"
|
||||
}
|
||||
4
Scripts/powershell/SNMP An auf Windows Server.ps1
Normal file
4
Scripts/powershell/SNMP An auf Windows Server.ps1
Normal file
@@ -0,0 +1,4 @@
|
||||
# SNMP An auf Windows Server
|
||||
Install-WindowsFeature -Name "SNMP-Service" -IncludeAllSubFeature -IncludeManagementTools
|
||||
# Firewall für SNMP Dienst öffnen
|
||||
New-NetFirewallRule -Name "SNMP" -DisplayName "Allow SNMP" -Protocol UDP -LocalPort 161 -Action Allow -Direction Inbound -RemoteAddress 10.102.1.59 -Profile Domain
|
||||
11
Scripts/powershell/Test-NetConnections.ps1
Normal file
11
Scripts/powershell/Test-NetConnections.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
Test-NetConnection srv-sharepoint.bhs.local -TraceRoute
|
||||
|
||||
Test-NetConnection -Port 80 srv-sharepoint.bhs.local
|
||||
|
||||
Test-NetConnection srv-sharepoint.bhs.local -DiagnoseRouting -InformationLevel Detailed
|
||||
|
||||
Apotheke:
|
||||
srv001.ham0489.apo.service-pt.de
|
||||
|
||||
Test-NetConnection -DiagnoseRouting -InformationLevel Detailed srv001.ham0489.apo.service-pt.de
|
||||
|
||||
34
Scripts/powershell/WMI Config.ps1
Normal file
34
Scripts/powershell/WMI Config.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
# WMI Config
|
||||
|
||||
netsh firewall set service RemoteAdmin enable
|
||||
|
||||
netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
|
||||
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
|
||||
|
||||
# Connection Testen
|
||||
$strComputer = "Computer_B"
|
||||
$colSettings = Get-WmiObject Win32_OperatingSystem -ComputerName $strComputer
|
||||
|
||||
strComputer = "Computer_B"
|
||||
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colSettings = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
|
||||
|
||||
if ($colSettings) {
|
||||
Write-Host "WMI connection to $strComputer successful."
|
||||
} else {
|
||||
Write-Host "Failed to connect to WMI on $strComputer."
|
||||
}
|
||||
# WMI Test
|
||||
$wmiTest = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $strComputer
|
||||
if ($wmiTest) {
|
||||
Write-Host "WMI Test successful on $strComputer."
|
||||
} else {
|
||||
Write-Host "WMI Test failed on $strComputer."
|
||||
}
|
||||
# WMI Test with CIM
|
||||
$wmiTestCIM = Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName $strComputer
|
||||
if ($wmiTestCIM) {
|
||||
Write-Host "CIM Test successful on $strComputer."
|
||||
} else {
|
||||
Write-Host "CIM Test failed on $strComputer."
|
||||
}
|
||||
5
Scripts/powershell/Wifi-netsh.ps1
Normal file
5
Scripts/powershell/Wifi-netsh.ps1
Normal file
@@ -0,0 +1,5 @@
|
||||
## Wifi
|
||||
# Show wlan Profiles
|
||||
netsh wlan show profiles
|
||||
# Show password von Wlan
|
||||
netsh wlan show profile name="WlanNet" key=clear
|
||||
24
Scripts/powershell/check_sharepoint_401.ps1
Normal file
24
Scripts/powershell/check_sharepoint_401.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
# SharePoint elérhetőség ellenőrzése - 401 válasz a cél
|
||||
$url = "http://srv-sharepoint.bhs.local"
|
||||
|
||||
try {
|
||||
$response = Invoke-WebRequest -Uri $url -UseBasicParsing -ErrorAction Stop
|
||||
$statusCode = $response.StatusCode
|
||||
} catch {
|
||||
# Ha kivétel van, akkor próbáljuk meg kiolvasni a státuszkódot a Response-tárgyból
|
||||
if ($_.Exception.Response) {
|
||||
$statusCode = $_.Exception.Response.StatusCode.Value__
|
||||
} else {
|
||||
Write-Host "2:Unbekannter Fehler: $($_.Exception.Message)"
|
||||
exit 2
|
||||
}
|
||||
}
|
||||
|
||||
if ($statusCode -eq 401) {
|
||||
Write-Host "0:SharePoint online, erwartete Antwort: 401 Unauthorized"
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host "2:Unerwarteter HTTP-Statuscode: $statusCode"
|
||||
exit 2
|
||||
}
|
||||
87
Scripts/powershell/rdp_fehler_log.ps1
Normal file
87
Scripts/powershell/rdp_fehler_log.ps1
Normal file
@@ -0,0 +1,87 @@
|
||||
# $share = "\\aps-mysql01.aps.local\RdpLog\$env:COMPUTERNAME"
|
||||
|
||||
# Megosztott mappa a szerver neve szerint
|
||||
$share = "\\aps-mysql01.aps.local\RdpLog\$env:COMPUTERNAME"
|
||||
if (-not (Test-Path $share)) {
|
||||
New-Item -Path $share -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# Funkció a logok kigyűjtésére
|
||||
function Get-RDPEvents {
|
||||
param (
|
||||
[string]$LogName,
|
||||
[int[]]$EventIDs
|
||||
)
|
||||
|
||||
Get-WinEvent -LogName $LogName |
|
||||
Where-Object { $_.Id -in $EventIDs } |
|
||||
ForEach-Object {
|
||||
$message = $_.Message
|
||||
$sessionID = $null
|
||||
$ursachencode = $null
|
||||
$userName = $null
|
||||
|
||||
# 1️⃣ SessionID és Ursachencode regexből
|
||||
if ($message -match "Sitzung ""?(\d+)""?.*Ursachencode: (\d+)") {
|
||||
$sessionID = [long]$matches[1]
|
||||
$ursachencode = [long]$matches[2]
|
||||
}
|
||||
elseif ($message -match 'Sitzungs-ID:\s*(\d+)') {
|
||||
$sessionID = [long]$matches[1]
|
||||
}
|
||||
|
||||
# 2️⃣ UserName: property[0]-ból
|
||||
if ($_.Properties.Count -ge 1 -and $_.Properties[0].Value -match "\S") {
|
||||
$userName = $_.Properties[0].Value
|
||||
}
|
||||
|
||||
# 3️⃣ Ha nincs property-ben, Message-ből APS\ mintával
|
||||
if (-not $userName -and $message -match '(APS\\[^\s"]+)') {
|
||||
$userName = $matches[1]
|
||||
}
|
||||
|
||||
# 4️⃣ 1149-es Event ID (auth) regex kiegészítés
|
||||
if (-not $userName -and $message -match 'Benutzer:\s*(\S+)') {
|
||||
$userName = $matches[1]
|
||||
}
|
||||
|
||||
[PSCustomObject]@{
|
||||
ServerName = $env:COMPUTERNAME
|
||||
LogName = $LogName
|
||||
EventID = $_.Id
|
||||
SessionID = $sessionID
|
||||
Ursachencode = $ursachencode
|
||||
Level = $_.LevelDisplayName
|
||||
UserName = $userName
|
||||
Message = $message
|
||||
TimeCreated = $_.TimeCreated
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 1️⃣ UserName események (auth / reconnect) — SessionID-vel
|
||||
$userEvents = Get-RDPEvents -LogName "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" -EventIDs 24,25,1149
|
||||
|
||||
# 2️⃣ Disconnect események
|
||||
$disconnectEvents = Get-RDPEvents -LogName "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" -EventIDs 39,40
|
||||
|
||||
# 3️⃣ SessionID alapján hozzárendeljük a UserName-t a disconnect eseményekhez
|
||||
$disconnectEvents | ForEach-Object {
|
||||
$matchingUser = $userEvents | Where-Object { $_.SessionID -eq $_.SessionID } | Sort-Object TimeCreated -Descending | Select-Object -First 1
|
||||
if ($matchingUser) { $_.UserName = $matchingUser.UserName }
|
||||
}
|
||||
|
||||
# 4️⃣ Összesítés más logokkal
|
||||
$remoteEvents = Get-RDPEvents -LogName "Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational" -EventIDs 1006,1026
|
||||
$termDDEvents = Get-RDPEvents -LogName "System" -EventIDs 56 | Where-Object { $_.Message -like "*TermDD*" }
|
||||
$brokerClientEvents = Get-RDPEvents -LogName "Microsoft-Windows-TerminalServices-SessionBroker-Client/Operational" -EventIDs 1000,1001
|
||||
$brokerManagerEvents = Get-RDPEvents -LogName "Microsoft-Windows-TerminalServices-SessionBroker-Manager/Operational" -EventIDs 1000,1001
|
||||
|
||||
# 5️⃣ Összesítés
|
||||
$allEvents = $userEvents + $disconnectEvents + $remoteEvents + $termDDEvents + $brokerClientEvents + $brokerManagerEvents
|
||||
|
||||
# CSV-be mentés
|
||||
$filename = Join-Path $share ("RDP_Log_" + (Get-Date -Format "yyyyMMdd_HHmmss") + ".csv")
|
||||
$allEvents | Export-Csv $filename -NoTypeInformation -Encoding UTF8
|
||||
|
||||
Write-Host "RDP log export kész: $filename"
|
||||
61
Scripts/powershell/rdp_fehler_log_sammlung.ps1
Normal file
61
Scripts/powershell/rdp_fehler_log_sammlung.ps1
Normal file
@@ -0,0 +1,61 @@
|
||||
# MySQL kapcsolati adatok
|
||||
# Install-PackageProvider -Name NuGet -Force
|
||||
# Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2/ -ProviderName NuGet -Trusted
|
||||
# Install-Package MySql.Data -Force
|
||||
# Oder : https://dev.mysql.com/downloads/connector/net/
|
||||
|
||||
$mysqlServer = "localhost" # vagy a szerver IP/cím
|
||||
$mysqlDatabase = "rdp_log" # az adatbázis neve
|
||||
$mysqlUser = "rdplog" # felhasználónév
|
||||
$mysqlPassword = "Test123#" # jelszó
|
||||
|
||||
# Forrás és célmappa
|
||||
$sourceFolder = "C:\RdpLog\Logs" # a mappa, ahol a CSV fájlok vannak
|
||||
$destinationFolder = "C:\RdpLog\Archive" # a mappa, ahova áthelyezzük a feldolgozott fájlokat
|
||||
|
||||
# MySQL kapcsolódás
|
||||
Add-Type -Path "C:\Program Files\PackageManagement\NuGet\Packages\MySql.Data.9.4.0\lib\net9.0\MySql.Data.dll" # cseréld le a valós útvonalra!
|
||||
$connection = New-Object MySql.Data.MySqlClient.MySqlConnection
|
||||
$connection.ConnectionString = "server=$mysqlServer;database=$mysqlDatabase;uid=$mysqlUser;pwd=$mysqlPassword;"
|
||||
$connection.Open()
|
||||
|
||||
# Minden CSV fájl feldolgozása
|
||||
Get-ChildItem -Path $sourceFolder -Filter "*.csv" | ForEach-Object {
|
||||
$csvPath = $_.FullName
|
||||
$csvData = Import-Csv -Path $csvPath -Delimiter "," -Encoding UTF8
|
||||
|
||||
Write-Host "Feldolgozás alatt: $csvPath"
|
||||
|
||||
# Adatok feltöltése az adatbázisba
|
||||
foreach ($row in $csvData) {
|
||||
$query = "INSERT INTO rdplog (ServerName, LogName, EventID, SessionID, Ursachencode, Level, UserName, Message, TimeCreated) VALUES (@ServerName, @LogName, @EventID, @SessionID, @Ursachencode, @Level, @UserName, @Message, @TimeCreated)"
|
||||
|
||||
$command = New-Object MySql.Data.MySqlClient.MySqlCommand($query, $connection)
|
||||
|
||||
# Paraméterek hozzáadása
|
||||
$command.Parameters.AddWithValue("@ServerName", $row.ServerName) | Out-Null
|
||||
$command.Parameters.AddWithValue("@LogName", $row.LogName) | Out-Null
|
||||
$command.Parameters.AddWithValue("@EventID", $row.EventID) | Out-Null
|
||||
$command.Parameters.AddWithValue("@SessionID", $row.SessionID) | Out-Null
|
||||
$command.Parameters.AddWithValue("@Ursachencode", $row.Ursachencode) | Out-Null
|
||||
$command.Parameters.AddWithValue("@Level", $row.Level) | Out-Null
|
||||
$command.Parameters.AddWithValue("@UserName", $row.UserName) | Out-Null
|
||||
$command.Parameters.AddWithValue("@Message", $row.Message) | Out-Null
|
||||
|
||||
# TimeCreated átalakítása (ha szükséges)
|
||||
$timeCreated = [datetime]::ParseExact($row.TimeCreated, "dd.MM.yyyy HH:mm:ss", $null)
|
||||
$command.Parameters.AddWithValue("@TimeCreated", $timeCreated) | Out-Null
|
||||
|
||||
# Lekérdezés végrehajtása
|
||||
$command.ExecuteNonQuery() | Out-Null
|
||||
}
|
||||
|
||||
# Fájl áthelyezése a célmappába
|
||||
Move-Item -Path $csvPath -Destination $destinationFolder -Force
|
||||
Write-Host "Fájl áthelyezve: $csvPath -> $destinationFolder"
|
||||
}
|
||||
|
||||
# Kapcsolat bezárása
|
||||
$connection.Close()
|
||||
|
||||
Write-Host "Minden fájl sikeresen feldolgozva és áthelyezve!"
|
||||
18
Scripts/powershell/snmp_command.ps1
Normal file
18
Scripts/powershell/snmp_command.ps1
Normal file
@@ -0,0 +1,18 @@
|
||||
# Sophos SNMP lekérdezések VPN nevekhez
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.4.3
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.4.4
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.4.5 # Telekom
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.4.6 # Kapelou
|
||||
# Sophos SNMP lekérdezések VPN értékekhez
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.9.3
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.9.4
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.9.5 # Telekom Wert
|
||||
Get-SnmpData -IP 10.102.1.1 -Community prtg -OID 1.3.6.1.4.1.2604.5.1.6.1.1.1.1.9.6 # Kapelou wert
|
||||
|
||||
# Cisco 9200
|
||||
Get-SnmpData -IP 10.102.1.61 -Community prtg -OID 1.3.6.1.2.1.2.2.1.2
|
||||
Get-SnmpData -IP 10.102.1.61 -Community prtg -OID 1.3.6.1.2.1.31.1.1.1.1
|
||||
Get-SnmpData -IP 10.102.1.61 -Community prtg -OID 1.3.6.1.2.1.2.2.1.2.13
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user