From 0da10cf3486c6fece5f8f8428169205ff4e3325b Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Fri, 11 Apr 2025 09:32:00 +0200 Subject: [PATCH] new cheats --- cheats/ad | 3 +++ cheats/exchange | 9 ++++++++- cheats/windows | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cheats/ad b/cheats/ad index 0c5fbd5..b49cec4 100644 --- a/cheats/ad +++ b/cheats/ad @@ -21,3 +21,6 @@ # check CRL `certutil -URL "http://ca.contoso.com/CertEnroll/contoso ca01.crl"` + +# copy group members to another group +`Get-ADGroupMember -Identity "Group1" | % {Add-ADGroupMember -Identity "Group2" -Members $_.distinguishedName}` diff --git a/cheats/exchange b/cheats/exchange index 5d3fd43..8bb498a 100644 --- a/cheats/exchange +++ b/cheats/exchange @@ -1,3 +1,6 @@ +# Use global catalog +`Set-ADServerSettings -ViewEntireForest $True` + # Restore deleted resource ## Find mailbox ID `Get-MailboxDatabase | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {($_.DisplayName -eq "Room 01.03") -and ($_.DisconnectReason -eq "SoftDeleted" -or "Disabled")} | Format-List DisplayName,DisconnectReason,DisconnectDate,MailboxGuid` @@ -14,7 +17,11 @@ `Add-MailboxFolderPermission -Identity Maintenance@contoso.com:\Calendar -User gordon.freeman@contoso.com -AccessRights Editor` # get mailbox folder statistics -`Get-MailboxFolderStatistics gemma.odena@auma.com | Select Name,FolderSize,ItemsinFolder` +`Get-MailboxFolderStatistics -Identity FreemanG | select name,foldersize,itemsinfolder | sort-object -Property foldersize | ft` # grant sendas on shared mailbox to cloud user (hybrid) `Set-Mailbox -Identity shared_box@contoso.com -GrantSendonBehalfTo user.name@contoso.com` + +# disable auto mapping of inbox FreemanG but grant permissions to ArchiveStoreAccount +`Add-MailboxPermission -Identity "FreemanG" -User ArchiveStoreAccount -AccessRights FullAccess -AutoMapping $false` +`Add-AdPermission -Identity "Freeman, Gordon" -User CONTOSO-Datasystem -AccessRights ExtendedRight -ExtendedRights "Send As"` diff --git a/cheats/windows b/cheats/windows index 381f33d..d99bae4 100644 --- a/cheats/windows +++ b/cheats/windows @@ -4,3 +4,6 @@ # update computer account group membership (without reboot) `klist -lh 0 -li 0x3e7 purge` `gpupdate` + +# install "ad users and computers" +`Add-WindowsCapability -online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0`