index int64 0 4.08k | text stringlengths 34 4.9k ⌀ | url stringclasses 38
values |
|---|---|---|
296 | 2. In the top-left pane, click the tree view icon.
3. Expand the System container.
4. Scroll down and right-click Password Settings Container, expand the New menu,
and then click Password Settings.
5. Fill in the desired password settings in the top pane. Note that the fields with a red
asterisk are required fields.
6.... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
297 | null | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
298 | CHAPTER 8
Computer Objects
8.0. Introduction
As far as Active Directory is concerned, computers are very similar to users. In fact,
computer objects inherit directly from the user object class, which is used to represent
user accounts. This means that computer objects possess all of the attributes of user
objects and t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
299 | Table 8-1. Attributes of computer objects
Attribute Description
cn Relative distinguished name of computer objects.
dnsHostName Fully qualified DNS name of the computer.
lastLogonTimestamp The approximate timestamp of the last time the computer logged in to the domain.
managedBy The distinguished name (DN) of the user ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
300 | 3. In the right pane, click New and then click Computer.
4. Type a name for the computer, fill in the desired optional fields, and then click OK
to create the computer object.
Using a command-line interface
You can create a computer object using either the built-in DSAdd utility or AdMod. To
create an account using DSA... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
301 | 8.2. Creating a Computer for a Specific User or Group
Problem
You want to create a computer account for a specific user or group to join to the domain.
This requires setting permissions on the computer account so that the user or group
can modify certain attributes.
Solution
Using a graphical user interface
1. Open the... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
302 | Discussion
By default, members of the Authenticated Users group can join up to 10 computers to
an Active Directory domain. If you’ve modified this default behavior or need to allow
a user to add computers to the domain on a regular basis, you need to grant certain
permissions so that the user has rights to modify the c... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
303 | See Also
Recipe 8.1 for creating a computer account
8.3. Deleting a Computer
Problem
You want to delete a computer account.
Solution
Using a graphical user interface
1. Open the Active Directory Administrative Center.
2. In the right pane, type the name of the computer in the Global Search box, select
the desired domai... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
304 | Solution
Using a graphical user interface (steps specific to Windows 7, Windows 8, and
Windows Server 2012)
1. Log on to the computer that you want to join to the domain, and then open the
Control Panel.
2. Open the System applet.
3. In the “Computer name, domain, and workgroup settings section,” click “Change
settings... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
305 | Using a command-line interface
The netdom command will attempt to create a computer object for the computer during
a join if one does not already exist. An optional /OU switch can be added to specify the
OU in which to create the computer object.
You can unjoin a computer from a domain at the command line by using unjo... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
306 | Using a command-line interface
You can move a computer object to a new container using the built-in DSMove utility
or AdMod. To use DSMove, enter the following syntax:
> dsmove "<ComputerDN>" -newparent "<NewParentDN>"
To move a computer object using AdMod, use the following:
> admod -b "<ComputerDN>" -move "<NewParent... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
307 | 4. On the Domain Selection page, enter the DNS or NetBIOS name of the source and
target domains. Click Next.
5. On the Computer Selection Option screen, select the option to select the computer
from the domain and then click Next.
6. On the Computer Selection screen, click Add and use the object picker to select a
comp... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
308 | Discussion
You can move objects between domains assuming you follow a few guidelines:
• The user requesting the move must have permission to modify objects in the parent
container of both domains.
• You should explicitly specify the target DC (serverless binds usually do not work).
This is necessary because the Cross D... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
309 | Using a command-line interface
You can rename a computer object by using the built-in netdom utility with the following
syntax:
> netdom renamecomputer <ComputerName> /NewName <NewComputerName>↵
/UserD<DomainUserUPN> /PasswordD * /UserO <ComputerAdminUser> /PasswordO *↵
/Reboot
Using PowerShell
You can rename a comput... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
310 | 8.8. Adding or Removing a Computer Account
from a Group
Problem
You want to add or remove a computer account from an Active Directory security group.
Solution
Using a graphical user interface
1. Open the ADUC snap-in (dsa.msc).
2. If you need to change domains, right-click on Active Directory Users and
Computers in the... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
311 | Discussion
In Active Directory, both user and computer objects are security principals that can be
assigned rights and permissions in a domain. As such, computer objects can be added
to or removed from group objects to make for simpler resource administration. You
can make this change through ADAC, ADUC, or ADSI Edit, ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
312 | If a secure channel is failing, you’ll need to reset the computer as described in
Recipe 8.10. Here is sample output when things are not working:
Flags: 0
Trusted DC Name
Trusted DC Connection Status Status = 1311 0x51f ERROR_NO_LOGON_SERVERS
The command completed successfully
Using PowerShell
If the –Verbose parameter... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
313 | Using a command-line interface
You can use the DSMod utility to reset a computer’s password. You will need to rejoin
the computer to the domain after doing this:
> dsmod computer "<ComputerDN>" -reset
Another option is to use the netdom command, which can reset the secure channel
between the computer and the domain con... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
314 | See Also
Recipe 8.4 for joining a computer to a domain
8.11. Finding Inactive or Unused Computers
Problem
You want to find inactive computer accounts in a domain.
Solution
These solutions might apply only to Windows-based machines. Other
types of machines—for example, Unix, Mac, and Network Attached
Storage (NAS)—that ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
315 | Using PowerShell
You can also locate computers that have not been logged on to for a certain amount of
time using PowerShell, as shown in the following example that finds computers that
have not been logged on to in 60 days:
$DaysSince = (Get-Date).AddDays(-60)
Get-ADComputer -Filter * -Properties LastLogonDate |↵
Whe... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
316 | Solution
Using a graphical user interface
1. Open the ADSI Edit MMC snap-in (adsiedit.msc) and connect to the Domain
Naming Context.
2. Right-click on the domainDNS object for the domain you want to change and select
Properties.
3. Edit the ms-DS-MachineAccountQuota attribute and enter the new quota value.
4. Click OK ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
317 | in Active Directory to join computers; refer to Recipe 8.4 for instructions on granting
these permissions.
Another method for granting users the right to add computer objects, although not
recommended, is via Group Policy. If you grant the “Add workstation to domain” right
via Computer Configuration→Windows Settings→Se... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
318 | Using a command-line interface
Create an LDIF file called modify_object.ldf with the following contents:
dn: <ComputerDN>
changetype: modify
add: <AttributeName><AttributeName>: <AttributeValue>
-
Then run the following command:
> ldifde -v -i -f modify_object.ldf
To modify an object using AdMod, you’ll use the followi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
319 | Using PowerShell
See the full help file for the Set-ADComputer cmdlet to view the options and detailed
usage of the Add, Replace, Clear, and Remove parameters.
See Also
Recipe 8.11 for finding inactive or unused computers; Recipe 8.14 for finding computers
with a particular OS; MSDN: Computer System Hardware Classes [W... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
320 | Using a command-line interface
You can query for computer objects of a particular operating system using either
DSQuery or AdFind. To perform the query with DSQuery, use the following syntax:
> dsquery * <DomainDN> -scope subtree -attr "*" -filter "(&(↵
objectcategory=computer)(operatingSystem=Windows Server 2012 Datac... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
321 | operatingSystemServicePack
Current service pack level if one is installed—for example, Service Pack 2 and Ser‐
vice Pack 3.
This recipe typically applies only to Windows-based machines. Other
types of machines (e.g., Unix) that have accounts in Active Directory
might not automatically update their OS attributes, though... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
322 | 11. Click OK.
12. In the lefthand menu, you can now browse the default Computers container for the
domain.
Using a command-line interface
By default, all computer objects created in an Active Directory domain are placed into
the built-in Computers container. This default container has a significant limitation, in
that ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
323 | For example, the default Computers container has the following WKGUID:
aa312825768811d1aded00c04fd8d5cd
You can use the GUID to bind to the default Computers container in the domain using
the following ADsPath:
LDAP://<WKGUID=aa312825768811d1aded00c04fd8d5cd,dc=apac,dc=adatum,dc=com>
The list of well-known objects for ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
324 | 2. From the menu, select Connection→Connect.
3. For Server, enter the name of a domain controller (or leave it blank to do a serverless
bind).
4. For Port, enter 389.
5. Click OK.
6. From the menu, select Connection→Bind.
7. Enter the credentials of a domain user.
8. Click OK.
9. From the menu, select Browse→Modify.
10... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
325 | group policies applied to them. While you can also apply GPOs at the site or the domain
level, forcing new computers into a particular organizational unit ensures that those
computers receive the Group Policy settings that you want them to receive through
GPOs linked at the OU level. However, this does not protect you ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
326 | or
Get-ADObject -Filter {objectCategory -eq "Computer"} | Select Name
Discussion
Using PowerShell
The Get-ADComputer cmdlet simplifies the process of finding computers by removing
the need to know about the object class and object category. However, both methods
end up with the exact same results.
See Also
Get-ADComput... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
327 | For a DC that doesn’t hold the PDCe FSMO, this command will return
a value of 4.
Using PowerShell
Get-WmiObject Win32_ComputerSystem -ComputerName <ComputerFQDN>↵
-Property Name,DomainRole
Discussion
The DomainRole attribute returns a numeric value that identifies the role, as shown in
the following list:
• 0 is a sta... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
328 | 2. Drill down to the current domain. To connect to a different domain, right-click on
the top-level node and click “Change domain”; select the appropriate domain and
then drill down to it.
3. Right-click on the computer that you want to modify and click Properties.
4. Click on the Object tab.
5. Place a checkmark next ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
329 | 2. Click View→Advanced Features. In the left pane, right-click on the domain and
select Find.
3. In the Find drop-down box, select Computers. Select the appropriate domain.
4. Beside Name, type the name of the computer account and click Find Now.
5. In the Search Results window, double-click on the computer.
6. Select ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
330 | CHAPTER 9
Group Policy Objects
9.0. Introduction
Active Directory Group Policy Objects (GPOs) can customize virtually any aspect of a
computer or user’s desktop. They can also be used to install applications, secure a com‐
puter, run logon/logoff or startup/shutdown scripts, and much more. You can assign a
GPO to a loc... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
331 | So why are there two storage points for GPOs? The need for the Active Directory object
is obvious: to be able to link GPOs to other types of objects, the GPOs need to be
represented in Active Directory. Group Policy Templates are stored in the OS filesystem
to reduce the amount of data that needs to be replicated withi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
332 | The only major feature that is still lacking is the ability to modify the
settings of a GPO directly via command line or script (although there
is some ability to modify specific types of settings, improvement is
needed). Previously, this could be done with only the GPOE, but there
are third-party options that can prov... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
333 | Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container.
3. Expand the Domains container.
4. Browse to the desired domain.
5. Expand the domain and then expand the Group Policy Objects container. All of
the GPOs in the domain wil... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
334 | 9.2. Creating a GPO
Problem
You want to create a Group Policy Object within Active Directory.
Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container, expand the Domains container, and
browse to the domain that will contain the n... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
335 | 9.3. Copying a GPO
Problem
You want to copy the properties and settings of one GPO into another GPO.
Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container, expand the Domains container, browse
to the domain of the source GPO, e... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
336 | GPO import uses a backup of the source GPO in order to create the new GPO. See
Recipe 9.7 for more information on importing a GPO.
Some properties of GPOs, such as security group filters, UNC paths, and Restricted
Groups, may vary slightly from domain to domain; for example, a logon script that runs
from \\SERVERA\shar... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
337 | To retain the links to the deleted GPO, use the /keeplinks switch.
Otherwise, all links will be deleted along with the GPO.
Using PowerShell
Remove-GPO -Name "<GPO Friendly Name>" -KeepLinks
Discussion
When you delete a GPO through the Group Policy Management snap-in, it attempts to
find all links to the GPO in the dom... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
338 | 5. Click the Show All link to display all configured settings.
Using a command-line interface
> getreportsforgpo.wsf "<GPOName>" <ReportLocation> [/domain:<DomainDNSName>]
Using PowerShell
Get-GPOReport -Name "<GPO Friendly Name>" -Path <Path With File Name>↵
-ReportType HTML
Discussion
The Group Policy Management sna... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
339 | 4. Browse through the Computer Configuration or User Configuration settings and
modify them as necessary.
Using PowerShell
You can modify a registry-based setting in a GPO by using PowerShell. The following
example modifies the IE High Sec GPO by disabling the Flash add-in:
Set-GPRegistryValue -Name "IE High Sec"↵
-ke... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
340 | 6. Click Next.
7. Select the backup folder location and click Next.
8. Select the backed-up GPO you want to import from and click Next.
9. The Import wizard then will scan to see whether there are any security principals
or UNC paths in the GPO being imported from. If there are, it will give you an
option to modify tho... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
341 | 9.8. Creating a Migration Table
Problem
You want to create a migration table to assist in copying or migrating a GPO from one
domain or forest to another.
Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc). Navigate to the forest
and domain containing the GPOs you wish to m... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
342 | mycompany.com forest, selecting Map by Relative Name will populate the entry in
the destination GPO as salesuser@mycompany.com.
9. To ensure that you have properly formatted all entries in the table, click Tools→Val‐
idate Table, then click File→Save or File→Save As to save the migration table.
Using a command-line int... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
343 | Solution
Windows comes preloaded with a number of default templates that define a number of
settings that can be controlled via GPO. To control and deploy settings for additional
or third-party applications, you’ll need to create your own custom ADM or ADMX file
to manage the settings you require. You’ll create this fi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
344 | key="Software\Policies\Microsoft\Internet Explorer\SearchScopes">
<parentCategory ref="inetres:InternetExplorer" />
<enabledList> Insert same as user policy above </enabledList>
</policy>
</policies>
</policyDefinitions>
In addition to the ADMX file, you will need to create an ADML file using a format
similar to t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
345 | 9.10. Assigning Logon/Logoff and Startup/Shutdown
Scripts in a GPO
Problem
You want to assign either user logon/logoff scripts or computer startup/shutdown
scripts in a GPO.
Solution
Using a graphical user interface (steps specific to Windows Server 2008 and later)
1. Open the Group Policy Management snap-in (gpmc.msc)... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
346 | 9.11. Installing Applications with a GPO
Problem
You want to install an application on a group of computers using a GPO.
Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container, expand the Domains container, ex‐
pand the domain o... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
347 | Your two options for deploying an application are to assign it or to publish it. If you
assign an application using the “deploy at logon” option, it will be installed automatically
on the targeted clients when users log on to those machines. If you publish an application
or assign it without choosing this option, it wi... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
348 | $objGpo.SetComputerEnabled($true)
$objGpo.SetUserEnabled($false)
Discussion
GPOs consist of two parts, a user section and a computer section. The user section
contains settings that are specific to a user that logs in to a computer, while the computer
section defines settings that apply to the computer regardless of wh... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
349 | 3. Click on the GPO you want to view the links for.
In the right pane, the defined links for the GPO will be listed under the Scope tab.
Using a command-line interface
> dumpgpoinfo.wsf "<GPOName>"
Using PowerShell
Get-ADOrganizationalUnit -Filter * -Properties * |↵
Where {$_.gPLink -match "<GPO GUID>"} | Select Name
... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
350 | 4. Select from the list of available GPOs and click OK.
Using PowerShell
New-GPLink -Name "<GPO Display Name>" -Target "<Container DN>"
Discussion
Linking a GPO is the process whereby you assign a scope of management (SOM), which
can be an OU, site, or domain. The solutions show how to link a GPO to an OU, but
they eas... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
351 | Using PowerShell
Below are two ways to block inheritance by using PowerShell. The first example uses
one of the cmdlets from the Group Policy module, whereas the other relies on a COM
object.
Set-GPInheritance -Target "<OU DN>" -IsBlocked Yes
$gpm = New-Object -ComObject GPMgmt.GPM
$gpmConstants = $gpm.GetConstants()
$... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
352 | 3. Right-click on the link you want to configure and place a checkmark next to En‐
forced. To remove the Enforced setting, right-click on the link and remove the
checkmark.
Using PowerShell
Set-GPLink -Guid "<GPOGUID>" -Target "<SiteName>" -Enforced Yes
Discussion
As a counterpoint to the ability to block inheritance o... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
353 | Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container, expand the Domains container, ex‐
pand the target domain, and expand the Group Policy Objects container.
3. Click on the GPO you want to modify.
4. In the right pane under ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
354 | Be very careful when changing permissions on GPOs. If you create a
very restricted GPO and apply a security filter to it, also be sure to put
tight controls on who can modify the GPO and how. If for some reason
that security filter were removed (resulting in no security filters), the
restrictive GPO could be applied to... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
355 | 1. Open the Group Policy Management snap-in (gpmc.msc).
2. Navigate to the GPO that you want to delegate permissions for and click on the
Delegation tab.
3. To add permissions for a new user or group, click Add. Use the object picker to
select the object you want and click OK.
4. In the Permissions drop-down box, selec... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
356 | trusted administrators as it can have far-reaching implications for the performance and
behavior of your network.
See Also
MS KB 250842 (Troubleshooting Group Policy Application Problems); Recipe 9.17 for
more on using security filtering to control GPO behavior
9.19. Importing a Security Template
Problem
You want to im... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
357 | 9.20. Creating a WMI Filter
Problem
You want to create a WMI filter.
Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container, expand the Domains container, ex‐
pand the target domain, and click the WMI Filters container.
3. Right... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
358 | queries, as each computer will need to process the WMI query to determine whether a
particular GPO should or should not be applied. Here is a sample WQL query that would
return true when run on a Windows Server 2012 Datacenter server:
select * from Win32_OperatingSystem↵
where Caption = "Microsoft Windows Server 2012 D... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
359 | OU. If you need multiple WMI filters to apply to a GPO, copy the GPO and apply a
different WMI filter to it. See Recipe 9.20 for more information on WMI filters.
Keep in mind that requiring your clients to process multiple WMI filters
will have an impact on their performance at logon time and during the
GPO background ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
360 | Merge mode
In this mode, any GPOs that are associated with the user will be applied first. The
GPOs associated with the computer object will be applied after the GPOs associated
with the user object, thereby giving them a higher precedence than the user GPOs.
In this case, the user will still receive any GPO settings a... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
361 | Using PowerShell
Backup-Gpo -Name <GPO Display Name> -Path <Path to Backup Folder>↵
-Comment "<Backup Description>"
Discussion
The Group Policy Management snap-in and the Backup-Gpo cmdlet both provide a way
to back up individual (or all) GPOs. A GPO backup consists of a set of folders and files
that catalog the GPO s... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
362 | 9.24. Restoring a GPO
Problem
You want to restore a GPO.
Solution
Using a graphical user interface
1. Open the Group Policy Management snap-in (gpmc.msc).
2. In the left pane, expand the Forest container, expand the Domains container, ex‐
pand the domain of the GPO you want to restore, and expand the Group Policy
Objec... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
363 | 4. Click OK after the restore completes.
If you don’t have a valid backup of the GPO, but you do have another GPO that is
identical or similar to the one you want to restore (perhaps in another forest), you can
copy that GPO to replace the one you want to restore.
Keep in mind that restoring a GPO does not restore the ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
364 | 8. If you selected a target computer container or computer account in step 5, you will
be presented with an option to simulate different group membership. Click Next
when you are done.
9. If you selected a target user container or user account in step 5, you will be presented
with an option to simulate any additional W... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
365 | You can specify a /S option and the name of a computer to target, which allows you to
run the command remotely. For a complete list of options with either version, run
gpresult /? from a command line.
Discussion
If you implement more than a few GPOs, it can get confusing as to what settings will
apply to users. To addr... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
366 | Discussion
By default, Group Policy settings will refresh automatically every five minutes on a
domain controller and every 90 minutes (with an additional random offset between
zero and 30 minutes) on clients and member servers. To force GPO settings to refresh
sooner than that, you will need to run the gpupdate utilit... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
367 | Discussion
If you’ve made changes to the default GPOs in the Windows Server 2003 or later version
of Active Directory and would like to revert back to the original settings, the dcgpofix
utility is your solution. dcgpofix works with a particular version of the schema. If the
version it expects to be current is differen... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
368 | Using PowerShell
Fine-Grained Password Policy objects can also be created in PowerShell, as follows:
New-ADFineGrainedPasswordPolicy -Name "HighSec2" -Precedence 1↵
-ComplexityEnabled $true -Description "High Security Password Policy"↵
-DisplayName "Domain Users PSO" -PasswordHistoryCount "12" -MinPasswordLength↵
"1... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
369 | Using a command-line interface
The following command renames a PasswordSettingsObject:
psomgr -rename newname -pso oldname -forreal
The following modifies a PSO’s maximum password age to 60 days:
psomgr -mod -pso TestPSO -pwdlen 60 -forreal
The following adds the Marketing group to the list of groups that a PSO will ap... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
370 | cn=pwd_policy_serviceid
Creates a PSO with a minimum length of 15, with passwords that expire every 364
days and that are not subject to account lockout
The full syntax for psomgr.exe can be obtained by typing psomgr.exe /? at a command
prompt, or by visiting the joeware website.
See Also
Recipe 9.31; Recipe 9.29; Reci... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
371 | Discussion
Within a Windows Server 2008 or later domain, each user object contains a constructed
backlink attribute called msDS-ResultantPSO that indicates which PasswordSetting
sObject is in effect for that user. The precedence rules for PasswordSettingsObjects
are as follows:
1. If a PSO has been applied directly to ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
372 | CHAPTER 10
Schema
10.0. Introduction
The Active Directory schema contains the blueprint for how objects are structured and
secured, what data they can contain, and even how they can be viewed. Having a good
understanding of the schema is paramount for any Active Directory administrator,
designer, or architect. Understa... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
373 | version 3 specification (RFC 2251). There is only a single subSchema object in the Schema
container, named cn=Aggregate, and it contains a summary of the entire schema.
Table 10-1 and Table 10-2 contain useful attributes of classSchema objects and attrib
uteSchema objects, respectively.
Table 10-1. Attributes of classS... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
374 | Table 10-2. Attributes of attributeSchema objects
Attribute Description
adminDescription Description of the attribute.
attributeID OID for the attribute.
attributeSecurityGUID GUID of the property set (if any) that an attribute is a member of.
attributeSyntax OID representing the syntax of the attribute. This is used i... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
375 | Discussion
Most of the Active Directory MMC snap-ins do not require that you manually register
the associated .dll. Microsoft requires this with the Active Directory Schema snap-in,
however, due to the sensitive nature of modifying the schema. This doesn’t actually do
much to prevent users from using it, but at least i... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
376 | of things, including SNMP MIB objects and LDAP schema classes and attributes. OIDs
are hierarchical, and the national registries are responsible for managing and assigning
OID branches.
10.3. Extending the Schema
Problem
You want to extend the schema to support new classes and attributes in Active Directory.
Solution
E... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
377 | See Also
Recipe 10.6 for adding a new attribute; Recipe 10.8 for adding a new class; “Extending
the schema”
10.4. Preparing the Schema for an Active Directory
Upgrade
Problem
You want to prepare the Active Directory schema for an Active Directory upgrade.
Solution
From a graphical user interface
To prepare your Active ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
378 | To automate this process, Active Directory includes the adprep utility to perform these
modifications. adprep needs to be run once for the entire forest using the /forest
prep switch and once for each domain that will be upgraded using the /domainprep
switch. In the case of a Windows Server 2012 upgrade, you can view t... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
379 | The AD Schema Analyzer is a useful tool that can document your existing schema, as
well as create a file to help you modify the schema. To use the Schema Analyzer to create
an LDIF file, do the following:
1. Open a command prompt and navigate to the Windows\ADAM directory. Run the
program adschemaanalyzer.exe from the ... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
380 | 5. Click OK.
Using a command-line interface
You can create new attributes by using ldifde and an LDIF file that contains the properties
to be set on the attribute. The following code shows a sample LDIF file called cre
ate_attr.ldf that creates an attribute called adatum-LanguagesSpoken:
dn: cn=adatum-LanguagesSpoken,c... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
381 | To create an attribute, you need to add an attributeSchema object to the Schema con‐
tainer. Typically, when you extend the schema you perform several additions or mod‐
ifications at once. The order of your extensions is very important. You can’t create a
class, assign an attribute, and then create the attribute; you o... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
382 | Name attribu
teSyntax
oMSyn
tax
Description
OctetString 2.5.5.10 4 Array of bytes used to store binary data.
OID 2.5.5.2 6 String that contains digits (0–9) and decimal points (.).
ORName 2.5.5.7 127 Taken from X.400; used for X.400 to RFC 822 map ping.
PresentationAd
dress
2.5.5.13 127 String that contains OSI present... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
383 | 10.7. Viewing an Attribute
Problem
You want to view the properties of an attribute.
Solution
Using a graphical user interface
1. Open the Active Directory Schema snap-in.
2. In the left pane, expand Active Directory Schema and then click on the Attributes
folder.
3. In the right pane, double-click the attribute you wan... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
384 | Discussion
The GUI solution requires that the .dll file for the Active Directory Schema snap-in has
been registered. See Recipe 10.1 for more information.
In the CLI solutions, we mention that you need to specify the common name (or cn) of
the attribute you want to view. The common name is a source of confusion for man... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
385 | 10.8. Adding a New Class
Problem
You want to add a new class to the schema.
Solution
Using a graphical user interface
1. Open the Active Directory Schema snap-in.
2. In the left pane, expand Active Directory Schema and then right-click on the Classes
folder and select “Create Class”.
3. Click the Continue button to con... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
386 | adminDescription::"Auxiliary class for Sales user"↵
mayContain::adatum-Building;adatum-Theatre↵
-add
Using PowerShell
To create a schema class by using PowerShell, use the following syntax:
New-ADObject -Name "adatum-SalesUser " -Description "Custom Class"↵
-Type "classSchema" -OtherAttributes↵
@{distinguishedname="c... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
387 | 10.9. Viewing a Class
Problem
You want to view the attributes of a class.
Solution
Using a graphical user interface
1. Open the Active Directory Schema snap-in.
2. In the left pane, expand Active Directory Schema and then click on the Classes
folder.
3. In the right pane, double-click the class you want to view.
4. Cli... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
388 | See Also
Recipe 4.2 for viewing the attributes of an object
10.10. Indexing an Attribute
Problem
You want to index an attribute so that searches using that attribute are faster.
Solution
Using a graphical user interface
1. Open the Active Directory Schema snap-in.
2. In the left pane, expand Active Directory Schema and... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
389 | Using PowerShell
To set the searchFlags bit value by using PowerShell, use the following syntax:
Set-ADObject "<AttributeDN>" -Replace @{"searchFlags"="1"}
Discussion
To index an attribute, you need to set bit 0 (0001) in the searchFlags attribute for the
attributeSchema object.
searchFlags is a bit-flag attribute that... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
390 | See Also
Recipe 4.15 for modifying a bit-flag attribute; Recipe 10.6 for adding a new attribute
10.11. Modifying the Attributes That Are Copied When
Duplicating a User
Problem
You want to add an attribute to the list of attributes that are copied when duplicating a
user with the ADUC snap-in.
Solution
Using a graphical... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
391 | The CLI solution and the PowerShell solution assume that search
Flags wasn’t previously set; if a value is present, it just blindly overwrites
it. See Recipe 4.15 for a better solution that will enable the bit you want
without overwriting any previous settings.
Using PowerShell
To set the searchFlags bit value by using... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
392 | 10.12. Modifying the Attributes Included with ANR
Problem
You want to modify the attributes that are included as part of ANR.
Solution
Using a graphical user interface
1. To proceed, you must have first indexed the attribute.
2. Open the Active Directory Schema snap-in.
3. In the left pane, click on the Attributes fold... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
393 | Set-ADObject "<AttributeDN>" -Replace @{"searchFlags"="5"}
Discussion
ANR is an efficient search algorithm that allows for a complex search filter to be written
using a single comparison. For example, a search for (anr=Jim Smith) would translate
into the following query:
• An OR filter with every attribute in the ANR s... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
394 | Base
cn=Schema,cn=Configuration,<ForestRootDN>
Filter
(&(objectcategory=attributeSchema)(searchFlags:
1.2.840.113556.1.4.803:=4))
Scope
onelevel
You can also find attributes that are included in ANR using AdFind, as follows:
adfind -sc anr
Alternatively, to find attributes that aren’t included in ANR, change the previo... | http://ter40.free.fr/ebooktmp/new/Active%20Directory%20Cookbook,%204th%20Edition.pdf |
395 | Using a command-line interface
You can add an attribute to the global catalog by using the ldifde utility and an LDIF file
that contains the following:
dn: cn=<AttrCommonName>,cn=schema,cn=configuration,<ForestRootDN>
changetype: modify
replace:
isMemberOfPartialAttributeSet
isMemberOfPartialAttributeSet: TRUE
-
If the... | 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.