tag:blogger.com,1999:blog-4262690568972857623.comments2024-03-11T18:00:51.306+00:00Lets ExchangeNuno Motahttp://www.blogger.com/profile/02579565400597081970noreply@blogger.comBlogger714125tag:blogger.com,1999:blog-4262690568972857623.post-57951664430706413372024-02-06T11:45:37.921+00:002024-02-06T11:45:37.921+00:00Glad it helped! :)Glad it helped! :)Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-1537781387657644482024-02-06T11:17:36.842+00:002024-02-06T11:17:36.842+00:00Exactly what In needed, helped me determine that a...Exactly what In needed, helped me determine that a certain mailbox had over 6 million(!) emails in the inbox folder, thank you!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-34176605218011626612023-12-15T15:33:25.371+00:002023-12-15T15:33:25.371+00:00Thank you for the feedback! Glad it helped! :)Thank you for the feedback! Glad it helped! :)Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-58105305715075201772023-12-14T01:05:46.845+00:002023-12-14T01:05:46.845+00:00You are my hero sir, after hours of updating I did...You are my hero sir, after hours of updating I did a restart on a exchange server and had the same problem, found out another guy changed the certificate a few weeks ago, everything worked until the restart, so thank you very much. Now 2am and you saved me a few hours of workAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-10194333176934067202023-10-31T14:28:40.143+00:002023-10-31T14:28:40.143+00:00Glad to hear it helped! :) Thank you for the f...Glad to hear it helped! :) Thank you for the feedback!!Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-35076523565365806002023-10-26T00:21:34.962+01:002023-10-26T00:21:34.962+01:00I wanted to let you know that your script saved me...I wanted to let you know that your script saved me a bunch of time. Thank you very much for taking the time to create such a useful script.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-69483021742029134552023-10-17T18:00:13.927+01:002023-10-17T18:00:13.927+01:00MessiMessiAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-21915049192647468022023-08-09T15:08:44.676+01:002023-08-09T15:08:44.676+01:00Glad it helped! :)Glad it helped! :)Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-71449865637207444712023-08-08T16:43:04.643+01:002023-08-08T16:43:04.643+01:00This just helped me fix an issue I had with transp...This just helped me fix an issue I had with transport logs disappearing in Exchange 2016. Thank you!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-7142603125165730282023-06-20T09:01:08.738+01:002023-06-20T09:01:08.738+01:00Glad it helped! :)Glad it helped! :)Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-69019436130754103112023-06-19T15:19:11.443+01:002023-06-19T15:19:11.443+01:00Saved my bacon! Thank you very much for sharing th...Saved my bacon! Thank you very much for sharing this solution : ) Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-29483163349408252112023-05-23T16:37:30.211+01:002023-05-23T16:37:30.211+01:00heheheheAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-61209500631158148002023-04-14T14:14:02.788+01:002023-04-14T14:14:02.788+01:00Can you show me your code please?Can you show me your code please?Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-86639381648739339502023-04-11T09:51:43.909+01:002023-04-11T09:51:43.909+01:00Unable to get OAuth token using MSAL: 'Cannot ...Unable to get OAuth token using MSAL: 'Cannot process argument transformation on parameter 'ClientSecret'. Cannot convert the "#########" value of type "System.String" to type "System.Security.SecureString".'. Exiting script. After chaning the certthumprint to Secret. Can you please suggest.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-9643207084430929232023-03-27T09:54:23.379+01:002023-03-27T09:54:23.379+01:00Thank you. I kept getting "Parameter incorrec...Thank you. I kept getting "Parameter incorrect" and I searched online for that error. I had to append certstorename=MY<br /><br />C:\Windows\system32>netsh http add sslcert ipport=0.0.0.0:8192 certhash="xyz" appid="{abc}" certstorename=MYAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-34314924944515771582023-03-13T12:37:10.653+00:002023-03-13T12:37:10.653+00:00Thanks for letting me know. Glad it helped! :) ...Thanks for letting me know. Glad it helped! :) Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-26820280016876079972023-03-13T09:12:27.849+00:002023-03-13T09:12:27.849+00:00Thank you so much, you just saved me hours of work...Thank you so much, you just saved me hours of work.Declan Connornoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-63412519327100196982023-03-02T14:53:27.590+00:002023-03-02T14:53:27.590+00:00The following should do it :)
Remove the follow...The following should do it :)<br /><br />Remove the following line:<br />$ClientCertificate = Get-Item "Cert:\CurrentUser\My\$Secret"<br /><br />And update this line:<br />$token = Get-MsalToken -ClientId $ClientID -TenantId $TenantID -ClientCertificate $ClientCertificate -ErrorAction Stop<br /><br />To this:<br />$token = Get-MsalToken -ClientId $ClientID -TenantId $TenantID -ClientSecret $Secret -ErrorAction StopNuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-38802713759777048572023-03-01T17:36:00.979+00:002023-03-01T17:36:00.979+00:00Hello Nuno, Thank you for this script. I have repl...Hello Nuno, Thank you for this script. I have replaced all "CertThumprint" with "Secret" and updated these; [Parameter(Mandatory = $False)]<br /> [String] $ClientID = "xxxxxxxxxxxxxxxxxxx",<br /><br /> [Parameter(Mandatory = $False)]<br /> [String] $Secret = "xxxxxxxxxxx",<br /><br /> [Parameter(Mandatory = $False)]<br /> [String] $TenantID = "xxxxxxxxxxxxxxxxx"<br />)<br /><br />I guess I am not understanding how to update this section; Function Get-OAuthToken {<br /> Param ($ClientID, $TenantID, $Secret)<br /><br /> Try {<br /> Import-Module MSAL.PS -ErrorAction Stop<br /> } Catch {<br /> Write-Log -Type "ERR" -Message "Unable to import MSAL PowerShell module: '$($_.Exception.Message)'. Exiting script."<br /> Exit<br /> }<br /><br /> Try {<br /> $ClientCertificate = Get-Item "Cert:\CurrentUser\My\$Secret"<br /> $token = Get-MsalToken -ClientId $ClientID -TenantId $TenantID -ClientCertificate $ClientCertificate -ErrorAction Stop<br /><br /> # Get token expiration date and time so we can renew it 2 minutes before it expires<br /> $global:tokenExpireDateTime = (Get-Date $token.ExpiresOn.DateTime).AddSeconds(-120)<br /><br /> Return $token.AccessToken<br /> } Catch {<br /> Write-Log -Type "ERR" -Message "Unable to get OAuth token using MSAL: '$($_.Exception.Message)'. Exiting script."<br /> Exit<br /> }<br />}<br /><br />I know I need to update the ClientCertificate with Secret in some way, but I am not sure exactly how to do that? <br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-35918879869949729892023-02-15T15:14:35.817+00:002023-02-15T15:14:35.817+00:00Glad it helps! :)Glad it helps! :)Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-54233356125862516852023-02-15T14:41:39.414+00:002023-02-15T14:41:39.414+00:00ty, gets me every year, this is much easier than m...ty, gets me every year, this is much easier than muddling through gui.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-23858960685541570272023-02-13T09:38:38.108+00:002023-02-13T09:38:38.108+00:00Which version of PowerShell are you using? Are you...Which version of PowerShell are you using? Are you able to "manually" (outside of the script) use the MSAL module to retrieve a token?Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-53264823640396618442023-02-13T09:36:05.051+00:002023-02-13T09:36:05.051+00:00Hi. Is that meeting room in Exchange Online? Does ...Hi. Is that meeting room in Exchange Online? Does it work for other meeting rooms? Try printing the value of $uri at the start of the Query-GraphAPI function. Nuno Motahttps://www.blogger.com/profile/02579565400597081970noreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-34869835935160053052023-02-10T16:39:08.239+00:002023-02-10T16:39:08.239+00:00I am getting this error see below I am using ,net ...I am getting this error see below I am using ,net 4.8 a self signed cert and have change the cert to a RSA cert instead of CNG still same error any help would be appreciated <br /><br />Unable to get OAuth token using MSAL: 'Could not use the certificate for signing. See inner exception for details. Possible cause: this may be a known issue with apps build against .NET Desktop 4.6 or lower. Either target a higher version of .NET desktop - 4.6.1 and above, or use a different certificate type (non-CNG) or sign your own assertion as described at https://aka.ms/msal-net-signed-assertion. '. Exiting script.<br />Jamesnoreply@blogger.comtag:blogger.com,1999:blog-4262690568972857623.post-24520497423289389322023-02-10T14:42:21.544+00:002023-02-10T14:42:21.544+00:00Can you help with this error I am getting what res...Can you help with this error I am getting what result is it looking for??<br /><br />Unable to get OAuth token using MSAL: 'Exception calling "GetResult" with "0" argument(s): "Invalid provider type specified."'. Exiting script.Jamesnoreply@blogger.com