Я пытаюсь извлечь список пользователей с PowerShell, я попробовал две вещи:
1) Get-ADGroupmember -identity "group name" | select name | Export-Csv -path H:\test\testcsv.csv
с ошибкой
PS H:\> Get-ADGroupmember -identity "group name" | select name | Export-Csv -path H:\test\testcsv.csv
Get-ADGroupmember : Cannot find an object with identity: 'group name' under: 'DC=oak,DC=leaf,DC=pine,DC=maple'.
At line:1 char:1
+ Get-ADGroupmember -identity "group name" | select name | E ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (group name:ADGroup) [Get-ADGroupMember], ADIdentityNotFoundE
xception
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException,M
icrosoft.ActiveDirectory.Management.Commands.GetADGroupMember
2) dsquery group -name “group name” | dsget group -members > H:\test\testcsv.csv
с ошибкой:
dsget failed:'Target object for this command' is missing.
type dsget /? for help.
Может кто-нибудь помочь с этим?
Спасибо.