User Profile
gregarican
Copper Contributor
Joined 7 years ago
User Widgets
Recent Discussions
Re: Microsoft.ACE.OLEDB.12.0 Issue
I just installed the ExcelDataReader Nuget package and all is well again. There was definitely a new wrinkle likely introduced with a recent Windows Update that affects the way that the OleDbDataReader interacts with Excel using the Microsoft.ACE.OLEDB.12.0 provider.1.4KViews0likes0CommentsMicrosoft.ACE.OLEDB.12.0 Issue
So I have a C# app that reads from Excel (using Microsoft.ACE.OLEDB.12.0) in order to then add those rows into a larger consolidated sheet. It's worked fine for a long time. Suddenly the past couple of weeks I received trouble reports from endusers that the app isn't functioning. When I debugged it, seems that the Excel source files have zero rows read. No runtime errors or anything. I have verified that the column headings are correct, against the OleDbCommand.CommandText query. And the column headings are based on a generic template that all of these source sheets use. The source sheets have rows of valid data. A year or two ago I recall there was a Windows Update that affected some of these Excel OLEDB operations. Due to MDAC era components being deprecated. Hence why I changed over to ACE OLEDB 12.0. Since I did that this app has run without fail. Anyone know if there was indeed a Windows Update that would've affected things? Running this on Windows 10 Pro. I can provide my source code, although it's been unmodified and is relatively verbose.Solved1.4KViews0likes1CommentRe: O365 Online Archiving Not Working
This was a great save for me as well. Our older users ported into M365 from on-prem Exchange for the most part had PST's imported in for their legacy local archive content. These older users were all stuck, in terms of their online archive not reflecting the data retention policy. Problem solved. Thanks for the tip!85KViews0likes0CommentsSQL Server 2008 R2 Nested Query with a Function
I am helping another SQL Server DBA with an issue they have with just a particular SQL Server 2008 R2 instance. I have run this query successfully on my own 2008 R2 instances, 2012 instances, etc. I'll list the query below. The sub-selects are pulling a single specific value from a table-valued function. We have verified that the referenced view column exists, we have verified that the function can be successfully run as a standalone outside of the sub-select, we have verified the customer ID is valid, etc. DECLARE @CustId varchar(12) SET @CustId = 'AA100168' SELECT CASE (select WORD from dbo.GETALLWORDS([Customers].[Anniversary],'-') where WORDNUM = 2) WHEN 'Jan' THEN 1 WHEN 'Feb' THEN 2 WHEN 'Mar' THEN 3 WHEN 'Apr' THEN 4 WHEN 'May' THEN 5 WHEN 'Jun' THEN 6 WHEN 'Jul' THEN 7 WHEN 'Aug' THEN 8 WHEN 'Sep' THEN 9 WHEN 'Oct' THEN 10 WHEN 'Nov' THEN 11 WHEN 'Dec' THEN 12 END AS AnnMonth, (select WORD from dbo.GETALLWORDS([Customers].[Anniversary],'-') where WORDNUM = 1) AS AnnDay, (select WORD from dbo.GETALLWORDS([Customers].[Anniversary],'-') where WORDNUM = 3) AS AnnYear FROM dbo.viwUser_Customers_Custom Customers WHERE [Customers].[Id] = @CustId Here are the errors that come back for each sub-select. Msg 102, Level 15, State 1 Incorrect syntax near 'Customers'. Any suggestions as to what is causing this to fail? It fails to execute in SSMS, but trying to parse the query it comes back clean. I checked that the 2008 R2 deployment is at the same service pack level as other instances where this same query works.671Views0likes0CommentsRe: Graph API request doesn't even send out.
I can tell this the ConfidentialClientApplicationBuilder code section is where it's failing. Based on that class instance I cannot hook into anything, whether through the GraphServiceClient or the GraphClientFactory.Create() that spins up an HttpClient. I have verified that my clientId, tenantId, and clientSecret are valid in the Azure app registration page. And I've also tried to acquire a token, as part of the process (which I previously didn't have to do when my project was working). string[] scopes = new string[] { "https://graph.microsoft.com/.default" }; AuthenticationResult result = null; try { result = await confidentialClientApplication.AcquireTokenForClient(scopes) .ExecuteAsync(); } catch (MsalServiceException ex) { // Case when ex.Message contains: // AADSTS70011 Invalid scope. The scope has to be of the form "https://resourceUrl/.default" // Mitigation: change the scope to be as expected }1.4KViews0likes1CommentRe: Graph API request doesn't even send out.
If there was some way I could debug as to _why_ the HttpResponseMessage is being skipped over it would help. When I place a breakpoint there the program just advances on and doesn't fire off the API request. I checked my Azure app registration and it still has permissions for the entire tenant organization to read, write, etc. And I re-fired off the admin consent that came back admin_consent=True in the redirect URI. There are several other Microsoft Graph API methods in this project that I know worked 1-2 years ago.1.4KViews0likes2CommentsGraph API request doesn't even send out.
So I am using the latest Microsoft.Graph NuGet package in a VS 2019 project. Looking to create a new calendar event. The API request doesn't even send out, although if I place the same JSON request body in the Graph Explorer web page it returns a successful response. Here is a snippet of my method. var clientId = "..."; var tenantId = "..."; var clientSecret = "..."; var newEvent = new Event(); IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder .Create(clientId) .WithTenantId(tenantId) .WithClientSecret(clientSecret) .Build(); ClientCredentialProvider authenticationProvider = new ClientCredentialProvider(confidentialClientApplication); HttpClient httpClient = GraphClientFactory.Create(authenticationProvider); // Build my newEvent here... // This requestBody is identical to the one that works in the online Graph Explorer. var requestBody = JsonConvert.SerializeObject(newEvent); HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, string.Format("users/{0}/calendar/events", upn)); var content = new System.Net.Http.StringContent(requestBody, Encoding.UTF8, "application/json"); requestMessage.Content = content; Console.WriteLine(requestBody); // This is where the program doesn't throw an exception, but doesn't perform the API call either. HttpResponseMessage response = await httpClient.SendAsync(requestMessage).ConfigureAwait(false); var jsonResponse = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var jObject = JObject.Parse(jsonResponse); var id = (string)jObject["id"]; Any suggestions on what I can try? I can see that the URI is calling the v1.0, which worked for similar methods I have in this project that I used maybe 1-2 years ago. Spinning my wheels for sure!Solved1.5KViews0likes3CommentsRe: Odd Windows 2012 R2 DNS requests
HidMov Thanks for the suggestion. I had forgotten about this, and will give it a shot. Previously I was looking at the Windows 2012 R2 analytic logs, gathered via the recommended method outlined here --> https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn800669(v%3Dws.11). When I looked at the details I didn't see the initial DNS client request for these particular QNAME's. Just saw the recursive requests out to Cisco OpenDNS Umbrella. Since I can assumedly trace things based on the XID for each DNS transaction, there wasn't a complete picture of which internal client initiated the calls. Hopefully the debug logs will divulge that!3.6KViews0likes0CommentsOdd Windows 2012 R2 DNS requests
So I have regular Cisco OpenDNS Umbrella rejections for malware-related DNS requests logged. From what I can tell these rejections are coming from our internal AD DNS Server. It has Umbrella DNS defined for DNS resolution of Internet-based domain names. When I look at the DNS audit logs, I don't see the initial Event ID 256 - LOOK_UP QUERY_RECEIVED for these rejections. If I did I would then see the internal source (i.e. - Source=x.x.x.x) and could investigate further. The first activity I see is always Event ID 260 - RECURSE_QUERY RECURSE_QUERY_OUT, which is the local AD DNS Server querying out to Umbrella to resolve the malicious QNAME's. Does this mean that the local AD DNS Server is the initial requestor? I've looked at the box in detail and don't see any strange processes running or anything else out of the ordinary when looking at the results of a netstat -abn command line result. So that's why I'm asking this here 🙂Solved3.7KViews0likes2Comments
Recent Blog Articles
No content to show