[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

make an existing script read from a csv file

Hi I have a snippet of power shell code to change the max send email size
SET-Mailbox –Identity Janas –MaxSendSize 1038400
i need the users to be read from a csv file instead any help much appreciated
thanks
0
davidm27
Asked:
davidm27
1 Solution
 
Shabarinath RamadasanInfrastructure Specialist - MicrosoftCommented:
Try this.. Create a CSV file named users.csv

$list = Import-Csv "users.csv"

foreach($samaccountname in $list)
{
SET-Mailbox –Identity $samaccountname –MaxSendSize 1038400
}

 
0
 
davidm27Author Commented:
thanks
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now