![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Access a different forest I was interested to find out about accessing my domain's Directory Services through the New-Object System.DirectoryServices.DirectoryEntry method, but how would I access another forest to which I have access permissions? |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Access a different forest It depends on what you want to do. If you just want to access the AD users, computers, etc in a domain inside another forest, you can just use the System.DirectoryServices.DirectoryEntry object specifying the LDAP path for the domain that you want to work with. For example, $Entry = New-Object System.DirectoryServices.DirectoryEntry("LDAP://dc=otherdomain,dc=com") $Entry = New-Object System.DirectoryServices.DirectoryEntry("LDAP://dc=childomain,dc=rootdomain,dc=com") If you want to explore the structure of the other forest, you'll want to use the System.DirectoryServices.ActiveDirectory namespace, starting with $Forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() or $ForestContext = New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext("Forest", "otherdomain.com") $OtherForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetForest($ForestContext) If you need to specify alternate credentials to access the forest, the DirectoryContext constructor allows you to do that also. "sluice" wrote: > > I was interested to find out about accessing my domain's Directory > Services through the New-Object System.DirectoryServices.DirectoryEntry > method, but how would I access another forest to which I have access > permissions? > > > -- > sluice > ------------------------------------------------------------------------ > sluice's Profile: http://vista64.net/forums/member.php?userid=119 > View this thread: http://vista64.net/forums/showthread.php?t=9580 > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| search AD in separate forest | VB Script | |||
| Get username/group membership from another forest? | VB Script | |||
| SCVMM P2V in different forest | Virtual Server | |||
| Trust Between Forest | Virtual Server | |||
| List all DCs in the forest | PowerShell | |||