Search found 163 matches

by ITEngineer
Thu Nov 07, 2019 5:16 am
Forum: Windows PowerShell
Topic: Get-WinEvent filtering considerations?
Replies: 6
Views: 588

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

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?
by ITEngineer
Wed Nov 06, 2019 10:52 pm
Forum: Windows PowerShell
Topic: Get-WinEvent filtering considerations?
Replies: 6
Views: 588

Get-WinEvent filtering considerations?

Hi, I'd like to know when to use which filtering methods for the Get-WinEvent cmdlet? I can see from https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-winevent?view=powershell-6 there are three methods: -FilterHashtable -FilterXPath -FilterXml Your assistance an...
by ITEngineer
Wed Nov 06, 2019 3:19 am
Forum: Windows PowerShell
Topic: Powershell to convert Excel to PDF not working?
Replies: 7
Views: 508

Re: Powershell to convert Excel to PDF not working?

Still the same issue? PS C:\WINDOWS\system32> C:\Logs\Convert-ToPDF.PS1 1:Processing C:\Logs\MultipleMembers.xls You cannot call a method on a null-valued expression. 2:Processing C:\Logs\OnPremise.xlsx You cannot call a method on a null-valued expression. Exception calling "ReleaseComObject" with "...
by ITEngineer
Tue Nov 05, 2019 11:31 pm
Forum: Windows PowerShell
Topic: Powershell to convert Excel to PDF not working?
Replies: 7
Views: 508

Re: Powershell to convert Excel to PDF not working?

$xl = New-Object -ComObject Excel.Application $counter = 0 Get-ChildItem -path C:\Logs\* -include *.xls,*.xlsx -recurse | ForEach-Object{ $counter++ $pdfname = $_.FullName -replace 'xlsx$|xls$','pdf' $f = Get-Item $pdfname -ErrorAction SilentlyContinue if($f -and $f.Length -gt 3kb){ Write-Host "ski...
by ITEngineer
Tue Nov 05, 2019 11:27 pm
Forum: Windows PowerShell
Topic: Powershell to convert Excel to PDF not working?
Replies: 7
Views: 508

Re: Powershell to convert Excel to PDF not working?

Hi Mr. Vierra,

Thanks for the reply

What is this counter limiter used for?
if($counter -gt 100){break}
by ITEngineer
Tue Nov 05, 2019 11:05 pm
Forum: Windows PowerShell
Topic: quser.exe works in console and ISE but not in service
Replies: 9
Views: 773

Re: quser.exe works in console and ISE but not in service

I've been using this code to track down users in the AD domain based on the root OU. $threadLimit = 50 $regex = '^ *(?<Interactive>\>)?(?<User>\S+) +(?:(?<Session>\S+) +)?(?<ID>\d+) +(?<SessionState>\S+) +(?<IdleTime>\S+) +(?<LogonTime>\S+ \S+)$' Get-ADComputer -Properties OperatingSystem -Filter {E...
by ITEngineer
Tue Nov 05, 2019 10:57 pm
Forum: Windows PowerShell
Topic: Powershell to convert Excel to PDF not working?
Replies: 7
Views: 508

Powershell to convert Excel to PDF not working?

Hi Folks, I need some help in troubleshooting the below Powershell script to convert bulk Excel spreadsheet into .PDF files and save it on the custom directory: $Files=Get-ChildItem -path 'C:\Logs' -recurse -include "*.XLS*" $counter = 0 $filesProcessed = 0 $Excel = New-Object -ComObject Excel.Appli...
by ITEngineer
Wed Oct 30, 2019 5:59 pm
Forum: Windows PowerShell
Topic: Getting System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] when export-csv ?
Replies: 2
Views: 565

Re: Getting System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] when export-csv

jvierra wrote:
Wed Oct 30, 2019 3:48 pm
This line:
{$_.ProvisioningErrors},
Must be:
@{n='ProvError';e={$_.ProvisioningErrors[0]},
Cool, thanks man for the pointer :-)
by ITEngineer
Wed Oct 30, 2019 3:14 pm
Forum: Windows PowerShell
Topic: Getting System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] when export-csv ?
Replies: 2
Views: 565

Getting System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] when export-csv ?

Hi All, I'm not sure why I always get the result System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] , instead of the correct string without the curly brackets: ProvisioningErrors : {ProxyAddresses} ProvisioningErrors : {UserPrincipalName} This is the script t...