一品网
  • 首页

powershell 将AD 导出得文件经过处理后 按行导出到CSV


点击查看代码
$logpath= "C:\LocalTemp\AdGroupInfo.csv"
Add-Content -Path $logpath "GroupName,CanonicalName,MemberOf.Count,Member.Count"

$b=Get-ADGroup -Filter * -Properties  *

$b|ForEach-Object  {

 if($_.Member.Count -eq 0 -and $_.MemberOf.Count -eq 0)
 {
 $str=$_.CN+','+$_.CanonicalName+','+$_.MemberOf.Count+','+$_.Member.Count
Add-Content -Path $logpath  $str
 }

} 
powershell

相关


linux版powershell中,tab补全,linux外部命令参数名,的模块介绍

Windows Terminal (Preview)治好了cmd,powershell的癌症

走进winrm ---powershell远程连接的4个安全级别,详解

linux版powershell安装教程(.net core版)

powershell读写磁盘变量(对象序列化)

powershell玩转SQL SERVER所有版本

Powershell编程基础-003-脚本的绝对路径及所在的目录

powershell中使用Get-FileHash计算文件的hash值

Windows Powershell – “Running scripts is disabled on this system”

powershell 自定义快捷键F7搜索弹窗展示历史记录

powershell 自定义tab键下拉菜单智能提示

如何去除PowerShell 更新提示

标签

一品网 冀ICP备14022925号-6