Thursday, February 24, 2011

Modifying a Bit Flag Attribute,Modifying an Object,Deleting a Container That Has Child Objects

Deleting a Container That Has Child Objects

This topic explains how to use the Active Directory module for Windows PowerShell to delete a container that has child objects in Active Directory Domain Services (AD DS).

Example

The following example demonstrates how to delete the container organizational unit (OU) Finance, which has child objects:
Remove-ADObject "OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM" -Recursive

Additional information

For a full explanation of the parameters that you can pass to Remove-ADObject, at the Active Directory module command prompt, type Get-Help Remove-ADObject –detailed, and then press ENTER.

Modifying an Object

This topic explains how to use the Active Directory module for Windows PowerShell to modify the attribute of an object in Active Directory Domain Services (AD DS).

Example

The following example demonstrates how to modify the Description attribute of the AntonioAl Direct Reports distribution list in the Fabrikam.com domain:
Set-ADObject 'CN=AntonioAl Direct Reports,OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM' -Description "Distribution List of Antonio Alwan Direct Reports"

Additional information

You can use the following parameters when you set many of the common values of Active Directory objects:
  • -Description
  • -DisplayName
  • -ProtectedFromAccidentalDeletion
For the full explanation of the list of the parameters that you can pass to Set-ADObject, at the Active Directory module command prompt, type Get-Help Set-ADObject –detailed.

Modifying a Bit Flag Attribute

This topic explains how to use the Active Directory module for Windows PowerShell to modify a bit flag attribute of an object in Active Directory Domain Services (AD DS).

Example

The following example demonstrates how to modify the bit flag attribute userAccountControl of the user object SaraDavis to Enabled:
Set-ADObject 'SaraDavis' -Replace @{<BitflagAttributeName>='512'}

Additional information

You can use the following parameters when you set many of the common values of Active Directory objects:
  • -Description
  • -DisplayName
  • -ProtectedFromAccidentalDeletion
For a full explanation of the parameters that you can pass to Set-ADObject, at the Active Directory module command prompt, type Get-Help Set-ADObject –detailed, and then press ENTER.


No comments:

Post a Comment