Link to home
Create AccountLog in
Avatar of bsharath
bsharathFlag for India

asked on

Distribution Group >Message Restrictions > Accept messages > Only From

Hi,

I have a distribution group.There are users who have permissions to send on behalf of that group.I need the names of the users to a file.
Distribution Group >Message Restrictions > Accept messages > Only From
Is there a way i can do this.

REgards
Sharath
Avatar of bsharath
bsharath
Flag of India image

ASKER

Only these users who are there can send a mail to to the group.Others cannot send.

Every person i the organisation is a member in this group.So everyone will receive the mail
goto the group properties - members tab and you will find all the users there.
OR use dsget command for this purpose -
dsget group

Displays the various properties of a group including the members of a group in the directory. There are two variations of this command. The first variation allows you to view the properties of multiple groups. The second variation allows you to view the group membership information of a single group.

Syntax
dsget group GroupDN ... [-dn] [-samid] [-sid] [-desc] [-secgrp] [-scope] [{-s Server | -d Domain}] [-u UserName] [-p {Password | *}] [-c] [-q] [-l] [{-uc | -uco | -uci}] [-part PartitionDN [-qlimit] [-qused]]

dsget group GroupDN [{-memberof | -members}] [-expand] [{-s Server | -d Domain}] [-u UserName] [-p {Password | *}] [-c] [-q] [-l] [{-uc | -uco | -uci}]
Parameters
GroupDN ...
Required. Specifies the distinguished names of the group objects that you want to view. If values are omitted, they are obtained through standard input (stdin) to support piping of output from another command to input of this command. Compare with GroupDN in the next command variation.
-dn
Displays that distinguished names of the groups.
-samid
Displays the SAM account names of the groups.
-sid
Displays the group security IDs (SIDs).
-desc
Displays the descriptions of the groups.
-secgrp
Displays information about whether groups are security groups (yes) or a distribution groups (no).
-scope
Display information about whether group scopes are local, global, or universal.
GroupDN
Required. Specifies the distinguished name of the computer you want to view.
{-memberof | -members}
Displays the immediate list of groups of which the group is a member (-memberof). Displays the immediate list of members of the group (-members).
-expand
In the case of the -memberof parameter, requests that the recursively expanded list of groups in which the group is a member be returned. This option takes the immediate group membership list of the group, and then recursively expands each group in this list to determine its group memberships as well to arrive at a complete closure set of the groups.
In case of the -members parameter, requests that the recursively expanded list of members of the group be displayed. This parameter takes the immediate list of members of the group and then recursively expands each group in this list to determine its group memberships as well to arrive at a complete closure set of the members.

{-s Server | -d Domain}
Connects to a specified remote server or domain. By default, the computer is connected to the domain controller in the logon domain.
-u UserName
Specifies the user name with which the user logs on to a remote server. By default, the logged on user name is used. You can specify a user name using one of the following formats:
user name (for example, Linda)
domain\user name (for example, widgets\Linda)
user principal name (UPN) (for example, Linda@widgets.microsoft.com)
-p {Password | *}
Specifies to use either a password or a * to log on to a remote server. If you type *, you are prompted for a password.
-c
Reports errors, but continues with the next object in the argument list when multiple target objects are specified (continuous operation mode). Without this option, the command exits on the first error.
-q
Suppresses all output to standard output (quiet mode).
-l
Displays entries in a list format. By default, entries are displayed in a table format.
{-uc | -uco | -uci}
Specifies that output or input data is formatted in Unicode. The following table lists and describes each format.
-part PartitionDN
Connects to the directory partition with the distinguished name of PartitionDN.
-qlimit
Displays the effective quota of the group within the specified directory partition.
-qused
Displays how much of its quota the group has used within the specified directory partition.
Phadke_hemant
Fo this situation can ou give me the command?
Any help....
You want all the users of  "Accept messages" group in file?

Yes all users and groups if any.
Try following it will generate GroupMembers.txt file on C: drive root.

Click start -> Run -> Cmd.exe
DSQuery group -name "Accept*" | DSGet group -members >C:\GroupMembers.txt
I get this

