Share via

Azure Active Directory PowerShell "powershell the input object cannot be bound to any parameters for the command because the command does not take pipeline input"

Anonymous
2016-07-20T13:58:29+00:00

I am trying to run below command but getting error message in Bold as shown below..

PS C:> Import-Csv -Path 'C:\filename.csv' | Get-MsolUser -MaxResult 500

Get-MsolUser : The input object cannot be bound to any parameters for the command either because the command does not

take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

At line:1 char:76

+ Import-Csv -Path 'C:\filename.csv' | Get-M ...

+                                                                            ~~~~~

+ CategoryInfo          : InvalidArgument: (@{11004090@s***...694@s****a.com}:PSObject) [Get-MsolUser], ParameterB

indingException

Even try do following but returning all users

PS C:> Import-Csv -Path 'C:\filename.csv' | foreach-object {Get-MsolUser -MaxResult 500}

(Domain name is masked by forum moderator.)

Microsoft 365 and Office
Microsoft 365 and Office

A comprehensive suite of productivity tools and cloud services that enhance collaboration, communication, and efficiency. Combining classic Office apps with advanced Microsoft 365 features, it supports both personal and business needs

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-07-22T05:29:34+00:00

Hi Farrukh,

You can use this script to read the file and get their information on the server.

import-csv c:\temp\Book1.csv | foreach {get-msoluser -UserPrincipalName $_.UserPrincipalName} | Select-Object UserPrincipalName, DisplayName, ImmutableId, WhenCreated

Let us know if this is what you expected.

Thanks,

Mike

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-07-21T10:58:36+00:00

    Thanks Mike

    can you tell me what is wrong with my command with resepect to get-msoluser

    what you have shown above is Okay, but here is what I am trying to do, hope it will clarify further.

    inputfile.csv contains following column

    userprincipalname

    ******@domain.com

    ******@domain.com

    ******@domain.com

    ........

    .......

    .......

    ......

    ******@domain.com

    what I am trying to do now is to read this file using get-content or import-csv and pass this list of user to get-msoluser command to retrive there displayname, immutableid.

    tried below but getting the error posted earlier

    import-csv -path c:\temp\inputfile.csv | get-msoluser -all | select displayname, immutableid

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-07-21T10:00:16+00:00

    Hi Farrukh,

    You can use the script below to read and display the users in your file.

    PS Import-Csv c:\temp\Book1.csv

    Note*: You’re using Get-MsolUser command incorrectly that’s why you encounter the error. You can check this article for the format of the command.

    Let us know if this is what you expected.

    Thanks,

    Mike

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-07-21T04:50:17+00:00

    The requirement is quite simple, I want to read list of users from a file and get their user principlalname, immutable and Display name.

    Thanks

    Farrukh

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-07-20T17:56:45+00:00

    Hi Farrukh,

    With the pipeline operator “|”, the output of the first command will be used as input to the next command.

    In your scenario, the command “Get-MsolUser” can be executed without the output of the previous command, so it returns the above error message.

    Given the situation, I suggest you share more details about the exact requirement.

    Regards,

    Jiaxing Bian

    Was this answer helpful?

    0 comments No comments