Search found 193 matches

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

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

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

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

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

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...
by ITEngineer
Mon Oct 14, 2019 11:35 pm
Forum: PowerShell
Topic: Export list of AD Users account NOT in certain OU with specific criteria?
Replies: 5
Views: 2987

Re: Export list of AD Users account NOT in certain OU with specific criteria?

Here is the best way to get users and exclude OUs. Get-AdOrganizationalUnit -Filter * -pipeline OU| Where-Object{$_.Distinguishedname -notin $excludeOUs } | ForEach-Object{ Get-ChildItem -Path ('AD:\' + $_.DistinguishedName) -Filter '(&(objectClass=User)(!objectClass=computer))' } | Select-Object n...
by ITEngineer
Mon Oct 14, 2019 10:09 pm
Forum: PowerShell
Topic: Export list of AD Users account NOT in certain OU with specific criteria?
Replies: 5
Views: 2987

Re: Export list of AD Users account NOT in certain OU with specific criteria?

Thanks for the suggestion Mr Vierra, Each smaller sub-company has its own Service Account, meeting rooms, SharedMailboxes. 'OU=GlobalCorp Testing,DC=GlobalCorp,DC=com', 'OU=HeadOffice,OU=Shared Mailboxes,DC=GlobalCorp,DC=com', 'OU=Branch1,OU=Shared Mailboxes,DC=GlobalCorp,DC=com', 'OU=Branch2,OU=Sha...
by ITEngineer
Sun Oct 13, 2019 11:42 pm
Forum: PowerShell
Topic: Export list of AD Users account NOT in certain OU with specific criteria?
Replies: 5
Views: 2987

Export list of AD Users account NOT in certain OU with specific criteria?

Hi All, I need some help in modifying the AD OU filter belowto exclude the AD User accounts that are located in those OU in the lists. This is the script that I have tried with, but the result is always containing User accounts in those OU. $filter = "(Enabled -eq 'true') -and ((mail -notlike '*') -...
by ITEngineer
Thu Jul 04, 2019 9:25 pm
Forum: PowerShell
Topic: Download file using Powershell script no working anymore due to URL change?
Replies: 4
Views: 2872

Re: Download file using Powershell script no working anymore due to URL change?

jvierra wrote:
Thu Jul 04, 2019 1:20 pm
[Net.ServicePointManager]::SecurityProtocol = 'Tls12'
Nice, thank you for the pointer :-)
by ITEngineer
Wed Jul 03, 2019 11:10 pm
Forum: PowerShell
Topic: Download file using Powershell script no working anymore due to URL change?
Replies: 4
Views: 2872

Re: Download file using Powershell script no working anymore due to URL change?

jvierra wrote:
Wed Jul 03, 2019 9:36 pm
You are likely not using TLS 1.2 as a protocol. Most web sites have disable SSL and TLS 1. Try using TLS 1.2.
OK, so how do I implement that in the script above?