# Unable to Export computers from Security group inside OU

**URL:** <https://forums.powershell.org/t/unable-to-export-computers-from-security-group-inside-ou/12941>\
**Category:** PowerShell Help\
**Created:** [July 31, 2019, 2:25am UTC](https://forums.powershell.org/t/unable-to-export-computers-from-security-group-inside-ou/12941 "2019-07-31T02:25:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sugandhakumar](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sugandhakumar](https://forums.powershell.org/u/sugandhakumar)\
**Post date:** [July 31, 2019, 2:25am UTC](https://forums.powershell.org/t/unable-to-export-computers-from-security-group-inside-ou/12941/1 "2019-07-31T02:25:33Z")

</div>

Hi Gents,

I’m trying to export the list of computers from an OU by using below command.

**Get-adcomputer -filter \* -searchbase “_Distinguished Name of the path_” | select name**

I’m able to get the results if there is no security group inside the OU but if there is any security inside OU and if the SG contains the computer objects i don’t get results.

For example,

Domain Name-\>OU-\>Computer = Works

Domain Name-\>OU-\>Secuity Group-\>Computer = Not works

Is how powershell works or do i make any mistake in the above command? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [July 31, 2019, 1:14pm UTC](https://forums.powershell.org/t/unable-to-export-computers-from-security-group-inside-ou/12941/2 "2019-07-31T13:14:53Z")

</div>

> [@](#):
>
> Is how powershell works or do i make any mistake in the above command? Thanks in advance!

This is how the active directory works. 😉 … the actual computer accounts are probably in another OU. But you can add any computer account to a security group. If you like to get the members of this particular group you can use [Get-ADGroupMember](https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adgroupmember?view=win10-ps) oder [Get-ADPrincipalGroupMembership](https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adprincipalgroupmembership?view=win10-ps).

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:31pm UTC](https://forums.powershell.org/t/unable-to-export-computers-from-security-group-inside-ou/12941/3 "2024-05-16T20:31:50Z")

</div>


