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 }