Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Can anyone help with an AD PowerShell script?

$
0
0

Hi all,

I have a script that imports a csv file.  The CSV file has the following headers:
Name,Operating_System,_Domain_,MAC_Address,Vendor

The script then is supposed to use the Get-ADComputer cmdlet to show all the properties of each object in the csv file.  The script is below:

$PassportComputers = Import-csv ".\Passport Network Installation.csv"
foreach ($Computer in $PassportComputers)
{
    Get-ADComputer -Identity $Computer.Name -Filter *
}

However, I get an error like below for each object in the file:

Get-ADComputer : Parameter set cannot be resolved using the specified named parameters.

At PathBlankedOut\PassportNetInstall.ps1:4 char:5

+     Get-ADComputer -Identity $Computer.Name -Filter *

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Get-ADComputer], ParameterBindingException

    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.ActiveDirectory.Management.Commands.GetADComputer


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>