Find Jobs
Hire Freelancers

Powershell script for new account creation - reset password, send email and add to group

€30-250 EUR

En cours
Publié il y a plus de 4 ans

€30-250 EUR

Payé lors de la livraison
Hello, I'm looking to optimize and finish one of our scripts following need: Either on the event AD account creation or once per day with a search filter all new accounts need to: * Reset a password * add to a group * send an email to the new user. Accounts are created by an external system, so account creation is NOT needed. Just that the accounts are provisioned with a temp password which we don't know. And we would like to send a welcome email with a PDF attached to the newly created accounts. The trigger either being the Active directory account creation or in the morning with a scheduled task emailing all accounts created D-1 We have a basis, that you can use (or not): ##Beginning of functions Function Send-Email { Param ($Email, $Credential,$attachment) $From = "Hello@[login to view URL]" $subject = "Welcome to CompanyX" $SMTPServer = "[login to view URL]" $SMTPPort = "587" ### Beginning of email body $Body = "Hello New user!,<br><br>" $Body += "Welcome to CompanyX! <br><br>" $Body += " This email will help you log in to Workday and Azure update your personal information before you start. <br><br>" $Body += "Step 1. Enter your username (username)<br><br>" $Body += "Step 2. Enter your password $UserPassword <br><br>" $Body += " Please refer to the attached PDF for more information <br><br>" $Body += "<br><br>" $Body += "Looking forward to see you around,<br><br>" $Body += "CompanyX Corporate " ### End of email body Send-MailMessage -from $From -to $Email -Subject $subject -BodyAsHtml $Body -Attachments $attachment -SmtpServer $SMTPServer -Port $SMTPPort -Credential $Credential -UseSsl } ### End of Functions ##### Beginning of main function $When = ((Get-Date).AddDays(-1)) $UserName = "hello@[login to view URL]" #Gmail username which is used for sending an email $Password = Get-Content "C:\CareBears\[login to view URL]" | ConvertTo-SecureString #Reading a secure password from file and reversing it back into a secure string object $Credential = New-Object -TypeName [login to view URL] -ArgumentList ($UserName, $Password) #PSCredential for send-mail message cmdlet $Attachment = "C:\CareBears\[login to view URL]" #PDF sending as an attachment with email ### Not finished ---- WIP ### $UserPassword = Get-Random -maximum 20000 -Minimum 100 ### $UserPassword = "@" + "user" + $[login to view URL]() ### $UserPrincipalName = ($[login to view URL] + ”@[login to view URL]”) foreach ($EmailAddress in Get-ADUser -filter {(whencreated -ge $When)} -Properties emailaddress | Select -ExpandProperty emailaddress) #Iterating over each email of users { Send-Email -Email $EmailAddress -Credential $Credential -attachment $Attachment Write-Host "Email sent: $EmailAddress" } ### End of main function
N° de projet : 21800226

Concernant le projet

1 proposition
Projet à distance
Actif à il y a 5 ans

Cherchez-vous à gagner de l'argent ?

Avantages de faire une offre sur Freelancer

Fixez votre budget et vos délais
Soyez payé pour votre travail
Surlignez votre proposition
Il est gratuit de s'inscrire et de faire des offres sur des travaux
1 freelance propose en moyenne €160 EUR pour ce travail
Avatar de l'utilisateur
Hi, I would like to work on this task and I will develop this in shell. I have five year of experience in this field. Please do let me know if we can discuss on this. Regards, Mayank
€160 EUR en 4 jours
5,0 (1 commentaire)
0,9
0,9

À propos du client

Drapeau de FRANCE
Paris, France
5,0
10
Membre depuis mai 13, 2019

Vérification du client

Merci ! Nous vous avons envoyé un lien par e-mail afin de réclamer votre crédit gratuit.
Une erreur a eu lieu lors de l'envoi de votre e-mail. Veuillez réessayer.
Utilisateurs enregistrés Total des travaux publiés
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Chargement de l'aperçu
Permission donnée pour la géolocalisation.
Votre session de connexion a expiré et vous avez été déconnecté. Veuillez vous connecter à nouveau.