Compare commits

...

3 Commits

Author SHA1 Message Date
dea51f0081 neu script 2026-02-05 08:53:36 +01:00
e4dcaf6991 . 2026-02-04 15:44:54 +01:00
479c91394c . 2026-02-04 14:10:19 +01:00
6 changed files with 53 additions and 7 deletions

View File

@@ -14,7 +14,3 @@ https://www.tc-telefon.de/Kontakt/
8. Anrufen Fabio wegen die Donau Drucker Toner lvl 18%
j.berg 1234

View File

@@ -26,3 +26,6 @@ xqol-fwhb-cmnb-vgac
APS-FILE02
User$\p.heinrich\_Scans
IXOS
j.berg - 1234

View File

@@ -16,8 +16,6 @@ This directory contains all the scripts for automation and administration, organ
### `/Dev/`
This directory contains various development projects, such as `network_scann/`, `switch_ip_scann_CSV/`, `switch_ip_scann_DB/` and serves as a collection of configuration files and notes for various system administration tasks.
### `/Doku/`
This directory is used for documentation, data storage, and logs. It contains CSV and text files with user data, printer information, and various logs, organized into subdirectories like `Ai`, `Logs`, and `Pdf`.

View File

@@ -0,0 +1,30 @@
# PowerShell script to list senders of emails from an on-premise Exchange server for the current day.
# Set the start and end times for today
$today = Get-Date -Hour 0 -Minute 0 -Second 0
$tomorrow = (Get-Date).AddDays(1).Date
Write-Host "Searching for emails sent between $($today) and $($tomorrow)..."
try {
# Get message tracking logs for sent emails within today's date range
# Filtering by EventID 'SEND' focuses on emails leaving the server or being sent internally.
# Adjust -ResultSize as needed; 'Unlimited' retrieves all, but can be slow for large environments.
$sentEmails = Get-MessageTrackingLog -Start $today -End $tomorrow -EventId "SEND" -ResultSize Unlimited |
Select-Object -ExpandProperty Sender |
Sort-Object -Unique
if ($sentEmails) {
Write-Host "`nSenders of emails today:`n"
$sentEmails | ForEach-Object {
Write-Host $_
}
Write-Host "`nTotal unique senders: $($sentEmails.Count)"
} else {
Write-Host "`nNo emails sent today found."
}
}
catch {
Write-Error "An error occurred while retrieving message tracking logs: $($_.Exception.Message)"
Write-Error "Please ensure you have the necessary Exchange management tools installed and are running the script with appropriate permissions."
}

View File

@@ -38,7 +38,7 @@ def get_application_permissions(access_token, app_id):
# Erstellt die URL, um den Dienstprinzipal anhand der appId abzufragen und appRoles auszuwählen
url = (f"{GRAPH_API_ENDPOINT}/servicePrincipals?"
f"$filter=appId+eq+'{app_id}'&"
f"$select=displayName,appId,appRoles")
f"$select=displayName,appId,appRoles,requiredResourceAccess")
response = requests.get(url, headers=headers)
response.raise_for_status() # Löst eine Ausnahme für HTTP-Fehler aus
@@ -68,6 +68,23 @@ if __name__ == "__main__":
print(f" Aktiviert: {role.get('isEnabled')}")
else:
print("Keine Anwendungsberechtigungen (appRoles) für diesen Dienstprinzipal gefunden.")
required_resource_access = sp.get('requiredResourceAccess', [])
if required_resource_access:
print("\nKonfigurierte API-Zugriffsberechtigungen (requiredResourceAccess):")
for resource_access in required_resource_access:
resource_app_id = resource_access.get('resourceAppId')
print(f" Resource App ID: {resource_app_id}")
for ra in resource_access.get('resourceAccess', []):
type_of_perm = "Unbekannt"
if ra.get('type') == 'Scope':
type_of_perm = "Delegierte Berechtigung"
elif ra.get('type') == 'Role':
type_of_perm = "Anwendungsberechtigung"
print(f" - Berechtigungs ID: {ra.get('id')} (Typ: {type_of_perm})")
else:
print("Keine konfigurierten API-Zugriffsberechtigungen (requiredResourceAccess) gefunden.")
else:
print("Kein Dienstprinzipal mit der angegebenen Client ID gefunden oder keine Daten zurückgegeben.")

2
youtube.md Normal file
View File

@@ -0,0 +1,2 @@
# WoT
https://www.youtube.com/watch?v=6kn3b5zZnwE