SquigglyMonkey
asked on
Help with script to get OU of specific computer objects (from CSV)
I am trying to display the OU of a set of computer objects in Active Directory(from CSV)
I wrote this up and, it doesn't do anything, seems like a simple thing....
I wrote this up and, it doesn't do anything, seems like a simple thing....
import-module activedirectory
$cred = Get-Credential
import-CSV C:\Users\ME\Desktop\scripts\servers.csv |
foreach-object {
Get-ADComputer $_.name -Properties * | FT name, Distinguishedname
}
This works fine, if I give it a server name "Get-ADComputer servername -Properties * | FT name, Distinguishedname"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER