Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Null Identity error when trying to get SAM accountname

$
0
0

Hi, I am trying to run real simple script to get the SAMaccountname from a text file. I am a supernoober with PowerShell. Every time I run this command I receive the following error.

Get-ADUser : Cannot validate argument on parameter 'Identity'. The Identity property on the argument is null or empty.

At line:1 char:60

+ Import-CSV C:\admin\users.txt | foreach-object {get-aduser $_ -proper ...

+                                                            ~~

    + CategoryInfo          : InvalidData: (:) [Get-ADUser], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ActiveDirectory.Management.Commands.GetADUser

Import-CSV C:\admin\users.txt | foreach-object {get-aduser $_ -properties * |select-object displayname, SAMAccountname }


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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