JJ KR
asked on
ACtive Directory security Group
Dear Experts,
I can export and import active directory users using csvde utility. But my Organization wants export and import the security group of ROLES OU Under Test OU.along with members associated with that group. Please find the attaches snap for reference .
20151115_222509.jpg
20151115_222509.jpg
I can export and import active directory users using csvde utility. But my Organization wants export and import the security group of ROLES OU Under Test OU.along with members associated with that group. Please find the attaches snap for reference .
20151115_222509.jpg
20151115_222509.jpg
Just use powershell for this. See below..
The script above will get all of the groups in the OU and show all of the members for each group it finds.
Will.
Get-ADGroup -Filter * -searchbase "ou=roles,ou=test,dc=cb,dc=gov.dc=qa" |
Get-ADGroupMember |
Select @{n=GroupName';e={ (get-adgroup -identity $_) } }, Name
The script above will get all of the groups in the OU and show all of the members for each group it finds.
Will.
ASKER
Hi,
Thanks for the comments i git this error while executing
PS C:\> Get-ADGroupMember -identity "ADMIN" | select name | Export-csv -path C:\Output\Groupmembers.csv
The term 'Get-ADGroupMember' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:18
+ Get-ADGroupMember <<<< -identity "ADMIN" | select name | Export-csv -path C:\Output\Groupmembers.csv
+ CategoryInfo : ObjectNotFound: (Get-ADGroupMember:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Thanks for the comments i git this error while executing
PS C:\> Get-ADGroupMember -identity "ADMIN" | select name | Export-csv -path C:\Output\Groupmembers.csv
The term 'Get-ADGroupMember' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:18
+ Get-ADGroupMember <<<< -identity "ADMIN" | select name | Export-csv -path C:\Output\Groupmembers.csv
+ CategoryInfo : ObjectNotFound: (Get-ADGroupMember:String)
+ FullyQualifiedErrorId : CommandNotFoundException
Go on Domain Controler and run powershell with modules
Or run powershell and run this command first:
Import-Module ActiveDirectory
Import-Module ActiveDirectory
Yes you need to have the activedirectory module imported first before running the script.
Will.
Will.
ASKER
Thanks Benjamin Voglar and thanks wills I will test and let you know.
ASKER
HI Benjamin Voglar,
I ran the command as instructed by you and the csv file generated without any records. Output.csv 0KB
PS C:\Users\Administrator> Get-ADGroupMember -identity "ADMIN" | select name | Export-csv -path C:\Output\Groupmembers.
I ran the command as instructed by you and the csv file generated without any records. Output.csv 0KB
PS C:\Users\Administrator> Get-ADGroupMember -identity "ADMIN" | select name | Export-csv -path C:\Output\Groupmembers.
ASKER
Dear Will Szymkowski,
I ran the command as per your instruction but no results.
PS C:\Users\Administrator> Import-Module ActiveDirectory
PS C:\Users\Administrator> Get-ADGroup -Filter * -searchbase "ou=roles,ou=test,dc=cb,dc =gov.dc=qa " |
>>
I ran the command as per your instruction but no results.
PS C:\Users\Administrator> Import-Module ActiveDirectory
PS C:\Users\Administrator> Get-ADGroup -Filter * -searchbase "ou=roles,ou=test,dc=cb,dc
>>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi , I ran this script
Get-ADGroup -Filter * -searchbase "ou=roles,ou=test,dc=cb,dc =gov.dc=qa " |
Get-ADGroupMember |
Select @{n=GroupName';C={ (get-adgroup -identity $_) } }, Name
And getting this error
The string starting:
At C:\Users\Administrator\Des ktop\scrip t.ps1:3 char:21
+ Select @{n=GroupName <<<< ';C={ (get-adgroup -identity $_) } }, Name
is missing the terminator: '.
At C:\Users\Administrator\Des ktop\scrip t.ps1:5 char:1
+ <<<<
+ CategoryInfo : ParserError: (;C={ (get-adgro... } }, Name
:String) [], ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfS tring
Get-ADGroup -Filter * -searchbase "ou=roles,ou=test,dc=cb,dc
Get-ADGroupMember |
Select @{n=GroupName';C={ (get-adgroup -identity $_) } }, Name
And getting this error
The string starting:
At C:\Users\Administrator\Des
+ Select @{n=GroupName <<<< ';C={ (get-adgroup -identity $_) } }, Name
is missing the terminator: '.
At C:\Users\Administrator\Des
+ <<<<
+ CategoryInfo : ParserError: (;C={ (get-adgro... } }, Name
:String) [], ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfS
Get-ADGroupMember -identity “Name of Group” | select name | Export-csv -path C:\Output\Groupmembers.csv