Recent content by Abhorsen

  1. A

    Solved Syntax Error Missing Operator question

    You're joking, the one space made the difference, nothing else changed and it works. My previous query worked with [sAMAccountName] IN( $otherList ) so I assumed (I guess incorrectly?) that a space between IN and ( wouldn't matter. Weird. Thanks mate, that did the trick though. Much appreciated!
  2. A

    Solved Syntax Error Missing Operator question

    Hello guys, I am trying to load a csv to memory in Powershell and query it using an OLEDB driver, and have done this successfully in the past however for this specific query I am getting a syntax error. My query is as follows: SELECT * from csv WHERE [sAMAccountName] NOT IN( $removeList ) A...
  3. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    To post an update for anyone else in the same situation (Running MS Access SQL query from within PowerShell), the SQL query string that worked for me was exactly as below: "SELECT * from csv WHERE [NTUserID] IN( $enforceList )" Where $enforceList was a single string (NOT an array object)...
  4. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    One more question for you guys; Is it possible to check a file for usernames with an access query in PowerShell? I wanted to do something like: $enforceList = (compare-object $enforceUsers $dblist -IncludeEqual -ExcludeDifferent).inputobject $enforceTable = Invoke-CsvSqlcmd -csv...
  5. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    Thanks for that! Looks like an OLEDB driver is far superior to PowerShell in pulling information out of large files so I guess ill be using Access query for the foreseeable future; I'll be around quite a bit from what I can see ha.
  6. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    The reply above helped solve the issue. And it should be an AND, at least I believe so; I am trying to get a list of users who have not accessed the program in the past 90 days and who have not been enabled in the past 90 days so that access can be revoked. Essentially if they were just enabled...
  7. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    Holy shit looks like that worked, I don't know how I didn't think of that! Thanks so much mate. Only thing is the dates are outputting as mm/dd/yyyy 0:00 and once I figure out how to get those to be just mm/dd/yyyy I'll be golden. Thanks again for the help.
  8. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    I thought of something similar and tried the following: Select [Facility], [User], [NTUserID], [UPN], IIf(IsNull([Last Accessed Date]), (DATE() -365), [Last Accessed Date]) AS `Last Accessed Date`, IIf(IsNull([Last Enable Date]), (DATE() -365), [Last Enable Date]) AS `Last Enable Date` from csv...
  9. A

    Help with selecting and replacing columns that are null Where Date is over 90d ago

    Hey guys, I am using PowerShell to parse a massive CSV with the ACE OLEDB driver as its far more efficient than directly importing the CSV and then modifying it as needed. The imported columns are Facility, User, NTUserID, UPN, Last Accessed Date, and Last Enable Date. As this is how the...
Top Bottom