Compare commits
3 Commits
758f9e8405
...
dea51f0081
| Author | SHA1 | Date | |
|---|---|---|---|
| dea51f0081 | |||
| e4dcaf6991 | |||
| 479c91394c |
@@ -14,7 +14,3 @@ https://www.tc-telefon.de/Kontakt/
|
||||
|
||||
8. Anrufen Fabio wegen die Donau Drucker Toner lvl 18%
|
||||
|
||||
|
||||
|
||||
j.berg 1234
|
||||
|
||||
|
||||
@@ -26,3 +26,6 @@ xqol-fwhb-cmnb-vgac
|
||||
|
||||
APS-FILE02
|
||||
User$\p.heinrich\_Scans
|
||||
|
||||
IXOS
|
||||
j.berg - 1234
|
||||
|
||||
@@ -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`.
|
||||
|
||||
|
||||
30
Scripts/powershell/get_daily_email_senders.ps1
Normal file
30
Scripts/powershell/get_daily_email_senders.ps1
Normal 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."
|
||||
}
|
||||
@@ -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
2
youtube.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# WoT
|
||||
https://www.youtube.com/watch?v=6kn3b5zZnwE
|
||||
Reference in New Issue
Block a user