From 373b157cb44fceff0e0f6850fcbe97de4afc2470 Mon Sep 17 00:00:00 2001 From: Christian Pohle Date: Sat, 22 Aug 2020 17:45:37 +0200 Subject: [PATCH] Diverse --- Apple/MacOS/Connect_Shares.scpt | 5 +++ Microsoft/Exchange/FindInvalidObjects.ps1 | 9 +++++ Microsoft/Windows/DeleteProfile.cmd | 47 +++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 Apple/MacOS/Connect_Shares.scpt create mode 100644 Microsoft/Exchange/FindInvalidObjects.ps1 create mode 100644 Microsoft/Windows/DeleteProfile.cmd diff --git a/Apple/MacOS/Connect_Shares.scpt b/Apple/MacOS/Connect_Shares.scpt new file mode 100644 index 0000000..5d351b7 --- /dev/null +++ b/Apple/MacOS/Connect_Shares.scpt @@ -0,0 +1,5 @@ +tell application "Finder" + try + mount volume "smb://ds-pohle.local/consulting" + end try + end tell \ No newline at end of file diff --git a/Microsoft/Exchange/FindInvalidObjects.ps1 b/Microsoft/Exchange/FindInvalidObjects.ps1 new file mode 100644 index 0000000..f7fbd97 --- /dev/null +++ b/Microsoft/Exchange/FindInvalidObjects.ps1 @@ -0,0 +1,9 @@ +# Find invalid Objects in Exchange + +Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; + +Get-Mailbox -ResultSize Unlimited | findstr "Warning" +Get-Contact -ResultSize Unlimited | findstr "Warning" +Get-DistributionGroup -ResultSize Unlimited | findstr "Warning" +Get-DynamicDistributionGroup -ResultSize Unlimited | findstr "Warning" +Get-PublicFolder -ResultSize Unlimited -Recurse | findstr "Warning" \ No newline at end of file diff --git a/Microsoft/Windows/DeleteProfile.cmd b/Microsoft/Windows/DeleteProfile.cmd new file mode 100644 index 0000000..38530d5 --- /dev/null +++ b/Microsoft/Windows/DeleteProfile.cmd @@ -0,0 +1,47 @@ +@echo off +rem : DeleteProfile.cmd - Löschen eines Benutzerprofils auf einer Windows 10 Station +rem : Christian Pohle, verwendet DelProf2 von Helge Klein https://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool/ + +rem : v1.0 22.8.2020 - Erste VErsion + +rem : Outfit + title Delete Profile + color 17 + +rem : Change to actual Dir + cd /d %0\..\ + +rem : Check Parameters + IF [%1] == [] GOTO GetParms + IF [%2] == [] GOTO GetParms + set PCNAME==%1 + set USERNAME==%2 + goto RunIT + +:GetParms +rem : Get Command Line Parameters + echo. + echo Aufruf + echo DeleteProfile PCNAME USERNAME + echo. + echo oder geben Sie die Daten jetzt hier ein: + echo. + set /p PCNAME="Name des PC auf dem das Profil geloescht werden soll? " + set /p USERNAME="Logon Name des Benutzer, dessen Profil geloescht werden soll? " + goto RunIT + +:RunIT +rem : Start Remote Registry Service + sc \\%PCNAME% config RemoteRegistry start=demand + sc \\%PCNAME% start RemoteRegistry + +rem : Delete Profile + DelProf2 /c:%PCNAME% /id:%USERNAME% + +rem : Stop Remote Registry Service + sc \\%PCNAME% stop RemoteRegistry + sc \\%PCNAME% config RemoteRegistry start=disabled + + GOTO End + +:End