We help IT Professionals succeed at work.
Get Started

How can i get the object information of a list of servers from powershell

Jason Yu
Jason Yu asked
on
98 Views
Last Modified: 2016-03-21
I have a list of over 20 servers need to know their current OU/location and move them to a new OU.

I already used the following command to collect these servers, but i don't know which command I need use to get their current object/OU information, can someone here help?

Thanks.

PS C:\Windows\system32> Get-ADComputer -Filter {Name -like "*host*"} | select Name

Name
----
DAL-OHOST-FS
MIA-OHOST-01
STA-OHOST-01
VCR-OHOST-01
BPDR-OHOST-01
MTY-OHOST-01
NVA-OHOST-01
PRI-OHOST-01
PRI-1D-SCHOSTAG
DUR-OHOST-01
HOU-OHOST-FS
SFO-OHOST-01
ATL-OHOST-01
WAL-OHOST-01
PHI-OHOST-01
BOS-OHOST-01
MTL-OHOST-01
DAL-OHOST-01
CAL-OHOST-01
HOU-OHOST-01
WDC-OHOST-01
MCL-OHOST-01
LOM-OHOST-01
CHI-OHOST-01
MEX-OHOST-01
MIN-OHOST-01
NA-EXCHHOST-01
GLN-OHOST-01
NYC-OHOST-01
LAX-OHOST-01
TOR-OHOST-01
BUR-OHOST-01
TDC-OHOST-01
POR-OHOST-01
DA3-OHOST-01
CBS-OHOST-01
PRI-1B-SCHOSTAG
Comment
Watch Question
PowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 2 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE