index int64 0 4.08k | text stringlengths 34 4.9k ⌀ | url stringclasses 38
values |
|---|---|---|
596 | Set-ADObject "cn=NTDS Quotas,<PartitionDN>"↵
-Replace @{"msDS-DefaultQuota"="<QuotaValue>"}
Discussion
The easiest way to apply a default quota to all of your users is to modify the msDSDefaultQuota attribute on the NTDS Quotas container for the target partition. This
attribute contains the default quota limit that i... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
597 | Using PowerShell
Alternatively, view the msDs-TopQuotaUsage attribute on a partition’s cn=NTDS Quo
tas container, which contains the users with the top quota usage. This attribute is mul‐
tivalued, with each value being XML-like text that contains the SID and how much of
the quota the principal has used. To view the qu... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
598 | </MS_DS_TOP_QUOTA_USAGE>
,
<MS_DS_TOP_QUOTA_USAGE>
<partitionDN> dc=adatum,dc=com </partitionDN>
<ownerSID> S-1-5-32-544 </ownerSID>
<quotaUsed> 21 </quotaUsed>
<deletedCount> 0 </deletedCount>
<liveCount> 21 </liveCount>
</MS_DS_TOP_QUOTA_USAGE>
...}
Name : NTDS Quotas
ObjectClass : msDS-QuotaContainer
Objec... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
599 | null | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
600 | CHAPTER 16
Backup, Recovery, DIT Maintenance, and
Deleted Objects
16.0. Introduction
The AD Directory Information Tree (DIT) is implemented as a transactional database
using the Extensible Storage Engine (ESE). The primary database file is named ntds.dit
and is stored in the %SystemRoot%\NTDS folder by default, but it ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
601 | simply to perform backups. Restoring Active Directory is also a relatively simple pro‐
cess. You can restore a single object, an entire subtree, or the entire database if necessary.
For a detailed discussion on backing up and restoring Active Directory, see Active Di‐
rectory, Fifth Edition, by Brian Desmond et al. (O’... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
602 | • File Replication
• Kerberos Key Distribution Center
• Intersite Messaging
• DNS Server (on DCs that are running the DNS Server service)
• DFS Replication
After a period of time known as the tombstone lifetime (180 days is the default for
Windows Server 2012), the tombstone object is finally removed from Active Direct... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
603 | Table 16-1. Useful attributes of deleted objects
Attribute Description
isDeleted The value for this attribute is TRUE for deleted objects.
isRecycled The value for this attribute is TRUE for deleted objects that have had their deleted object lifetime
expire.
lastKnownParent Distinguished name of container the object wa... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
604 | $wbTarget = New-WBBackupTarget -VolumePath E:
Add-WBBackupTarget -Policy $wbPolicy -Target $wbTarget
Start-WBBackup -Policy $wbPolicy
Discussion
The wbadmin command can be used to create a System State backup of the Active Di‐
rectory database. In addition, there is a Windows Server Backup GUI tool that can be
used to ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
605 | See Also
Recipe 16.3 for more on mounting and using snapshots
16.3. Mounting an Active Directory Snapshot
Problem
You want to mount a snapshot of the Active Directory database that you created pre‐
viously using either ntdsutil or a System State backup.
Solution
Using a command-line interface
If you want to view a snap... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
606 | accessed in a read-only manner using Active Directory tools such as LDP or ADSI Edit,
as well as scripts and PowerShell.
See Also
Recipe 16.2 for more on creating snapshots; Recipe 16.4 for more on accessing and
manipulating information contained in a snapshot
16.4. Accessing Active Directory Snapshot Data
Problem
You ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
607 | See Also
Recipe 16.3 for more on mounting and using snapshots; “Active Directory Explorer
v1.14” (another tool for working with snapshots)
16.5. Restarting a Domain Controller in Directory Services
Repair Mode
Problem
You want to restart a domain controller in DS Repair Mode.
Solution
To enter DS Repair Mode, press F8 ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
608 | Using a graphical user interface
1. Run msconfig.exe and then select the Boot tab.
2. Place a checkmark in the Safe Boot option and then select the Active Directory
repair option.
3. Click OK. You will be prompted to restart the server.
Using the command-line interface
You can also enable DSRM prior to rebooting a serv... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
609 | 16.6. Resetting the Directory Services Repair Mode
Administrator Password
Problem
You want to reset the DS Repair Mode administrator password. This password is set
individually (i.e., not replicated) on each domain controller and is initially configured
when you promote a server to a domain controller.
Solution
Using a... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
610 | Get-ADDomainController -Filter * | ForEach-Object {Invoke-Command↵
-ComputerName $_.Name -ScriptBlock {ntdsutil "set dsrm password"↵
"sync from domain account Administrator" "Q" "Q"}}
See Also
TechNet Article cc754363, “set DSRM password” for resetting the DSRM password on
a domain controller
16.7. Performing a Nonau... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
611 | replicate any changes that have occurred since the backup was taken. This method is
generally the fastest for restoring a domain controller, particularly if the server is the
only DC located in a remote site.
For a detailed discussion of the advantages and disadvantages of each option, see Active
Directory, Fifth Editi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
612 | > auth restore
> restore subtree ou=Sales,dc=adatum,dc=com
> q
Restart the computer.
There are some issues related to restoring user, group, computer, and trust objects that
you should be aware of. See MS KB 216243 and MS KB 280079 for more information.
Using PowerShell
Get-ADObject -Filter {isDeleted -eq $true} -Inclu... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
613 | Using PowerShell
If the Active Directory Recycle Bin is not enabled, then the PowerShell solution will
restore the object without the link-valued and some of the non-link-valued attributes.
However, if the Active Directory Recycle Bin was enabled prior to the object deletion,
then the PowerShell solution will restore t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
614 | should still test the authoritative restore process in a lab environment and make sure
that you have the steps properly documented in case you ever do need to use it.
See Also
Recipe 16.5 for getting into Directory Services Repair Mode; MB KB 216243 (Author‐
itative Restore of Active Directory and Impact on Trusts and ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
615 | the tables are in a consistent state. It reads every byte of the database and can take quite
a while to complete, depending on how large the DIT file is.
Whereas the ntdsutil integrity command verifies the overall structure and health
of the database files, the ntdsutil semantics command looks at the contents of the
da... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
616 | You may also want to consider running an integrity check against the database after
you’ve moved it to ensure that nothing went wrong during the move. See Recipe 16.10
for more details.
See Also
Recipe 16.5 for booting into Directory Services Repair Mode; Recipe 16.10 for checking
DIT file integrity
16.12. Repairing or... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
617 | We recommend that you use extreme caution when performing a repair and you may
wish to engage Microsoft Support first in case something goes wrong. If you try the
repair, and it makes things worse, you should consider rebuilding the domain controller
from scratch. See Recipe 3.10 for forcibly removing a failed domain c... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
618 | Using a command-line interface
Create an LDIF file called online_defrag.ldf with the following contents:
dn:
changetype: modify
replace:DoOnlineDefrag
DoOnlineDefrag: 180
-
Then run the following command:
> ldifde -v -i -f online_defrag.ldf
You can also perform an online defrag using AdMod:
> admod -b "" doOnlineDefrag... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
619 | Solution
Using a command-line interface
This recipe can be performed while the Active Directory Domain Services service is in
a stopped state; it is not necessary to reboot the DC into DSRM. Once the service is
stopped, to perform an integrity check of the Active Directory database, enter the fol‐
lowing:
> esentutl /g... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
620 | 16.15. Creating a Reserve File
Problem
You want to create another reserve file on the disk containing the ntds.dit file to guard
against AD failures caused by running out of disk space.
Solution
Using a command-line interface
The following command will create an empty reserve file, 250 MB in size, in the same
directory... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
621 | 16.16. Determining How Much Whitespace Is in the DIT
Problem
You want to find the amount of whitespace in your DIT. A lot of whitespace in the DIT
may mean that you could regain enough space on the disk to warrant performing an
offline defrag.
Solution
Using a graphical user interface
1. Run regedit.exe from the comman... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
622 | Free hard disk space (megabytes): 100
Total allocated hard disk space (megabytes): 1024
This shows that domain controller Dc1 has a 1 GB DIT file with 100 MB that is free (i.e.,
whitespace).
See Also
Recipe 16.17 for performing an offline defrag
16.17. Performing an Offline Defrag to Reclaim Space
Problem
You want to p... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
623 | 5. Repeat the steps in Recipe 16.10 to ensure that the new DIT file is not corrupted.
If it is clean, reboot into normal mode and monitor the event log. If no errors are
reported in the event log, make sure the domain controller is backed up as soon as
possible.
Discussion
Performing an offline defragmentation of your ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
624 | 4. Edit the garbageColPeriod attribute and set it to the interval in hours that the
garbage collection process should run (the default is 12 hours).
5. Click OK.
Using a command-line interface
Create an LDIF file called change_garbage_period.ldf with the following contents:
dn: cn=Directory Service,cn=Windows NT,cn=Ser... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
625 | See Also
Recipe 16.19 for logging the number of tombstones that get garbage-collected;
Recipe 16.24 for modifying the tombstone lifetime; MS KB 198793 (The Active Direc‐
tory Database Garbage Collection Process)
16.19. Logging the Number of Expired Tombstone Objects
Problem
You want to log the number of expired tombsto... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
626 | User: NT AUTHORITY\ANONYMOUS LOGON
Computer: DC1
Description:
Internal event: Finished removing deleted objects that have expired (garbage
collection). Number of expired deleted objects that have been removed: 229.
See Also
Recipe 15.1 for more on diagnostics logging; Recipe 16.18 for more on the garbage
collection pro... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
627 | size of your DIT, you can quickly recognize if it spikes dramatically, perhaps due to a
new application that is writing data to the directory.
If you find that you are running out of disk space, you have a couple of options. You
could move the Active Directory files to a new drive with more capacity. Alternatively,
you... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
628 | Discussion
When an object is deleted in Active Directory, it is not really deleted, at least not im‐
mediately. The object is renamed, most of its attributes are cleared, and it is moved to
the Deleted Objects container within the naming context that it was deleted from. See
this chapter’s Recipe 16.0 for more on tombs... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
629 | Using Windows PowerShell
To restore all deleted user objects, run the following PowerShell command:
Get-ADObject -Filter {(isDeleted -eq $true) -and (ObjectClass -eq "user") -and↵
(ObjectClass -ne "computer")} -IncludeDeletedObjects | Restore-ADObject
The filter option can be expanded to reduce the number of objects r... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
630 | Performing an authoritative restore of user or group objects will require
additional considerations, as detailed in MS KB 280079 (Authoritative
Restore of Groups Can Result in Inconsistent Membership Information
Across Domain Controllers).
Using a command-line interface
> adfind -default -rb "cn=Deleted Objects" -f "(n... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
631 | 3. Right-click on cn=Directory Service and select Properties.
4. Set the tombstoneLifetime attribute to the number of days that tombstone objects
should remain in Active Directory before getting removed completely.
5. Click OK.
Using a command-line interface
Create an LDIF file called change_tombstone_lifetime.ldf with... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
632 | CHAPTER 17
Application Partitions
17.0. Introduction
Active Directory domain controllers, when first installed, host three predefined parti‐
tions. The Configuration naming context is replicated to all domain controllers in the
forest, and it contains information that is needed forest-wide, such as the site topology
an... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
633 | objects: a domainDNS object and a crossRef object that resides under the Partitions
container in the Configuration naming context (CNC). Application partitions have a
similar naming convention as domains and can be named virtually anything you want.
You can create an application partition that uses the current namespac... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
634 | Solution
Using a command-line interface
Use the following command to create an application partition on a domain controller:
> ntdsutil
> activate instance ntds
> partition management
> connections
> connect to server <DomainControllerName>
> quit
> create nc <AppPartitionDN> NULL
> quit
> quit
Use the following comman... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
635 | Solution
Using a graphical user interface
1. Open LDP.
2. From the menu, select Connection→Connect.
3. Click OK to connect to the closest domain controller over port 389.
4. From the menu, select Connection→Bind.
5. Click OK to bind as the currently logged on user or select the option to bind with
credentials, enter th... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
636 | Discussion
To get the list of application partitions in this recipe’s solution, we queried all cross
Ref objects in the Partitions container that have the systemFlags attribute with the
bits 0 and 2 set (5 in decimal). To do this, a logical AND bitwise filter was used. See
Recipe 4.12 for more on searching with a bitwi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
637 | 6. In the “Value to add” field, enter the following:
cn=NTDS Settings,cn=<DCName>,cn=Servers,cn=Default-First-Site-Name,↵
cn=Sites,cn=Configuration,<ForestDN>
7. Click Add, and then OK twice.
To remove a replica server from an application partition, follow these steps:
1. Open ADSI Edit.
2. If necessary, connect to the... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
638 | Using PowerShell
The following command will add DC2 to the list of replica locations for app1.ada‐
tum.com, while leaving the rest of the list intact:
Get-ADObject -SearchBase "cn=Partitions,cn=Configuration,dc=adatum,dc=com"↵
-Filter {dnsroot -eq "app1.adatum.com"} | Set-ADObject↵
-Add @{"msDS-NC-Replica-Locations"=... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
639 | Solution
Using a graphical user interface
1. Open ADSI Edit.
2. Connect to the Configuration naming context of the forest the application partition
is in, if it is not already present in the left pane.
3. Expand the Configuration naming context and click on the Partitions container.
4. In the right pane, right-click on... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
640 | 17.5. Finding the Application Partitions Hosted
by a Server
Problem
You want to find the application partitions that a particular server is hosting. Before you
decommission a server, it is good to check to see whether it hosts any application par‐
titions and, if so, to add another replica server to replace it.
Solutio... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
641 | > dsquery * "cn=partitions,cn=configuration,<ForestDN>" -scope onelevel -attr↵
dnsRoot -filter "(&(objectcategory=crossRef)↵
(systemFlags:1.2.840.113556.1.4.803:=5)
(msDS-NC-Replica-Locations=cn=NTDS Settings,cn=<DomainControllerName>,↵
cn=servers,cn=<SiteName>,cn=sites,cn=configuration,<ForestDN>))"
You can also displ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
642 | Solution
Using a command-line interface
Use the following command to determine whether there are any problems with appli‐
cation partitions on a domain controller:
> dcdiag /test:checksdrefdom /test:verifyreplicas /test:crossrefvalidation↵
/s:<DomainControllerName>
You can also verify the state of a particular applicat... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
643 | adfind -b "cn=NTDS Settings,cn=<DCName>,cn=Servers,cn=<SiteName>,cn=Sites,↵
cn=Configuration,<ForestDN>" -f↵
"msds-HasInstantiatedNCs=B:8:0000000D:<ParitionDN>" -dn
This will return results similar to the following:
AdFind V01.47.00cpp Joe Richards (joe@joeware.net) October 2012
Using server: adatum-dc.adatum.com:389
... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
644 | 5. Set the msDS-Replication-Notify-First-DSA-Delay and msDS-ReplicationNotify-Subsequent-DSA-Delay attributes to the number of seconds you want for
each delay (see this recipe’s “Discussion” for more details).
6. Click OK.
Using a command-line interface
To change the settings using the command line, run the following ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
645 | 17.8. Setting the Reference Domain for an
Application Partition
Problem
You want to set the reference domain for an application partition. Whenever you create
an object in Active Directory, the default security descriptor that’s defined in the schema
for the object’s class is applied to the object. This default securit... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
646 | You can also set the reference domain using AdMod:
> adfind -partitions -f "(dnsRoot=<PartitionDNSName>)" -dsq |↵
admod msDS-SDReferenceDomain::"<DomainDN>"
Using PowerShell
Set-ADObject "<PartitionDN>" -Replace @{"msDS-SDReferenceDomain"="<DomainDN>"}
Discussion
If you don’t set the msDS-SDReferenceDomain attribute f... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
647 | 4. In the right pane, right-click on the crossRef object that represents the application
partition and select Properties.
5. Click the Security tab.
6. Click the Advanced button.
7. Click the Add button.
8. Use the object picker to find the user or group you want to delegate control to and
click OK.
9. Under Properties... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
648 | msDS-Replication-Notify-Subsequent-DSA-Delay
See Recipe 17.7 for more information.
If you want to delegate control over managing objects within the application partition,
you need to follow the same procedures you would when delegating control over objects
in a domain naming context. See Recipe 13.9 for more informatio... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
649 | null | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
650 | CHAPTER 18
Active Directory Lightweight
Directory Service
18.0. Introduction
Active Directory Application Mode (ADAM) was released in November 2003 on the
Microsoft website. With the release of Windows Server 2008, along with several other
technologies, Microsoft renamed ADAM. The new name for ADAM is Active Directory
... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
651 | Database Mounting Tool (Dsamain.exe)
Similar to Active Directory Domain Services, you can use dsamain to mount snap‐
shots of AD LDS partitions to view and compare information from previous points
in time.
Support for Active Directory Sites and Services
You can now use the AD Sites and Services MMC to manage replicatio... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
652 | If the installation process encounters any errors, these will be logged in
the %windir%\Debug\adamsetup.log file.
See Also
Recipe 18.2; Recipe 18.3
18.2. Creating a New AD LDS Instance
Problem
You want to create a new AD LDS instance.
Solution
Using a graphical user interface
1. From Administrative Tools, launch the Ac... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
653 | 8. On the Service Account Selection screen, configure the account under whose se‐
curity context this instance will run. By default, Network Service Account is se‐
lected, or you can click the radio button next to “This account” and specify a dif‐
ferent account.
9. On the AD LDS administrator’s screen, specify the use... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
654 | The default location of adaminstall.exe is <driveletter>:\Windows
\ADAM. You must run this command from this location in the com‐
mand prompt.
Discussion
An AD LDS instance refers to a single installation of AD LDS on a particular server or
workstation. A single Windows computer can host multiple instances of AD LDS si... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
655 | already listening on the default LDAP port. Otherwise, the LDAP and SSL ports
that AD LDS chooses during the installation will be 389 and 636.
If you’ve already installed an ADAM instance on ports 50000 and
50001, the ADAM installer will choose the next two ports available;
the second ADAM instance would choose ports 5... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
656 | Specify the name of the new replica.
InstanceName=IntranetApplication
Specify the ports used for LDAP and SSL.
LocalLDAPPortToListenOn=50000
LocalSSLPortToListenOn=50001
The following line specifies the directory to use for
ADAM data files.
DataFilesPath=C:\Program Files\Microsoft ADAM\IntranetApplication\data
The... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
657 | Solution
Using a graphical user interface
1. Open the Services MMC snap-in (services.msc).
2. Select the name of the AD LDS instance that you want to manage.
3. Right-click on the instance name and select Start, Stop, Pause, Resume, or Restart,
as needed.
Using a command-line interface
To stop an AD LDS instance, enter... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
658 | 18.5. Changing the Ports Used by an AD LDS Instance
Problem
You want to change the LDAP or LDAP over SSL ports that are being used by a particular
AD LDS instance.
Solution
> dsdbutil
> activate instance <instancename>
> LDAP port <port>
> SSL port <port>
> quit
Discussion
If you need to change the LDAP and/or LDAP ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
659 | Using PowerShell
The following command will list all AD LDS instances whose name begins with "ADAM_"
on the local computer:
Get-Service -Include "ADAM_*"
Discussion
As we discussed in Recipe 18.4, a single computer can host multiple AD LDS instances
running on different ports, each of which will advertise itself as a t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
660 | Solution
Using a command-line interface
To extend the AD LDS Schema from the command line, you’ll need to create an LDIF
file containing the necessary schema extensions and then import it using the LDIFDE
command, or use a tool like AdMod to perform the changes. AD LDS comes with a
number of such LDIF files preinstalle... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
661 | See Also
Recipe 18.2; MSDN: Adding User Classes [ADAM]; MSDN: Adding Contact Classes
[ADAM]; MSDN: Extending the Active Directory Application Mode Schema [ADAM];
“Create an Application Directory Partition”; “Delete an Application Directory Parti‐
tion”; Active Directory, Fifth Edition, by Brian Desmond et al. (O’Reilly... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
662 | > dsmgmt
> Partition Management
> create nc <ApplicationPartitionDN> container <ComputerName>:<PortNumber>
> quit
> quit
Use the following command to delete an application partition:
> dsmgmt
> Partition Management
> delete nc <ApplicationPartitionDN>
> quit
> quit
Discussion
An AD LDS installation creates up to ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
663 | Solution
Using a graphical user interface
1. Open ADSI Edit. If necessary, create and bind to a connection of your instance.
2. Right-click on the instance and select New→Object.
3. Under “Select a class”, click on organizationalUnit and click Next.
4. For the value of the ou attribute, type ADLDSUsers and click Next.
... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
664 | Discussion
Creating OUs in AD LDS is identical to creating them within Active Directory. Just like
in AD, AD LDS OUs are containers that can contain other objects such as users, groups,
contacts, or other OUs. You can also delegate permissions to an OU, allowing a user or
group to have rights to the OU itself and to ob... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
665 | Using PowerShell
To create an AD LDS user with PowerShell, use the following syntax:
New-ADUser -Name "John Doe" -Server "<ComputerName>:<Port Number>"↵
-Path "<Application/Parent DN>" -AccountPassword (ConvertTo-SecureString↵
-AsPlainText "<PlainTextPassword>" -Force)
To remove an AD LDS user with PowerShell, use th... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
666 | 2. Navigate to the container that houses the user.
3. Right-click the user and click Reset Password.
4. Enter the new password twice and click OK.
Using PowerShell
Set-ADAccountPassword "<User DN>" -Server "<ComputerName>:<PortNumber>"↵
-NewPassword (ConvertTo-SecureString -AsPlainText "<PlainTextPassword>" -Force)
Di... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
667 | Solution
Using a graphical user interface
1. Open ADSI Edit. If necessary, create and bind to a connection of your AD LDS
instance.
2. Navigate to the user in question, right-click, and select Properties.
3. Scroll to the msDS-UserAccountDisabled attribute and click Edit.
4. Click True and then click OK.
5. To reenable... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
668 | See Also
Recipe 18.11 for more on setting the password of an AD LDS user; MSDN: ms-DSUser-Account-Disabled Attribute [AD Schema]; “Disable or Enable an AD LDS User”
18.13. Creating AD LDS Groups
Problem
You want to create or delete a group object within AD LDS.
Solution
Using a graphical user interface
1. Open ADSI Ed... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
669 | all naming contexts in that instance. This means that a group or user that was created
in Instance1 cannot be used to assign permissions on objects in Instance2 or be added
to a group in Instance2 (unless Instance1 and Instance2 are members of the same
configuration set). Windows security principals can be assigned per... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
670 | To add multiple users at one time, change + to ++ in the previous command and separate
the User DNs with a semicolon.
To remove a single user, change + to – in the previous command.
To remove multiple users, change + to –– in the previous command and separate the
User DNs with a semicolon.
Using PowerShell
To add users... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
671 | Solution
Using a graphical user interface
1. Open ADSI Edit. If necessary, connect and bind to a connection of your AD LDS
instance.
2. Navigate to the object in question, right-click, and select Properties. To view only
the mandatory attributes for an object, click Filter and then remove the checkmark
next to Optional... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
672 | Using PowerShell
To view an AD LDS object’s properties using Windows PowerShell, use the following
syntax:
Get-ADObject -Identity "<Object DN>" -Server "<ComputerName>:<Port Number>"↵
-Properties *
To modify an AD LDS object’s properties using Windows PowerShell, use the following
syntax:
Set-ADObject -Identity "<Obje... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
673 | dn: cn=Richard Mahler,cn=users,ou=AdamUsers,o=adatum,c=us
changetype: add
objectClass: user
cn: Richard Mahler
name: Richard Mahler
dn: cn=Doug Martin,cn=users,ou= AdamUsers,o=adatum,c=us
changetype: add
objectClass: user
cn: Doug Martin
name: Doug Martin
Once you’ve created the LDIF file, you just need to run ldifde t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
674 | Solution
Using a graphical user interface
1. Open Active Directory Sites and Services (dssite.msc). If necessary, connect and
bind to a connection of your AD LDS instance.
In order to use the AD Sites and Services MMC snap-in to manage
AD LDS replication, you must use the MS-ADLDSDisplaySpecifiers.LDF file to extend t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
675 | Solution
Using a graphical user interface
1. Open Active Directory Sites and Services (dssite.msc). If necessary, connect and
bind to a connection of your AD LDS instance.
2. Navigate to the Site container and then expand the Servers container. Expand the
server name and click NTDS Settings.
3. Right-click the connecti... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
676 | Solution
Using a graphical user interface
1. Open ADSI Edit. Connect and bind to the Configuration container of the AD LDS
instance that you wish to manage.
2. Double-click on Configuration [<ComputerName>:<PortNumber>].
3. Right-click on cn=Configuration,cn=<GUID> and click Properties.
4. Scroll to msDS-ReplAuthentica... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
677 | specified as the AD LDS service account, in which case the replication security level is
set to 0.
Table 18-1. Description of the msDS-ReplAuthenticationMode values
Value Description
0—
Negotiated
pass-through
All AD LDS instances in the configuration set use an identical account name and password as the AD LDS service... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
678 | 6. In the Trustee text box, enter the name of the user or group object that you wish
to apply permissions to. In the ACE mask section, select whether you are creating
Allow ACE or Deny ACE.
7. In the Access mask section, place checkmarks next to the permissions that you are
allowing or denying.
8. Click OK when you are... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
679 | Table 18-2. Description of the PermissionBits values
Value Description
GR Generic read
GE Generic execute
GW Generic write
GA Generic all (FULL CONTROL)
SD Delete
DT Delete an object and all its child objects (DELETE TREE)
RC Read security information
WD Change security information
WO Change owner information
LC List c... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
680 | Solution
Using a graphical user interface
1. Open the Group Policy Object (GPO) that is linked to the computer(s) hosting the
AD LDS instance that you wish to audit.
2. In the left pane, expand Windows Settings→Security Settings→Local Policies and
click on Audit Policy.
3. In the right pane, double-click “Audit directo... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
681 | Account Name: Administrator
Account Domain: ADATUM
Logon ID: 0xb3405
Directory Service:
Name: ADAM_Partition1
Type: Active Directory Lightweight Directory Services
Object:
DN: cn=JSmith,cn=Container1,cn={61E04C68-5582-494D-9F0A-1E0B970Db2D3}
GUID: {7c427193-64f6-476f-9cf4-748d850f02f8}
Class: User
Operation:
C... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
682 | CHAPTER 19
Active Directory Federation Services
19.0. Introduction
Active Directory Federation Services (AD FS) was introduced in Windows Server 2003
R2 as version 1.0, updated for Windows Server 2008 (version 1.1), released as a stand‐
alone product in version 2.0, and then updated for Windows Server 2012 (2.1). It is... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
683 | 19.1. Installing AD FS Prerequisites
Problem
You want to preinstall the necessary prerequisites before installing AD FS. The GUI
steps are specific to Windows Server 2012 but also very close to what is found in Win‐
dows Server 2008 and Windows Server 2008 R2.
Solution
Using a graphical user interface
To install IIS on... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
684 | Once you have submitted the certificate request to a Certification Authority and have
received a .cer file in return, use these steps to install the certificate:
1. Navigate to <server name> if you have not done so already. Click “Complete cer‐
tificate request.”
2. Browse to the appropriate CER file, and enter the FQD... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
685 | KeyUsage = 0xa0
[EnhancedKeyUsageExtension]
OID=1.3.6.1.5.5.7.3.1 ; this is for Server Authentication
;-----------------------------------------------
Once you have created the appropriate request.inf file, issue the following certreq.exe
command:
> certreq -new request.inf request.req
Once you have submitted the certi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
686 | Solution
Using a graphical user interface
1. Launch Server Manager.
2. Click Manage and then click Add Roles and Features.
3. Click Next. Select the server to install the role on and then click Next.
4. Place a checkmark next to Active Directory Federation Services. If prompted, click
Add Features. Click Next three tim... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
687 | Solution
Using a graphical user interface
1. Open the AD FS MMC snap-in (adfs.msc).
2. From the Actions menu, select Add Attribute Store.
3. Enter a name in the Display name field.
4. Select LDAP as the Attribute store type.
5. In “Connection string”, enter the string to be used for the connection for the at‐
tribute s... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
688 | 3. Enter a name in the Display name field.
4. Select SQL as the Attribute store type.
5. In “Connection string”, enter the string to be used for the connection to the attribute
store; for example, Server=adatum-sql;Database=userDatabase;Integrated Se
curity=True
6. Click OK to add the SQL attribute store.
Using Windows... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
689 | Discussion
AD FS claims are the foundation of authentication and authorization in federated ap‐
plications. Administrators in account partners will configure organizational claims that
will be presented by users when accessing applications that are hosted by resource
partners.
See Also
Recipe 19.6 for more on configuri... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
690 | 11. Click Next and then Close to complete the wizard.
Using Windows PowerShell
Add-ADFSRelyingPartyTrust -Name "<Name>" -Identifier "<URI>"↵
-ProtocolProfile WsFed-SAML -EncryptionCertificate "<CertificatePath>"
Discussion
When configuring AD FS, you’ll start by configuring one or more relying party trusts
to represen... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
691 | 2. From the Actions menu, click Add Claims Provider Trust.
3. Click Start to begin the wizard.
4. To add a claims provider manually, click “Enter claims provider trust data man‐
ually” and then click Next.
5. Enter a display name and notes, and then click Next.
6. Select the appropriate AD FS profile and then click Nex... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
692 | Solution
Using a graphical user interface
1. Open the Active Directory Domains and Trusts snap-in (domain.msc).
2. In the left pane, right-click Active Directory Domains and Trusts and select
Properties.
3. Under Alternate UPN suffixes, type the name of the suffix you want to add.
4. Click Add and OK.
Using a command-l... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
693 | 19.9. Configuring AD FS 2.x and AD FS 1.x Interoperability
Problem
You want to configure AD FS 2.x and AD FS 1.x interoperability for AD FS 1.x security
tokens.
Solution
Using a graphical user interface
The first step in configuring AD FS interoperability is to extract the User Principle Name
from Active Directory. To ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
694 | 9. Verify that “Pass through all claim values” is selected.
10. Name the claim rule appropriately and then click Finish.
The third step in configuring AD FS interoperability is to extract the attribute store
information as AD FS 1.x claim types. To configure the claim rule, follow these steps:
1. Launch the AD FS manag... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
695 | Using Windows PowerShell
To create the Claims Provider Trust rules using PowerShell, first create a text file named
CPTrust.txt with the following information:
@RuleTemplate = "LdapClaims"
@RuleName = "Extract UPN"
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/↵
windowsaccountname", Issuer == "AD ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.