C:\>DSQuery group -name "Accept*" | DSGet group -members >C:\GroupMembers.txt
dsget failed:`Target object for this command' is missing.
type dsget /? for help.
"Accept messages" is a group or OU?
When we right click a Distribution Group >Message Restrictions > Accept messages > Only From
There are many groups and users who have permissions to send a mail to that distribution list.I want to get all names from that group
You are talking about Active Directory or MS Exchange?
I am talking about actie directory .When we click the group properties > Exchange general > Mesaage restrictions.Thsi option i present.This is a universal and security group.
Sorry mate, actually  I don't see "Exchange General"  tab in groups properties, I think this is because I don't have Exchange server in my Domain environment.
I searched through few sites to get some info about this and found similar question like you have asked.
I hope it will give you some idea.

https://www.experts-exchange.com/questions/22599482/I-am-looking-for-an-Exchange-or-Active-Directory-command-line-that-will-display-properties-of-a-distribution-list-more-specifically-who-has-access-to-send-to-distribution-list.html

Good luck
Hi farhankazi,
Here the accepted answer is this.

What should i put here "ainscop002" is this the domain name,Ou name,Group name?
csvde -f N0.csv -d "CN=123test,OU=Test2,OU=Test,DC=global,DC=ains,DC=biz" -s ainscop002 -l "authOrig","displayName"
-s ainscop002
Yes its domain / machine name. Its an optional parameter and you can omit that if you are running query on Domain controller.


I get this

C:\>csvde -f N0.csv -d "CN=product directors,OU=user Responsibilities,OU=,DC=dev
elopment,DC=isoftgroup,DC=co,dc=uk" -s "product directors","displayName"
Connecting to "product directors,displayName"
The connection cannot be established
No log files were written.  In order to generate a log file, please
specify the log file path via the -j option.
This part should i specify anything
"product directors,displayName"
Sorry to trouble you.

Is there any chance you can help me with this.

https://www.experts-exchange.com/questions/22635816/Match-users-with-machines-from-ADS.html
Any help...
Can you please post here the results of following:

1) Copy few lines from the result and paste it here.

DSQuery * DC=DEVELOPMENT,DC=ISOFTGROUP,DC=CO,DC=UK

2) Copy and paste the results of following:

DSQuery OU -name "Product*"
DSQuery Group -name "Product*"
DSQuery OU -name "User*"
DSQuery Group -name "User*"

3) Result of the command and contents of N0.csv file.

csvde -f N0.csv -d "CN=Product Directors,OU=User Responsibilities,DC=development,DC=ISoftGroup,DC=co,dc=uk" -l "authOrig","displayName"

I get this.
C:\>DSQuery * ^\DC=DEVELOPMENT,DC=ISOFTGROUP,DC=CO,DC=UK^]
dsquery failed:A referral was returned from the server.
type dsquery /? for help.

C:\>DSQuery Group -name "Product*"
"CN=Product Development Managers,OU=User Responsibilities,DC=Development,DC=iSOF
TGroup,DC=co,DC=uk"
"CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=c
o,DC=uk"
"CN=Product Management Group Authors,CN=Users,DC=Development,DC=Group,DC=co
,DC=uk"
CN=Product Development,CN=Users,DC=Development,DC=Group,DC=co,DC=uk
CN=Product Management,CN=Users,DC=Development,DC=Group,DC=co,DC=uk
"CN=Product Technology Services-SGR,OU=Security Groups,OU=IND,OU=Countries,DC=De
velopment,DC=Group,DC=co,DC=uk"
"CN=Products-SGR,OU=Security Groups,OU=IND,OU=Countries,DC=Development,DC=G
roup,DC=co,DC=uk"
"CN=Product Technology Services-SGW,OU=Security Groups,OU=IND,OU=Countries,DC=De
velopment,DC=Group,DC=co,DC=uk"
"CN=Products-SGW,OU=Security Groups,OU=IND,OU=Countries,DC=Development,DC=G
roup,DC=co,DC=uk"


C:\>DSQuery OU -name "User*"
OU=User Accounts,OU=IND,OU=Countries,DC=Development,DC=Group,DC=co,DC=uk
OU=User Accounts,OU=DE,OU=Countries,DC=Development,DC=Group,DC=co,DC=uk
OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk



C:\>DSQuery Group -name "User*"
CN=UserAccountManagement,CN=Users,DC=Development,DC=Group,DC=co,DC=uk
CN=Users,CN=Builtin,DC=Development,DC=Group,DC=co,DC=uk
"CN=Users-SGR,OU=Security Groups,OU=IND,OU=Countries,DC=Development,DC=Grou
p,DC=co,DC=uk"
"CN=Users-SGW,OU=Security Groups,OU=IND,OU=Countries,DC=Development,DC=Grou
p,DC=co,DC=uk"

No.csv file

DN      (null)
CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk      


OK try following:

Post whats the result of following:

DSQuery * "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk" Attr authOrig displayName

AND (check result.txt file)

DSQuery * "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk" Attr authOrig displayName >C:\result.txt

AND (check N0.csv file)

csvde -f N0.csv -d "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk" -l "authOrig","displayName"

C:\>DSQuery * "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=G
roup,DC=co,DC=uk" Attr authOrig displayName
dsquery failed:`Attr' is an unknown parameter.
type dsquery /? for help.


C:\>DSQuery * "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk" Attr authOrig displayName >C:\result.txt
dsquery failed:`Attr' is an unknown parameter.
type dsquery /? for help.


No.csv file.

DN      (null)
CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk      

ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I get this.


C:\>DSQuery * "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk" -Attr authOrig displayName
  authOrig    displayName

I get this in the results file

  authOrig    displayName  
                           
>> Distribution Group >Message Restrictions > Accept messages > Only From

Are you sure "Product Directors" is the group name that has ->  Message Restrictions > Accept messages > Only From.

Yes i am sure
What result do you get by applying following command?

DSGet Group "CN=Product Directors,OU=User Responsibilities,DC=Development,DC=Group,DC=co,DC=uk" -members