bsharath
asked on
Get all the users and groups who are in the Accept Messages only from
Hi,
I have some groups which is configured to Accept Messages only from..Is there a way to get all these groups with the members to a file.
Get all the users and groups who are in the Accept Messages only from
If required i can mention the group names too..All are oon the Root Domain.
Regards
Sharath
I have some groups which is configured to Accept Messages only from..Is there a way to get all these groups with the members to a file.
Get all the users and groups who are in the Accept Messages only from
If required i can mention the group names too..All are oon the Root Domain.
Regards
Sharath
Hi Sharath,
Check following script if this works for you!
:: SCRIPT START
@ECHO OFF
SETLOCAL EnableDelayedExpansion
IF EXIST GroupMembers.txt DEL /F /Q GroupMembers.txt
SET DrawLine=----------------- ---------- ---------- ---------- ---------- --
SET Qry=DSQuery * -Filter "(&(authOrig=*)(objectCate gory=group ))" -Attr sAMAccountName -Limit 0 -L
ECHO !DrawLine! >>GroupMembers.txt
FOR /F "delims=*" %%g IN ('%Qry%') DO (
ECHO Querying: %%g
ECHO Members Of: %%g >>GroupMembers.txt
DSQuery * -Filter "(samAccountName=%%g)" -Attr authOrig -L >>GroupMembers.txt
ECHO !DrawLine! >>GroupMembers.txt)
ECHO.&ECHO Script Complete. Check 'GroupMembers.txt' file.
ENDLOCAL
:: *** SCRIPT END ***
Check following script if this works for you!
:: SCRIPT START
@ECHO OFF
SETLOCAL EnableDelayedExpansion
IF EXIST GroupMembers.txt DEL /F /Q GroupMembers.txt
SET DrawLine=-----------------
SET Qry=DSQuery * -Filter "(&(authOrig=*)(objectCate
ECHO !DrawLine! >>GroupMembers.txt
FOR /F "delims=*" %%g IN ('%Qry%') DO (
ECHO Querying: %%g
ECHO Members Of: %%g >>GroupMembers.txt
DSQuery * -Filter "(samAccountName=%%g)" -Attr authOrig -L >>GroupMembers.txt
ECHO !DrawLine! >>GroupMembers.txt)
ECHO.&ECHO Script Complete. Check 'GroupMembers.txt' file.
ENDLOCAL
:: *** SCRIPT END ***
ASKER
Farhan
Where should i mention the input.
When i save the code and run it i just get a ------ nothing else.
Will it get all the users and groups who are in the Accept Messages only from box?
Where should i mention the input.
When i save the code and run it i just get a ------ nothing else.
Will it get all the users and groups who are in the Accept Messages only from box?
ASKER
Farhan this works fine from the local Domain but from the root domain it does not fetch.Can you change it to even get details from the root domain
Replace following line
SET Qry=DSQuery * -Filter "(&(authOrig=*)(objectCate gory=group ))" -Attr sAMAccountName -Limit 0 -L
With
SET Qry=DSQuery * ForestRoot -Filter "(&(authOrig=*)(objectCate gory=group ))" -Attr sAMAccountName -Limit 0 -L
SET Qry=DSQuery * -Filter "(&(authOrig=*)(objectCate
With
SET Qry=DSQuery * ForestRoot -Filter "(&(authOrig=*)(objectCate
ASKER
Farhan its getting me all the groups but not the members in it.
There are users who have been given access (Only from) They are not being listed.
There are users who have been given access (Only from) They are not being listed.
Did you run the script with above changes?
ASKER
Yes Farhan without the change i did not get anything.Now i am getting the names of the groups but not the members...
Can please post the contents of 'GroupMembers.txt' file
ASKER
I get this...
-------------------------- ---------- ---------- ---------- ---
Members Of: CHENNAI
-------------------------- ---------- ---------- ---------- ---
Members Of: France
-------------------------- ---------- ---------- ---------- ---
Members Of: Newyork
-------------------------- ---------- ---------- ---------- ---
Members Of: Warrington
-------------------------- ---------- ---------- ---------- ---
--------------------------
Members Of: CHENNAI
--------------------------
Members Of: France
--------------------------
Members Of: Newyork
--------------------------
Members Of: Warrington
--------------------------
Apply following commands (one-by-one) and post the results.
Click Start -> Run -> Cmd.exe
DSQuery * -Filter "(samAccountName=CHENNAI)" -Attr authOrig -L
DSQuery * -Filter "(samAccountName=France)" -Attr authOrig -L
DSQuery * -Filter "(Name=Warrington)" -Attr authOrig -L
DSQuery * -Filter "(samAccountName=Newyork)" -Attr * -L
Click Start -> Run -> Cmd.exe
DSQuery * -Filter "(samAccountName=CHENNAI)"
DSQuery * -Filter "(samAccountName=France)" -Attr authOrig -L
DSQuery * -Filter "(Name=Warrington)" -Attr authOrig -L
DSQuery * -Filter "(samAccountName=Newyork)"
ASKER
farhan
I dont get any results...
I dont get any results...
What about following:
DSQuery * ForestRoot -Filter "(samAccountName=Newyork)" -Attr * -L
DSQuery Group -Name Newyork
DSQuery * ForestRoot -Filter "(samAccountName=Newyork)"
DSQuery Group -Name Newyork
ASKER
For this i get all the details...
DSQuery * ForestRoot -Filter "(samAccountName=Newyork)" -Attr * -L
Its a very big data so not pasting it here
DSQuery Group -Name Newyork
I dont get any results
DSQuery * ForestRoot -Filter "(samAccountName=Newyork)"
Its a very big data so not pasting it here
DSQuery Group -Name Newyork
I dont get any results
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot farhan
Any help with the other Q's
Any help with the other Q's
Thanks for the points.
Can you please post the links here...
Can you please post the links here...
ASKER
Any help with these...
https://www.experts-exchange.com/questions/22878069/Find-all-disabled-users-who-are-greater-than-3-months.html
https://www.experts-exchange.com/questions/22864808/Any-way-to-Query-the-Ads-Users-properties-for-Mailbox-Rights.html
https://www.experts-exchange.com/questions/22863160/Need-to-change-the-sessions-tab-for-all-users-in-the-file.html
https://www.experts-exchange.com/questions/22862580/Reports-in-many-combinations.html
https://www.experts-exchange.com/questions/22864935/I-am-looking-for-a-way-to-export-Mailbox-Rights-to-a-csv-or-txt-for-all-mailboxes.html
https://www.experts-exchange.com/questions/22878069/Find-all-disabled-users-who-are-greater-than-3-months.html
https://www.experts-exchange.com/questions/22864808/Any-way-to-Query-the-Ads-Users-properties-for-Mailbox-Rights.html
https://www.experts-exchange.com/questions/22863160/Need-to-change-the-sessions-tab-for-all-users-in-the-file.html
https://www.experts-exchange.com/questions/22862580/Reports-in-many-combinations.html
https://www.experts-exchange.com/questions/22864935/I-am-looking-for-a-way-to-export-Mailbox-Rights-to-a-csv-or-txt-for-all-mailboxes.html
http://technet2.microsoft.com/windowsserver/en/library/32872283-3722-4d9b-925a-82c516a1ca141033.mspx?mfr=true