Search found 174 matches

by ITEngineer
Thu Jan 09, 2020 8:25 pm
Forum: Windows PowerShell
Topic: Unable to show Windows Event Source & Username?
Replies: 4
Views: 368

Re: Unable to show Windows Event Source & Username?

The server is part of the record. Just add it. It is called "MachineName". Yes I know the levels. They exist in every record. Level < 4 means show all level that are less than 4. "User" is not part of every event's system properties. I think you really want "ProviderName" and "UserId" The following...
by ITEngineer
Thu Jan 09, 2020 6:17 pm
Forum: Windows PowerShell
Topic: Unable to show Windows Event Source & Username?
Replies: 4
Views: 368

Re: Unable to show Windows Event Source & Username?

Mr. Vierra, AFAIK, The filter System/Level<4 means to show any event log with the type of Warning, Error and Critical. Verbose = 5 Informational = 4 Warning = 3 Error = 2 Critical = 1 LogAlways = 0 Does it mean that it is not possible to add an additional column to shows which service/source of the ...
by ITEngineer
Thu Jan 09, 2020 4:03 pm
Forum: Windows PowerShell
Topic: Unable to show Windows Event Source & Username?
Replies: 4
Views: 368

Unable to show Windows Event Source & Username?

Hi All, I need some help in displaying the Event source & User from the below script to show the summary of Windows Event logs in the past X day. The below script working fine, it is just the two additional attribute value that is not showing. $HtmlHead = @" <style> body { font-family: Arial; } tabl...
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: 1664

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: 1664

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: 1480

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: 1480

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: 1888

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: 1888

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: 1888

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...