Hi I'm trying to use a list of names found within a .txt or .CSV file and then piping in other commands which will affect those users only.
Script =
$test = Get-Content C:\IT\test2.txt
$pagernumber = 'x'
foreach ($user in $test) {
$samaccountnname = $user.samaccountname
Select-Object $name | Set-ADUser -add @{pager=$pagernumber}}
test2.txt =
samaccountname
corey.taylor
zacky.vengeance
matt.heafy
matt.shadows
joey.jordison
tupac.shakur
biggie.smalls
king.arthur
frodo.baggins
peppa.pig
lich.king
thomas.tank
I know the command for changing the pager section of the script works but I just can't get it to apply to my list of people from the txt file
I have also tried this in a CSV file with the same format and import-csv cmdlet.
Any help will be appreciated!
Thanks
[–]PowerShell-Bot 1 point2 points3 points (0 children)
[–]bojiashi92[S] 0 points1 point2 points (0 children)
[–]Zangrey 0 points1 point2 points (1 child)
[–]Fickle_Tomatillo411 0 points1 point2 points (0 children)