Solved

Move localhost to different OU via Powershell

Posted on 2014-01-03
1
471 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 18

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Hi all.   The other day I had to change the passwords for a bunch of users on the fly. Because they were so many, I decided to do it in an automated way and I would like to share it with you all.   If you are not doing it directly in a Domain Co…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now