Move Computers to specific OU
hi,
i'm looking script can run on our computers container , check computers in there. example:
sts001 or sps002 or sms003
those servers joined domain using djoin. need move them automatically correct ou.
for example:
sts001 needs move to: org/servers/test
sps002 needs move to: org/serves/production
sms003 needs move to: org/servers/management
i found various scripts, not worked out me (as new scripting). powershell, vbscript, whatever needs our requirements ok. our policy not allow run scripts on dc. perfect after installed servers, joined them , after can run script , servers move correct ou.
any great. thanks
this looks easy script, what's missing according rules should moved. base of script following:
[array]$computers = <an enumeration of computers> import-module activedirectory foreach ($computer in $computers) { #nested ifs or switch, depending on possibilities { get-adcomputer $computer | move-adobject -targetpath "<the target ou's distinguished name>" } } my grandmother used say: "::1: sweet ::1:"
Windows Server > Windows PowerShell
Comments
Post a Comment