2011ComputerMan
Members-
Posts
5 -
Joined
-
Last visited
-
Password reset through SMS
2011ComputerMan replied to 2011ComputerMan's topic in Windows Server 2008 R2
I though at much as that is where I have placed the number on our test account. However we are still getting the number not found issue. I have tried the number in +4472345678 4472345678 and 071234567 formats with no avail. Do you have any suggestions as it seems I have implemented everything as it should be? I would really like to get this in place so any help would be great.- 4 replies
-
- exchange 2010
- powershell
-
(and 1 more)
Tagged with:
-
Password reset through SMS
2011ComputerMan replied to 2011ComputerMan's topic in Windows Server 2008 R2
Thanks for your reply. The latter part is not working. Users smart phones are able to send an sms to the email address and the carrier then converts it to email and it ends up in the Reset email box. This part is fine. The part that is not working is when we run the script against the unread emails in the Reset email box. We end up getting this result; Phone number +4471234567 not found which suggests to me it is not looking in the right place for the users mobile number. But where is the right place? Hope this is a bit more clear. Regards.- 4 replies
-
- exchange 2010
- powershell
-
(and 1 more)
Tagged with:
-
Hello, I am working on a project in my workplace to try and cut down the amount of password resets we do. The theory is that a user sends a message to [email protected] and then it sends them a reset link back and then they can log in. To do this I have a script that will run on the Server against the reset mailbox. The script now runs without any errors in the Shell just the system never knows the mobile number in question. Here is the script #Add Quest Active Directory Management snapinAdd-PSSnapin Quest.ActiveRoles.ADManagement #Configuration Block $SmtpServer = "smtp.domain.com" $ResetEmail = "[email protected]" $Username = "reset" $Password = "Password" $Domain = "Domain" $MailServer = "https://server.domain.com/ews/exchange.asmx" #Download for file is here: http://www.microsoft.com/en-us/download/details.aspx?id=35371 [Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll") function Create-RandomString() { $aChars = @() $aChars = "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "C", "b", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "2", "3", "4", "5", "6", "7", "8", "9", "_", ";" $intUpperLimit = Get-Random -minimum 8 -maximum 10 $x = 0 $strString = "" while ($x -lt $intUpperLimit) { $a = Get-Random -minimum 0 -maximum $aChars.getupperbound(0) $strString += $aChars[$a] $x += 1 } return $strString } $email = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010) $email.Credentials = New-Object Net.NetworkCredential($Username, $Password, $Domain) $uri=[system.URI] $MailServer $email.Url = $uri $inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($email,[Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox) if ($inbox.UnreadCount -gt 0) { $PropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties) $PropertySet.RequestedBodyType = [Microsoft.Exchange.WebServices.Data.BodyType]::Text; # Set search criteria - unread only $SearchForUnRead = New-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.EmailMessageSchema]::IsRead, $false) $items = $inbox.FindItems($SearchForUnRead,10) #return only 10 unread mail items foreach ($item in $items.Items) { # load the property set to allow us to view the body $item.load($PropertySet) if($item.Body.text -Like "*") { $Phone = $item.From.address $Phone = $item.From.address.substring(0, $Phone.IndexOf("@")) $user = get-qaduser -MobilePhone $Phone If ($user -ne $null) { $PW = Create-RandomString if ($PW.length -gt 6) { Set-QADUser -identity $user.samaccountname -UserPassword (ConvertTo-SecureString -AsPlainText $PW -Force) Unlock-QADUser -identity $user.samaccountname $PasswordAge = (Get-QADUser $user |select-object PasswordLastSet) if ($PasswordAge.PasswordLastSet -ge (Get-Date).AddMinutes(-1)){ $Body = "Password reset for " + $user.SamAccountName + "-" + $user.DistinguishedName send-mailmessage -to $ResetEmail -from $ResetEmail -subject "Password Reset" -body $Body -SmtpServer $SmtpServer send-mailmessage -to $item.From.address -from $ResetEmail -subject " " -body "Your password is now $PW" -SmtpServer $SmtpServer } } } else { send-mailmessage -to $ResetEmail -from $ResetEmail -subject "Invalid Phone number" -body "Phone number $Phone not found" -SmtpServer $SmtpServer send-mailmessage -to $item.From.address -from $ResetEmail -subject " " -body "Your phone number was not found." -SmtpServer $SmtpServer } } $item.Isread = $true $item.Update([Microsoft.Exchange.WebServices.Data.ConflictResolutionMode]::AlwaysOverwrite) } } If anybody has any advice on this then it woudl be much appreciated. I am convinced the number is in the wrong place just I am unsure where line number 51 and 52 - $Phone = $item.From.address is pointing too. Regards, Adam
- 4 replies
-
- exchange 2010
- powershell
-
(and 1 more)
Tagged with:
-
Thank you for all your replies. Lorensbergs Ltd got in touch with the institution I work in and provided some help with this issue. I can now confirm the issue has been resolved and was due to a extremely dated version of Net Loan that the previous networking guys never updated. The version has now been updated and is working well. Logging in to the workstation in under 10 seconds. Thanks again for your help.
- 3 replies
-
- net loan
- slow workstation
-
(and 2 more)
Tagged with:
-
Hello All, In the college where I work we use a software called "Net Loan" to monitor the time our students are spending on the library computers. This software works great as it allows us to limit the time users spend at the workstations and does not allow them to log back in for a while after the time limit has been exceeded. With all that being said the software is also terrible as it sits over the top of the operating system and subsequently uses a tremendous amount of resources which slows the computer down and makes it very stressful for students to use. This is most noticeable at the Net Loan login screen (which replaces the Windows login screen). It can take up to 15 minutes for a user to get logged on. Can anybody suggest an alternative to this Net Loan software? I thought about writing a login script which automatically tells the user they will be logged off after X time has passed. However what will stop them just logging back in? Any suggestions will be much appreciated. Regards
- 3 replies
-
- net loan
- slow workstation
-
(and 2 more)
Tagged with:

