使用powershll域账号操作继续权限

在将Exchange从2007升级到2013的过程中,部分用户因权限未正确继承而遇到连接问题。本文介绍如何使用PowerShell批量检查和修正用户权限,确保所有账户的权限继承正常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用powershll域账号操作继承权限

前言:
在一次迁移Exchange 2007 至Exchange 2013时候碰到了坑,迁移过程中并没出现问题,完成后,发现某些用户使用手机客户端无法连接,后来查找各种原因,发现是用户账号迁移完成后,权限没有继承,知道了问题,但对于企业有2000多个账号怎样检查。后来查询了资料,可以使用powershell命令更正并导出CSV

$Containers = @()
$UserStatuses = @()

"Reading OU List ..."
$Containers = Get-ADOrganizationalUnit -Filter * -Properties * | sort canonicalname | select distinguishedname, canonicalname

"Reading Container List ..."
$Containers += Get-ADObject -SearchBase (Get-ADDomain).distinguishedname -SearchScope OneLevel -LDAPFilter '(objectClass=container)' -Properties * | sort canonicalname | select distinguishedname, canonicalname

foreach($Cntr in $Containers)
{
    "Evaluating - " + $Cntr.distinguishedname + " ..."
    
    $UserStatuses += Get-ADUser -Filter * -SearchBase $Cntr.distinguishedname -SearchScope OneLevel -Properties * | where {($_.nTSecurityDescriptor.AreAccessRulesProtected -eq $true) -and ($_.enabled -eq $true)} | select @{n='OU';e={$Cntr.distinguishedname}}, displayname, userprincipalname,samAccountName, @{n='Inheritance Broken';e={$_.nTSecurityDescriptor.AreAccessRulesProtected}}
}

$UserStatuses | export-csv -path UsersWithInheritanceBroken.csv
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值