none
Command to display current default containers? RRS feed

  • Question

  • I found redirusr and redircmp command to make changes, but is there a command that will list what the current state is for default locations without making any changes?
    Friday, April 27, 2012 3:16 AM

Answers

All replies

  • I'm sure this isn't the best way, but you're looking for a container that is NOT a criticalsystemobject.  by default "computers" is.  Run this PS script for a list of containers and OUs that ARE criticalsystemobjects.  I've hacked out some that I know to be false positives.

    $x = Get-ADObject -Filter {isCriticalSystemObject -eq $true} | Where {($_.objectclass -eq 'container' -or $_.objectclass -eq 'organizationalUnit') -and (-not ($_.DistinguishedName -like '*ForeignSecurityPrincipals,DC*')) -and (-not ($_.DistinguishedName -like '*CN=System,DC*')) -and (-not ($_.DistinguishedName -like '*Domain Controllers,DC*')) -and (-not ($_.DistinguishedName -like '*ForeignSecurityPrincipals*'))} 
    $x | ft *dname



    Mike Crowley | MVP
    My Blog -- Planet Technologies

    • Proposed as answer by Mike Crowley Friday, April 27, 2012 4:57 AM
    • Unproposed as answer by MyGposts Friday, April 27, 2012 5:01 AM
    • Marked as answer by Rick TanModerator Tuesday, May 8, 2012 2:31 AM
    Friday, April 27, 2012 4:30 AM
  • Friday, April 27, 2012 5:05 AM
  • This is not what I'm looking for.  I would need to see the current settings even if they are set for the default containers.  Looking for a native command rather than a script if possible.  I was thinking maybe there is a command like redirusr with a switch that listed what was already set rather than changing it to something different.
    Friday, April 27, 2012 5:05 AM
  • There isn't a native command.  My powershell example does what you need (note my picture, it returned the current default containers), why would you be opposed to running 2 lines of code anyway?


    Mike Crowley | MVP
    My Blog -- Planet Technologies

    Friday, April 27, 2012 5:07 AM
  • Hi,

    Thank you for the post.

    Agree with Mike, there is no redirusr switch to display the current default containers.
    http://technet.microsoft.com/en-us/library/cc771655(WS.10).aspx
    http://support.microsoft.com/kb/555573

    If there are more inquiries on this issue, please feel free to let us know.

    Regards


    Rick Tan

    TechNet Community Support

    Monday, April 30, 2012 2:01 AM
    Moderator
  • recently found this:

    Get-ADDomain | Select UsersContainer, SystemsContainer



    Mike Crowley | MVP
    My Blog -- Planet Technologies

    • Proposed as answer by Mike Crowley Tuesday, June 18, 2013 8:44 PM
    Tuesday, June 18, 2013 8:44 PM
  • I would say the most accurate way to do this is to read the "WellKnownObjects" attribute of the domain NC head: http://msdn.microsoft.com/en-us/library/cc223663.aspx

    Sample (as you can see I've choosen to redirect the default computers location to an OU:)
    <dir>
    <dir>

    wellKnownObjects (11): B:32:AA312825768811D1ADED00C04FD8D5CD:OU=Staging Computers,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:6227F0AF1FC2410D8E3BB10615BB5B0F:CN=NTDS Quotas,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:F4BE92A4C777485E878E9421D53087DB:CN=Microsoft,CN=Program Data,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:09460C08AE1E4A4EA0F64AEE7DAA1E5A:CN=Program Data,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:22B70C67D56E4EFB91E9300FCA3DC1AA:CN=ForeignSecurityPrincipals,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:18E2EA80684F11D2B9AA00C04F79F805:CN=Deleted Objects,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:2FBAC1870ADE11D297C400C04FD8D5CD:CN=Infrastructure,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:AB8153B7768811D1ADED00C04FD8D5CD:CN=LostAndFound,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:AB1D30F3768811D1ADED00C04FD8D5CD:CN=System,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:A361B2FFFFD211D1AA4B00C04FD7D83A:OU=Domain Controllers,DC=eur,DC=corp,DC=chrisse,DC=com; B:32:A9D1CA15768811D1ADED00C04FD8D5CD:CN=Users,DC=eur,DC=corp,DC=chrisse,DC=com;

    </dir>
    </dir>


    Enfo Zipper
    Christoffer Andersson – Principal Advisor
    http://blogs.chrisse.se - Directory Services Blog

    Tuesday, June 18, 2013 8:57 PM