$users = Get-Content c:\scripts\list.txt
ForEach($userlist in $users)
{
$user = Get-ADUser $userlist
$dn= [ADSI](“LDAP://” + $user)
$acl= $dn.psbase.objectSecurity
if ($acl.get_AreAccessRulesProtected())
{
$isProtected = $false # $false to enable inheritance
# $true to disable inheritance
$preserveInheritance = $true # $true to keep inherited access rules
# $false to remove inherited access rules.
# ignored if isProtected=$false
$acl.SetAccessRuleProtection($isProtected, $preserveInheritance)
$dn.psbase.commitchanges()
Write-Host($user.SamAccountName + "|" + `
$user.DistinguishedName + `
"|inheritance set to enabled")
}
else
{
write-host($user.SamAccountName + "|" + `
$user.DistinguishedName + `
"|inheritance was already enabled - no change")
}
}
Single
Get-ExchangeServer | Format-List Name, Edition, AdminDisplayVersion
Pause powershell script for keyboard press like “pause” in cmd
read-host “Press ENTER to continue...”
The Identity synchronization service detected that the number of deletions exceeded the configured deletion threshold
Enable-ADSyncExportDeletionThreshold
Get-ADSyncExportDeletionThreshold
Disable-ADSyncExportDeletionThreshold
Enable-ADSyncExportDeletionThreshold -DeletionThreshold 500
Get-ADUser -SearchBase "OU=Accounts,OU=RootOU,DC=ChildDomain,DC=RootDomain,DC=com" -Filter *
`n = new line
‘r = carriage return
(Get-Mailbox -resultsize unlimited).count
Set-MailboxMessageConfiguration -Identity USERNAME -ReadReceiptResponse neversend
Set-Mailbox -Identity username -ForwardingAddress $null
Get-Recipient -resultSize unlimited | select name -expand emailAddresses | where {$_.smtpAddress -match ".*scs*"} | Format-Table name, smtpaddress