Sign in
|
Join PowerShell.com!
|
Help
Home
PowerTips
Ask the Experts
Forums
Webcasts
Blogs
eBook
Script Library
Twitter Grid
Modules
QuickClick
Scripts
Snippets
Videos
Library
»
Script Library
»
Active Directory
»
Move computer to required OU based on computer model
Move computer to required OU based on computer model
Share
|
Browse Library
Module Library
QuickClick Library
Script Library
Active Directory
BizTalk
Citrix
Clustering
Desktop
Exchange Server 2003
Exchange Server 2007
File System
Group Policy
Internet Information Server (IIS)
Local Accounts
Logs
Microsoft Office
Microsoft Team Foundation Server
MySQL
Networking
Registry
Remote Desktop Services
Remoting
Security
SharePoint
SQL Server
System Center Virtual Machine Manager
System Center Configuration Manager
System Center Operations Manager
Tutorial
Terminal Server
Using .Net
Virtual Server
VMware
Windows 7
Windows HPC
Windows Server 2000
Windows Server 2003
Windows Server 2008
Windows XP
WMI
Misc
Snippet Library
Video Library
Members Only
Tags
Active Directory
ad
Administrator
ADSI
AltRecipient
Computer
Container
Deleted
DirectorySearcher
domain
Domain Controller
Exchange
Exchange 2003
Forest
fsmo
Group
Member
OU
Password
search
Security
Site
Tombstone
User
Users
View more
Previous
|
Next
|
View all files
|
View Slideshow
Download
posted by
Felipe
08-31-2010
Downloads: 227
File size: 828 B
Views: 1,209
Embed
Move computer to required OU based on computer model
#Written by Felipe Binotto
#On the 1st of September of 2010
#Move computer to required OU based on it's model
#Import required module
Import-Module
(
get-pssnapin
Quest.ActiveRoles.ADManagement
-Registered
).
ModuleName
-WarningAction
SilentlyContinue
#Gets computer and model
$Computer
=
(
Get-WmiObject
-Class
Win32_ComputerSystem).
name
$model
=
(
Get-WmiObject
-Class
Win32_ComputerSystem).
model
#Move computer to required OU
if
(
$model
-match
"D620"
-or
$model
-match
"D630"
-or
$model
-match
"E6400"
-or
$model
-match
"E6410"
){
Move-QADObject
(
Get-QADComputer
$computer
).
DN
-NewParentContainer
'staff.vuw.ac.nz/VUW_Workstations/Win7_Test/W7Desktops'
|
Out-Null
}
else
{
Move-QADObject
(
Get-QADComputer
$computer
).
DN
-NewParentContainer
'staff.vuw.ac.nz/VUW_Workstations/Win7_Test/W7Laptops'
|
Out-Null
}
Requires the Quest ActiveRoles ADManagement
Copyright 2011 PowerShell.com. All rights reserved.