导出特定的Active Directory组

时间:2015-07-01 19:05:27

标签: powershell active-directory

Get-ADGroupMember -Id $Group |
  select @{Expression={$Group};Label="Group Name"}, Name |
  Export-Csv C:\Srptupd\Groupmembers.csv -NoTypeInformation -Append

我想尝试导出的群组名称称为" IT员工"。

每次运行命令时,都会收到此错误:

Get-ADGroupMember : Cannot validate argument on parameter 'Identity'. The argument is null or empty. Provide an argument that is not null or empty, and then try the 
command again.
At line:3 char:23
+ Get-ADGroupMember -Id $Group | select  @{Expression={$Group};Label="Group Name"} ...
+                       ~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-ADGroupMember], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ActiveDirectory.Management.Commands.GetADGroupMember

0 个答案:

没有答案