Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Daily operation of Windows Server 2016-OU organizational unit

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Technology does not matter whether it is high or low. Since you have done it, you should always leave something behind. After all, doing technology has left us with too much growth experience over the years. Some people always ask why you want to write about it. In fact, there are not so many fancy reasons. It is always a simple summary of the past to think about doing or not doing this piece. Habit has become natural, although frequently updated due to various reasons. But whenever I have time, I want to write something. I hope I can help more people in need in N years' time. This chapter gives a brief introduction to the daily OU organizational units of Active Directory, such as new construction, movement, deletion and so on, to facilitate daily management. The details are as follows:

Create a new OU:

1. Open the Active Directory user and computer, and right-click New-Organization Unit:

two。 Enter the name of the organization unit in the new object. Here, you can check "prevent containers from being accidentally deleted", or do not check according to the actual environment. To prevent misoperation in the production environment, click OK to continue:

3. The OU information after creation is as follows:

4. You can also click "create a new organizational unit in the current container" in the console. In the production environment, the corresponding OU organizational unit will be created according to the company structure:

5. Enter the OU name:

6. Create a new OU at the corresponding level according to the company structure. The organizational structure information is as follows:

The command line queries the OU information under the current architecture:

a. The command line queries the current OU information:

Method 1: dsquery command to query the current OU information:

Dsquery ou

Method 2: Powershell command to query the current OU information:

Get-adorganizationalunit-filter * | select distinguishedname

Fuzzy query OU information:

Get-adorganizationalunit-filter 'Name-like "Group*" | ft distinguishedname

Accurately query OU related information:

Get-adorganizationalunit-filter 'Name-like "Group3" | fl

Create an OU on the command line:

The 1.dsadd ou command creates an OU:

Dsadd ou ou=xxx,ou=syncall,dc=azureyun,dc=local

The 2.powershell command creates an OU:

New-adorganizationalunit-name xxx-path "ou=syncall,dc=azureyun,dc=local"

Query the new OU information:

Rename OU information

1.rename-adobject rename OU information:

Rename-adobject "ou=oldouname,ou=syncall,dc=azureyun,dc=local"-newname newname

Command line query renamed OU information:

Get-adorganizationalunit-filter * | select distinguishedname

Delete OU information:

A.remove-adorganizationalunit delete OU:

Remove-adorganizationalunit-identity "ou=xxx,ou=syncall,dc=azureyun,dc=local"-recursiv

According to the prompt to enter to confirm deletion, we found that the error message indicates that we do not have access, and even if we are forced to delete, we cannot complete the deletion operation. In this case, do we want to "prevent containers from being accidentally deleted" checked in the new OU above:

b. Select View-and check Advanced Features:

At this point we will see too much information than the previous structure:

c. Select the group information we want to delete and select the attribute with the right mouse button:

d. Navigate to the "objects" column in the OU property box, uncheck "prevent containers from being accidentally deleted" and click OK:

e. At this point, we execute the delete command:

Remove-adorganizationalunit-identity "ou=xxx,ou=HelpDesk,dc=azureyun,dc=local"-recursiv-confirm:$false

Deleted successfully, check the current OU information again, the Group1 related OU information can not be found.

F: we can also uncheck "prevent containers from being accidentally deleted" through the command line, as follows:

Uncheck the command line: "prevent containers from being accidentally deleted"

Set-adobject-identity "ou=xxx,ou=HelpDesk,dc=azureyun,dc=local"-ProtectedFromAccidentalDeletion:$false

Mobile OU:

Graphical Mobile OU:

1. Right-click the OU information to be moved, and select "Mobile":

two。 Select the new location where you want to move the object to the container, and click OK to continue:

3. At this point, we are prompted that we cannot move the object because access is denied:

4. This is obviously because the "prevent objects from being accidentally deleted" option is checked in the OU object properties, uncheck and determine:

5. Successfully move the OU organizational unit:

The Powershell command line moves OU:

Move-adobject-identity "ou=xxx,ou=Syncall,dc=azureyun,dc=local"-targetpath "ou=HelpDesk,dc=azureyun,dc=local"

The error message is also because the check box "prevent objects from being accidentally deleted" is not unchecked. Here, uncheck it from the command line and perform the move operation again. You can check it from the command line:

Set-adobject-identity "ou=xxx,ou=Syncall,dc=azureyun,dc=local"-ProtectedFromAccidentalDeletion:$false

The dsmove command moves the OU:

Dsmove ou=xxx,ou=Syncall,dc=azureyun,dc=local-newparent ou=HelpDesk,dc=azureyun,dc=local

Delete OU:

The 1.dsrm command deletes OU:

Dsrm ou=xxx,ou=Syncall,dc=azureyun,dc=local

The 2.Remove-Adobject command deletes OU:

Remove-Adobject-identity "ou=xxx,ou=Syncall,dc=azureyun,dc=local"-confirm:$false

The end of this chapter.

Welcome to the official account of Wechat: Xiao Wen study Society.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report