User Profile
JernejP
Microsoft
Joined 5 years ago
User Widgets
Recent Discussions
Using PowerShell to create 15k accounts and email account data
Hi, We have a project where we will have to create 15000 new user accounts. I will get the information for the users (such as first name, last name, and email address where to send account info) in a CSV file. I figure out the account creation part (and licensing), but I'm a bit stuck when it comes to emailing them. First - I'm assuming sending 15k emails will hit some limits, and I don't want to get our domain blacklisted. Is there a way to queue them, and have the sever send them in chunks? Second - I can't seem to be able to send emails at all. This is the code I have currently: # Get the credential $UserName = "account@domain.com" $PWord = ConvertTo-SecureString -String "myPassword" -AsPlainText -Force $credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $UserName, $PWord ## Define the Send-MailMessage parameters $mailParams = @{ SmtpServer = 'smtp.office365.com' Port = '587' UseSSL = $true Credential = $credentials From = 'account@domain.com' To = 'myEmail@email.com' Subject = "Sending: $(Get-Date -Format g)" Body = 'This is a test email' DeliveryNotificationOption = 'OnFailure', 'OnSuccess' } ## Send the message Send-MailMessage @mailParams But I keep getting the following error: Send-MailMessage : Unable to read data from the transport connection: net_io_connectionclosed. At C:\SMail.ps1:21 char:1 + Send-MailMessage @mailParams + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage Any ideas what's wrong? The username and password are correct. Thanks4.3KViews0likes7CommentsProvisioning a team with hundreds of guest users
Hi, I was wondering how would I go about provisioning a team that will have hundreds of guest users? I looked at PowerShell and School Data Sync, but it's only possible to add members within the organization. Is there a way to add 13.000 guests (in an origination with about 250 employees), without having to add them individually? It's an EDU tenant. ThanksSolved2.1KViews0likes9Comments
Groups
Recent Blog Articles
No content to show