Hi Using TS 6.5 SP1 Win 2003.I have to know the operating system user group of a user .I searched through the net but could not get any command to do so .Could anyone let me know how to get the group(s) of a user to which he belongs ?RegardsRohit Pathak
Use the command - groups userid. This will return you all the OS group names in which the user belongs to.
I does not work as the environemt is Windows and not unix.
Pls let me know if we have any sollution
#!D:\system\iw-home\iw-perl\bin\iwperluse strict;use Win32::NetAdmin;use Win32API::Net;foreach my $group (@{getLocalGroups()}) { print "\n$group\n"; foreach my $member (@{getLocalGroupMembers($group)}) { print "\t$member\n"; }}exit 0;sub getLocalGroups { my @groups = (); print Win32::GetLastError() if(!Win32API::Net::LocalGroupEnum('', \@groups)); return \@groups;}sub getLocalGroupMembers { my ($group) = @_; my @members = (); print Win32::GetLastError() if(!Win32::NetAdmin::LocalGroupGetMembers('', $group, \@members)); return \@members;}