Find Security Groups Not in Any of the following groups in AD


hi

i looking groups search security groups in ad not belong of following security groups in ad , sends out email. there way?

example

group1

group2

group3

all security groups in ad must belong 1 of above groups. there way send out email if group found in more 1 group above or has no group @ all?


thanks

still not working.

this mine starting line 26

$searcher.filter = "(&(objectcategory=group)" `     "(grouptype:1.2.840.113556.1.4.803:=2147483648)" `     "(!memberof=cn=is,ou=department groups,dc=domain,dc=com)" `     "(!memberof=cn=hr,ou=department groups,dc=domain,dc=com)" ` 	"(!memberof=cn=finance,ou=department groups,dc=domain,dc=com))"

because there space in ou? tried 'department groups' doesn't work , gave same error.

thanks

perhaps richard did not test code, looks wrong me. stands equivalent this:

    $var = "string 1" "string2" "string3"

perhaps works in version 1, however, in version 2 need explicit concatenation operator, i.e.:

$searcher.filter = "(&(objectcategory=group)" `     + "(grouptype:1.2.840.113556.1.4.803:=2147483648)" `     + "(!memberof=cn=is,ou=department groups,dc=domain,dc=com)" `     + "(!memberof=cn=hr,ou=department groups,dc=domain,dc=com)" `     + "(!memberof=cn=finance,ou=department groups,dc=domain,dc=com))"
try , let know...

al dunbar



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607