Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

get-aduser -filter { DistinguishedName -notlike .... does not work!

$
0
0

Hello

Does anyone have an explanation of why this command does not work.

I want to make it work, without using LDAPFilter

get-aduser -filter { DistinguishedName -notlike "*OU=Cloud,DC=cloud,DC=local" } 

I get no results

if i run a filter * i get:

DistinguishedName : CN=svcsc2012,OU=Cloud,DC=cloud,DC=local
Enabled           : True
GivenName         : svcsc2012
Name              : svcsc2012
ObjectClass       : user
ObjectGUID        : 8fa5a111-243e-42f3-9570-b11b9fbcb6ef
SamAccountName    : svcsc2012
SID               : S-1-5-21-3106746516-1520913103-3519165319-1108
Surname           : 
UserPrincipalName : svcsc2012@cloud.local

DistinguishedName : CN=User1,CN=Users,DC=cloud,DC=local
Enabled           : True
GivenName         : User1
Name              : User1
ObjectClass       : user
ObjectGUID        : 0eadc81c-de9b-4f49-b2c5-9289280b21e7
SamAccountName    : User1
SID               : S-1-5-21-3106746516-1520913103-3519165319-2103
Surname           : 
UserPrincipalName : User1@cloud.local

So howcome the notlike does not work?

I tried with -like also, sam result.

Thank you :)



Best Regards
Jakob Gottlieb Svendsen
Trainer/Consultant - Coretech A/S - Blog
MCT - MCTS - VB.NET - C#.NET - Powershell - VBScript Mastering System Center Orchestrator 2012 - 3 day workshop - worldwide training click here



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>