In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
In the domain environment, after adding the domain, all computers will be placed under the computers by default. In the domain architecture of single domain and multi-site, different group policies are configured for each site for system update, software distribution and other strategies, so it is necessary to move computers to the corresponding OU of different sites.
If there is a unified computer command rule, you can distinguish and move the computer according to the computer name (if necessary, you can change the IP in the attached PS to the computer name), but if the computer name has no rules and moves according to the computer's IP subnet, then each computer will query IP and move, which will be a very time-consuming process! If the administrator does not operate in time, the application of group policy will not be successful, resulting in software distribution, system updates and other applications can not be applied, and can not meet the requirements of unified management. In the large single-domain multi-architecture environment, each site is a different administrator, for a long time, there will be more and more computers still exist in the Computers does not move, resulting in a variety of problems.
Recently, on TechNet, I saw a PowerShell that reassembles the OU of a Win7 computer with an IP address on 2008R2AD:
PowerShell-Organize Windows 7 computers into OUs by IP-2008R2 only, the method found is very close to my requirements, so I took it for a little processing to meet the following requirements:
1. Move computers that have not been in use for more than 60 days to the specified OU (Disabled OU, if not, please create them in advance)
2. Delete computers that have not been in use for more than 90 days from the domain (if you do not want to delete, please comment out lines 78-81)
3. Because the default manual add domain computers will be placed under the computers, so only the Computers computers are moved
4. Modify the conditions:
For Windows client computers such as XP/Vista/Win7/Win8/Win10 (lines 47-53)
{(OperatingSystem-like "Windows XP*")-or
(OperatingSystem-like "Windows Vista*")-or
(OperatingSystem-like "Windows 7*")-or
(OperatingSystem-like "Windows 8")-or
(OperatingSystem-like "Windows 10*")}
Or all non-Windows Server computers are moved to the specified OU (commented out on lines 56-58 of the file) if you want to use the following conditions, please note that you comment out lines 47-53 above!
(OperatingSystem-notlike "Windows Server*")
How to use it:
Download the attached PS script file and modify the following customization as needed
1. Add or modify the IP range and change it to the subnet of each site in your domain environment (lines 25-27)
2. Change the site to the actual site name in your domain (lines 37-39)
$Site1DN = "OU=Site1,DC=yourdomain,DC=com"
$Site2DN = "OU=Site2,DC=yourdomain,DC=com"
$Site3DN = "OU=Site3,DC=yourdomain,DC=com"
3. Change the domain name to yours (line 46)
'CN=Computers,DC=yourdomain,DC=com'
4. Modify the PowerShell execution policy, and use Get-ExecutionPolicy to query the default execution policy of the system, if Restricted
Please change it to RemoteSigned:Set-ExecutionPolicy RemoteSigned
Or Unrestricted: Set-ExecutionPolicy Unrestricted
If necessary, you can add PowerShell to the scheduled task (Powershell-file "D:\ Script\ PowerShell-MoveActiveDirectoryComputerByIPSubnet-AD2008R2") and execute it automatically on a regular basis, so that you can automatically move your computer to the specified OU. For more information, please refer to the article: step 4 in http://hubuxcg.blog.51cto.com/2559426/1309431#590523!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.