Search found 171 matches

by ITEngineer
Tue Nov 26, 2019 4:53 am
Forum: Windows PowerShell
Topic: Executing Powershell for Exchange Online and MSOnline modules secured with MFA?
Replies: 4
Views: 647

Re: Executing Powershell for Exchange Online and MSOnline modules secured with MFA?

You can connect to Exchange using this newer module: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps OK, so is there any steps I can follow so the IDE (Powershell ISE, Sapien, VS co...
by ITEngineer
Tue Nov 26, 2019 1:48 am
Forum: Windows PowerShell
Topic: Executing Powershell for Exchange Online and MSOnline modules secured with MFA?
Replies: 4
Views: 647

Executing Powershell for Exchange Online and MSOnline modules secured with MFA?

I need some help and suggestion in how to run the Powershell for Exchange Online and MSOnline modules when the Admin account is secured with MFA via my phone? If (-not (Get-Module MSOnline) ) { Write-Host "No Microsoft Online PowerShell module installed" -WarningAction Try { Install-Module MSOnline ...
by ITEngineer
Sun Nov 24, 2019 10:25 pm
Forum: Windows PowerShell
Topic: Importing .CSV showing many NULL character?
Replies: 3
Views: 538

Re: Importing .CSV showing many NULL character?

It is in Unicode and NP++ is not reading it correctly. This has nothing to do with scripting or PowerShell. If the BOM is missing then this can happen. You can try to read it correctly with "Get-Content" and specify "Unicode" as the encoding. You sir are correct :-) that is what has been missing so...
by ITEngineer
Sun Nov 24, 2019 9:41 pm
Forum: Windows PowerShell
Topic: Importing .CSV showing many NULL character?
Replies: 3
Views: 538

Importing .CSV showing many NULL character?

People, I have just downloaded the .CSV from Office 365 with the content of Message Transport logs. However, the Notepad++ showing it as NULL typed content as per below screenshot: https://i.imgur.com/VUAEVvV.png How to correctly import this file so I can use it against the Powershell script correct...
by ITEngineer
Wed Nov 20, 2019 5:03 pm
Forum: Windows PowerShell
Topic: Cannot convert null to type "System.DateTime".
Replies: 8
Views: 814

Re: Cannot convert null to type "System.DateTime".

jvierra wrote:
Wed Nov 20, 2019 4:54 pm
I get no errors and cannot guess as to your issue. If the file is being downloaded then you may have issues.
No, it is already downloaded perfectly and then I have clicked the Unblock button to make sure Excel have access.
by ITEngineer
Wed Nov 20, 2019 4:53 pm
Forum: Windows PowerShell
Topic: Cannot convert null to type "System.DateTime".
Replies: 8
Views: 814

Re: Cannot convert null to type "System.DateTime".

I ran your code and it works correctly. Your file has no null values. No, it has no null values, The date_time column has values as it was exported from Office 365. However, When I run the Powershell script directly when the files have been downloaded, it gives me the error? And this is the result ...
by ITEngineer
Wed Nov 20, 2019 4:51 pm
Forum: Windows PowerShell
Topic: Cannot convert null to type "System.DateTime".
Replies: 8
Views: 814

Re: Cannot convert null to type "System.DateTime".

Just do this: if($_.date_time){[DateTime]$_.date_time}else{$null} Strangely it does not work? Import-Csv -Path C:\Logs\input.csv | if($_.date_time){[DateTime]$_.date_time}else{$null} ForEach-Object {$_.date_time = ([DateTime]$_.date_time).ToString('yyyy-MM-dd HH:mm:ss tt'); $_} | Export-Csv -NoType...
by ITEngineer
Wed Nov 20, 2019 4:29 pm
Forum: Windows PowerShell
Topic: Cannot convert null to type "System.DateTime".
Replies: 8
Views: 814

Cannot convert null to type "System.DateTime".

Folks, I need some assistance in how to convert one column in a .CSV file date_time into the yyyy-MM-dd HH:mm:ss tt format ,so I can sort it on the Excel. this is the script: Import-Csv -Path C:\Logs\input.csv | ForEach-Object {$_.date_time = ([DateTime]$_.date_time).ToString('yyyy-MM-dd HH:mm:ss tt...
by ITEngineer
Thu Nov 07, 2019 5:16 am
Forum: Windows PowerShell
Topic: Get-WinEvent filtering considerations?
Replies: 6
Views: 1287

Re: Get-WinEvent filtering considerations?

Yes, that does make sense.

However, since Xpath and XML is rather hard to build or type / compile, is there any helper or way to create it ?
by ITEngineer
Wed Nov 06, 2019 11:11 pm
Forum: Windows PowerShell
Topic: Get-WinEvent filtering considerations?
Replies: 6
Views: 1287

Re: Get-WinEvent filtering considerations?

Cool, thanks, Mr. Vierra.

So in this case, I assume there is no speed difference when using any of those three when Filtering the Event types, not the data?