0
Powershell noob here。我正在尝试创建一个脚本,它将获取用户列表,网络共享列表,列出用户/共享的有效权限并将其输出到CSV以用于审计目的。Powershell审核有效的Windows共享权限并输出为CSV
我已经成功使用GetPACEffectiveAccess from the PowerShellAccessControl Module on Technet gallery做枚举,但我完全停留在如何将这些数据输出到CSV我想要它。
我的代码非常简单:
$users=gc C:\scripts\users.txt
$shares=gc C:\scripts\shares.txt
foreach ($user in $users) {
foreach ($share in $shares) {
Get-PACEffectiveAccess -Path $share -Principal $user | select-object principal, accessmask, path | Export-Csv C:\scripts\EffectivePermissions\Audit.csv -append -NoTypeInformation}}
因为我不知道该怎么办桌在计算器上(哇我在这个坏)我附上我从获得的输出的屏幕截图我的简单脚本,然后我想得到的输出。
任何帮助,将不胜感激!
感谢