Solved

Move localhost to different OU via Powershell

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

19 Experts available now in Live!

Get 1:1 Help Now