0

I have the Active Directory module installed on my Windows 7 workstation using PowerShell 3 and when I use "Set-Location AD:", it is using my current domain.

Is it possible to set my base location to a different domain?

Import-Module ActiveDirectory
Set-Location AD:
Get-ChildItem

(shows current DC info)

I would like to switch to a different AD server.

kevro
  • 263
  • 5
  • 20

2 Answers2

4

You can try this. Assuming your domain name is fabrikam.local

Import-Module ActiveDirectory
New-PSDrive -Name ADFAB -PSProvider ActiveDirectory -Server "servername.fabrikam.local" -Scope Global -root "//RootDSE/"
Set-Location ADFAB:
ATek
  • 815
  • 2
  • 8
  • 20
0

Just to add a bit to ssaviers's answer...

If you are working with a mounted ntdsutil AD snapshot, just use "localhost:10389" for the server, using whatever port you used when you mounted the snapshot with dsamain.

+1 for the answer though, New-PSDrive was what I needed to be able to restore corrupted permissions on our domain controller objects using Get-ACL and Set-ACL. I thought AdminSDHolder would fix the issue on its own, seeing as Domain Controllers group is a protected group, but even after trying to kick off that process manually we weren't seeing any results.

escuelle
  • 55
  • 1
  • 7