Multiple User Details Report throught txt in PowerShell
Users Txt File.
$users = Get-Content C:\Userlist.txt
$results = foreach ($user
in $users)
{
Get-ADUser $user -Properties
* | select Samaccountname, Name,DistinguishedName
,UserPrincipalName,Enabled,userWorkstations,mail,badPwdCount,employeeID,LockedOut
}
$results | Out-GridView
For CSV Export
$results | Export-csv
C:\userlistresult.txt –NoTypeInformation
No comments:
Post a Comment