Skip to content

Commit 7539410

Browse files
author
moebit
committed
[Misc] Hinzufügen neuer Skripte für das Offboarding von JEs
1 parent e51f559 commit 7539410

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# The script is used to remove the je contacts that are used in the configuration of the various BDSU distribution groups like BDS MIT Line.
2+
3+
$Contacts = Get-MailContact -Resultsize unlimited
4+
$FilteredJeContacts = $Contacts | Where-Object {$_.PrimarySmtpAddress -like '*@je-domain.org'}
5+
$FilteredJeContacts | Sort-Object Identity
6+
$FilteredJeContacts | ForEach-Object {
7+
Users | ForEach-Object {
8+
# Before you remove the guest user pls check if everything is correct and than remove the comment
9+
# Remove-MailContact -Identity $_.PrimarySmtpAddress -Confirm:$false
10+
Write-Host "Removed contact" $_.Identity
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# The script is used to remove JE guest accounts that allow access to the BDSU intranet.
2+
3+
$GuestUsers = Get-AzureADUser -Filter "UserType eq 'Guest'" -All $true
4+
$JeUsers = $GuestUsers | Where-Object {$_.mail -like '*@je-domain.org'}
5+
$JeUsers | Sort-Object DisplayName
6+
$JeUsers | ForEach-Object {
7+
# Before you remove the guest user pls check if everything is correct and than remove the comment
8+
# Remove-AzureADUser -ObjectId $_.ObjectId
9+
Write-Host "Removed guest user" $_.DisplayName
10+
}

Misc/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
### [Delete-Mail-Globally.ps1](Delete-Mail-Globally.ps1)
2-
Skript, um eingenangene und nicht gefilterte Phishing-Emails aus allen vorhandenen Postfächern im MS365 Tenant zu entfernen.
2+
Skript, um eingenangene und nicht gefilterte Phishing-Emails aus allen vorhandenen Postfächern im MS365 Tenant zu entfernen.
3+
4+
### [JE-Offboarding](/admin-scripts/Misc/JE-Offboarding/)
5+
Skripte, um eine JE, die nicht mehr Teil des BDSU ist offzuboarden

0 commit comments

Comments
 (0)