powershell 此脚本获取Active Directory组的成员

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 此脚本获取Active Directory组的成员相关的知识,希望对你有一定的参考价值。

$GName = "_SeniorManagement"
$Resultsfilename = "c:\temp\results.txt"
$group = Get-ADGroup $GName
$group.Name  ##| Format-List | Out-File -append $Resultsfilename
$member = Get-ADGroupMember $group ##| Format-List | Out-File -append $Resultsfilename
$member.Name | Format-List | Out-File $Resultsfilename
Import-Module ActiveDirectory

$GName = "opwftg sp otp fms project emcoreplacement contributors"
$Resultsfilename = "c:\hp\results.txt"
$group = Get-ADGroup $GName
$group.Name  ##| Format-List | Out-File -append $Resultsfilename
$member = Get-ADGroupMember $group
$GName = "_Branch Managers North"
$Resultsfilename = "c:\temp\GroupResults.txt"
$group = Get-ADGroup $GName
$group.Name
$member = Get-ADGroupMember $group
$group.Name | Out-File $Resultsfilename
foreach($m in $member)
{
    $m.Name
	"@(`"" + $m.Name + "`")," | Out-File $Resultsfilename -append
}

以上是关于powershell 此脚本获取Active Directory组的成员的主要内容,如果未能解决你的问题,请参考以下文章

powershell 用于将Active Directory组添加到Active Directory的Powershell脚本

用于检查 Active Directory 用户是不是上次登录的 Powershell 脚本

用于检查Active Directory用户上次登录的Powershell脚本

如何通过Powershell在域计算机上查询Active Directory而不在客户端计算机上安装RSAT工具

powershell 此powershell脚本使用字段名称获取所有值是sharepoint列表中的字段

powershell 此PowerShell脚本是从SCCM DB获取SCEP日志并将其导出为CSV文件