# Get-ADComputer from a different domain

**URL:** <https://forums.powershell.org/t/get-adcomputer-from-a-different-domain/872>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/get-adcomputer-from-a-different-domain/872 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/get-adcomputer-from-a-different-domain/872/1 "2011-12-31T18:30:00Z")

</div>

by jagan at 2013-04-17 16:03:38

> Gurus, I am in Domain A. I want the list of computers from domain B. I looked up online but running out of options.  
>   
> Please Help! I don’t know what i am doing wrong here.

by DonJ at 2013-04-17 16:08:25

> Yeah. Map a drive to the other domain using the ActiveDirectory provider. Then change to that drive when running the command.

by jagan at 2013-04-18 12:04:11

> I did exactly what you said. still same issue. please tell me where am I doing wrong?  
>   
> `Import-Module ActiveDirectory$SearchBase = "CN=ABC,DC=LZREMOTE,DC=com"cd "Z:"get-ADComputer -SearchBase $SearchBase -Filter {Name -like 'LAXDB'} -property * |Sort-Object Name`

by DonJ at 2013-04-18 12:11:19

> It looks like you’re not connecting to a DC in the [LZREMOTE.com](http://LZREMOTE.com) domain. Make sure your drive (it doesn’t need to be a single letter, you can name the drive LZREMOTE: if you want) is pointed to that domain, and you may need to specify (a) explicit credentials and (b) a domain controller to connect to when running the command. Make sure the target domain can talk to the AD cmdlets (you need to point to a DC running the Web service).

by jagan at 2013-04-18 12:44:51

> Don, thanks for the quick reply! Z drive is mapped as a network drive from [LZREMOTE.COM](http://LZREMOTE.COM). i connect using a [LZREMOTE.COM](http://LZREMOTE.COM) user account. in MY Serachbase variable, ABC is the domain controller server name. your last part of the comment  
>   
> "Make sure the target domain can talk to the AD cmdlets (you need to point to a DC running the Web service)." how do i know target domain can talk to AD cmdlets? and yes dc is running the webservice

by DonJ at 2013-04-18 12:50:05

> Ah. No, not a network drive. You can actually map a drive, in PowerShell to Active Directory. Run Get-PSProvider (with the AD module loaded) and you’ll see the provider; you’ll notice you have an AD: drive already to your default domain. I think you can run "help ActiveDirectory" for more.

---

<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:57pm UTC](https://forums.powershell.org/t/get-adcomputer-from-a-different-domain/872/2 "2024-05-16T20:57:51Z")

</div>

Closed on May 16, 2024, 8:57pm UTC


