首页 > 其他 > 详细

将组策略中的内容导出至CSV格式

时间:2015-05-08 17:51:03      阅读:300      评论:0      收藏:0      [点我收藏+]
#将组策略首选项中的"本地用户和组"下的所有条目导出
$xml = Get-GPOReport -ReportType Xml -Name "China Desktop Policy"
$report = New-Item -ItemType file -Path C:\Toolkits\GPOAdminRight.CSV -Force
Add-Content -Path $report -Value "Name,EmpNo,Computer,Description"
$e = ($xml.gpo.computer.ExtensionData | where name -EQ ‘local users and groups‘).Extension.LocalUsersAndGroups
$e.Group | foreach {
    $_.name + "," + $_.properties.members.member.name + "," + $_.filters.filtercomputer.name + "," + $_.desc
} | Out-File -FilePath $report -Append -Encoding ascii

 

将组策略中的内容导出至CSV格式

原文:http://www.cnblogs.com/IvanChen/p/4488282.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!