In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
# #
# move the client host to the specified OU #
# V1.0 #
# yuanzhe #
# add ActiveDirectory power shell module #
Import-Module ActiveDirectory
# assign Windows7 Enterprise Edition to the variable #
# $windows7enterpise=Get-ADComputer-SearchBase "CN=Computers,DC=ljstaff,DC=com"-Filter {OperatingSystem-eq "Windows 7 Enterprise Edition"}-Properties OperatingSystem,OperatingSystemVersion | select OperatingSystem,OperatingSystemVersion
$windows7enterpise = "Windows 7 Enterprise Edition"
# assign the Windows7 flagship version to the variable #
$windows7Uitimate= "Windows 7 Ultimate Edition"
# assign the Windows10 Enterprise Edition to the variable #
$windows10Enterpise= "Windows 10 Enterprise Edition"
# assign Windows 10 Professional Edition to variables #
Windows10ProfessionalEdition= "Windows 10 Professional Edition"
# View all computers in the computers directory #
$computers=Get-ADComputer-SearchBase "CN=Computers,DC=windows,DC=com"-Filter *-Properties OperatingSystem,OperatingSystemVersion
# add OU directory of domain host #
$dasou= "ou=das,dc=windows,dc=com"
Foreach ($lscomputer in $computers)
{
# move the Windows 7 Enterprise Edition computer under computers OU to DAS OU #
If ($lscomputer.OperatingSystem-eq "$windows7enterpise") {
Move-ADObject-Identity $lscomputer-TargetPath $dasou
# pause #
# Pause
}
# move the Windows 7 Ultimate Edition computer under computers OU to DAS OU #
If ($lscomputer.OperatingSystem-eq "$windows7Uitimate") {
Move-ADObject-Identity $lscomputer-TargetPath $dasou
# pause #
# Pause
}
# move the Windows 10 Enterprise Edition computer under computers OU to DAS OU #
If ($lscomputer.OperatingSystem-eq "$windows10Enterpise") {
Move-ADObject-Identity $lscomputer-TargetPath $dasou
# pause #
# Pause
}
# move the Windows 10 professional version of the computer under computers OU to DAS OU #
If ($lscomputer.OperatingSystem-eq "$windows10ProfessionalEdition") {
Move-ADObject-Identity $lscomputer-TargetPath $dasou
# pause #
# Pause
}
}
Make a task plan
Run the script every 4 hours
Add parameter
Program script: powershell # run tool
Add parameters: C:\ script\ Movecomputer.ps1 # script path
Start with: C:\ script\ # specify the program directory
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.