use strict; use warnings; my $notexists = 0; my $hashdiff = ( (scalar keys %EgrpsHash) - (scalar keys %NgrpsHash) ); print "\nI am now checking primary and secondary groups defined in AD and locally on $host...\n"; LABEL: for my $ekey (keys %EgrpsHash) { last if $notexists >= $hashdiff; if ( ! exists $NgrpsHash{$ekey} ) { print uc("\n$nuser is **not** in the same 'ad' and or 'local' groups as $euser is!\n\n"); print uc("*** $nuser needs to be in ''$ekey'' group(s) for interface support rights! ***\n\n"); print "Please correct this then rerun with the -r flag!\n\n"; print "$nuser\'s AD+local groups\n", join("\n", sort keys %NgrpsHash),"\n"; print '=' x 11,"\n"; print "$euser\'s AD+local groups\n", join("\n", sort keys %EgrpsHash),"\n\n"; print uc("please change this within centrify gui! right-click on new user, properties, profile tab, primary group, then rerun \n\n"); ++$notexists; goto LABEL; } } #### __DATA__ is tsilvia's AD+local groups cbpro_group cbproop cbqa cbqaop cbtestop =========== thendri1's AD+local groups cbpro cbpro_group cbproop cbqa cbqaop cbtest cbtestop