Solved

Move localhost to different OU via Powershell

Posted on 2014-01-03
1
485 Views
Last Modified: 2014-01-12
Please advise howto move a host to a different OU.
It is done with move-adobject -identity ... -targetpath ... but the identity should be the localhost (on which I run the poweshell).

J.
0
Comment
Question by:janhoedt
1 Comment
 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
ID: 39755369
Try this
$thishost=localhost
Move-ADObject -Identity (Get-ADComputer $thishost).objectguid -TargetPath 'ou=charlotte,dc=iammred,dc=net

OR

$computer=$env:COMPUTERNAME
Move-ADObject -Identity (Get-ADComputer $computer).objectguid -TargetPath 'ou=charlotte,dc=iammred,dc=net
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help you understand what HashTables are and how to use them in PowerShell.
A procedure for exporting installed hotfix details of remote computers using powershell
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question