Search found 208 matches

by ITEngineer
Tue Nov 05, 2019 11:27 pm
Forum: PowerShell
Topic: Powershell to convert Excel to PDF not working?
Replies: 8
Views: 4070

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: PowerShell
Topic: quser.exe works in console and ISE but not in service
Replies: 9
Views: 4334

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: PowerShell
Topic: Powershell to convert Excel to PDF not working?
Replies: 8
Views: 4070

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: PowerShell
Topic: Getting System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] when export-csv ?
Replies: 2
Views: 3219

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: PowerShell
Topic: Getting System.Collections.Generic.List`1[Microsoft.Online.Administration.DirSyncProvisioningError] when export-csv ?
Replies: 2
Views: 3219

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...
by ITEngineer
Sun Oct 27, 2019 8:44 pm
Forum: PowerShell
Topic: PowerShell to list of UPNs based on specific Wildcard search?
Replies: 10
Views: 5647

Re: PowerShell to list of UPNs based on specific Wildcard search?

jvierra wrote:
Sun Oct 27, 2019 3:46 pm
You cannot use match to search a collection. Use +-in+ or "-contains".
You cannot use a wildcard in a match.
Start here:
help about_regular_expressions
and
https://www.regular-expressions.info/
Yes, I will adjust it accordingly.

Thank you Mr. Vierra.
by ITEngineer
Sun Oct 27, 2019 3:34 pm
Forum: PowerShell
Topic: PowerShell to list of UPNs based on specific Wildcard search?
Replies: 10
Views: 5647

Re: PowerShell to list of UPNs based on specific Wildcard search?

You can't. GridView does not work like that. The best you can do is to join the arrays on a line break. Mr. Vierra, Thanks for the pointer, now it is throwing some other error: ## List all properties for the combined output: $properties = @( 'EmailAddresses' 'EmailAddress' 'UserPrincipalName' @{n='...
by ITEngineer
Fri Oct 25, 2019 12:41 am
Forum: PowerShell
Topic: PowerShell to list of UPNs based on specific Wildcard search?
Replies: 10
Views: 5647

Re: PowerShell to list of UPNs based on specific Wildcard search?

This will get you closer: $results = Get-MsolUser -All $results += Get-MsolUser -All -ReturnDeletedUsers $results += Get-MsolGroup -All $results += Get-MsolContact -All $results | Where-Object{ $_.EmailAddresses -match $search -or $_.EmailAddress -match $search -or $_.UserPrincipalName -match $sear...
by ITEngineer
Thu Oct 24, 2019 10:44 pm
Forum: PowerShell
Topic: PowerShell to list of UPNs based on specific Wildcard search?
Replies: 10
Views: 5647

Re: PowerShell to list of UPNs based on specific Wildcard search?

You cannot combine dissimilar objects. Use a select statement to select only common properties. Many properties will have to be decoded. OK, thanks for the pointer, here's the update. But somehow it is still not displaying the result in the Out-Gridview? I had to type the entry twice, once in the C...
by ITEngineer
Wed Oct 23, 2019 10:44 pm
Forum: PowerShell
Topic: PowerShell to list of UPNs based on specific Wildcard search?
Replies: 10
Views: 5647

PowerShell to list of UPNs based on specific Wildcard search?

Hi All, I need some help in modification of the below script which is partially working. It basically queries the Office 365 Users, Contact, Groups and Deleted users, and then match it with the user input, then display it on Out-GridView when found. Try { Install-Module MSOnline -ErrorAction Stop Im...