Solved

Move localhost to different OU via Powershell

Posted on 2014-01-03
1
488 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
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…

751 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