{"id":356,"date":"2020-03-23T20:06:37","date_gmt":"2020-03-23T20:06:37","guid":{"rendered":"http:\/\/certcent.io\/?p=356"},"modified":"2020-03-23T20:06:37","modified_gmt":"2020-03-23T20:06:37","slug":"resetting-passwords-and-sending-temporary-passwords-via-text","status":"publish","type":"post","link":"https:\/\/certcent.io\/index.php\/2020\/03\/23\/resetting-passwords-and-sending-temporary-passwords-via-text\/","title":{"rendered":"Resetting passwords and sending temporary passwords via text."},"content":{"rendered":"<p>Recently after looking at &#8220;Risky Users&#8221; in our Office 365 tenant, I found many users that could use a password reset.  I wanted to make sure these users would receive a temp password via cell phone.<br \/>\nThis function will take a filter param company and reset each user and text them a password given they have ATT, T-Mobile, or Verizon.<\/p>\n<pre class=\"lang:default decode:true \" title=\"simple function to reset and text temp password\"># First connect to your tenant\nconnect-msoluser\nFunction Reset-PassandText {param ($user,$smtpemail,$creds)\n$textnumber = ((Get-MsolUser -UserPrincipalName $user | select MobilePhone).PhoneNumber).Replace(\"-\",\"\")\n$password = Set-MsolUserPassword -ForceChangePassword $true -UserPrincipalName $user\nSend-MailMessage -Body \"$password\" -To $textnumber@vtext.com -SmtpServer smtp.office365.com -Credential $creds -From $smtpemail -Subject \"Temp Password\" -Port 587 -UseSsl\n}\n# Enter SMTP Server Creds (make sure this user can send or SMTP authenticate\n$smtpcredentials = get-credentials\n# Run the Function\nReset-PassandText -User email@mydomain.com -smtpemail passwordreset@mydomain.com -Creds $smtpcredentials<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently after looking at &#8220;Risky Users&#8221; in our Office 365 tenant, I found many users that could use a password reset. I wanted to make sure these users would receive a temp password via cell phone. This function will take a filter param company and reset each user and text them a password given they&hellip; <a class=\"more-link\" href=\"https:\/\/certcent.io\/index.php\/2020\/03\/23\/resetting-passwords-and-sending-temporary-passwords-via-text\/\">Continue reading <span class=\"screen-reader-text\">Resetting passwords and sending temporary passwords via text.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/356"}],"collection":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":0,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"wp:attachment":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}