Solved

dsmod doesn't seem to be working

Posted on 2014-10-22
9
351 Views
Last Modified: 2014-10-23
I have a long list of disabled users I want to remove from a security group (wireless access group).
I tested the query until I got it correct. After that first successful test, all I'm getting now is "dsmod failed:CN=GeneralWireless.....". I've copied and pasted the DN of the security group from its properties' attributes, so I know I'm not mis-typing. I know the group is there, I have a Saved Query in ADUC that I can execute against the group. Here's what I've executed at the command line:

C:\>dsmod group CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp
,DC=company,DC=com -rmmbr "CN=user name,OU=Users,OU=Disabled,DC=corp,DC=company,DC=com"
dsmod failed:CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp,DC=company,DC=
com:Directory object not found.
0
Comment
Question by:PotreroHill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 40396528
You need double quotes around the group DN:
dsmod group "CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp,DC=company,DC=com" -rmmbr "CN=user name,OU=Users,OU=Disabled,DC=corp,DC=company,DC=com"

Open in new window

Edit: removed line breaks in command line.
0
 

Author Comment

by:PotreroHill
ID: 40397702
I'd tried that, but wanted to verify since I was working late and I got the same results. This is a copy/paste from DOS CLI. The double quotes shouldn't matter for the security group DN since there are no spaces in it.

I thought the issue might be 'smart quotes' so I made sure to check and remove them. But that didn't help either.

c:\>dsmod group "CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp,DC=company
,DC=com" -rmmbr "CN=user name,OU=Users,OU=Disabled,DC=corp,DC=company,DC=
com"
dsmod failed:CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp,DC=company,DC=
com:Directory object not found.
type dsmod /? for help.
c:\>
0
 
LVL 85

Expert Comment

by:oBdA
ID: 40397775
What's the result of
dsquery group -samid "GeneralWireless"

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:PotreroHill
ID: 40397877
This is the command and its output:

c:\>dsquery group -samid "GeneralWireless"
"CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp,DC=company,DC=com"

I'm wondering if it's a nesting issue... the security group is too 'deep'...
Thanks
0
 
LVL 85

Expert Comment

by:oBdA
ID: 40397897
Try
dsquery group -samid "GeneralWireless" | dsmod group -rmmbr "CN=user name,OU=Users,OU=Disabled,DC=corp,DC=company,DC=com"

Open in new window

0
 

Author Comment

by:PotreroHill
ID: 40398186
Of course, remove the potential for copy/paste issues. Unfortunately it still failed. This is a DC, the Schema Master, PDC, and RID pool manager role holder. And I am running this elevated as Admin.
Thanks again!

c:\>dsquery group -samid "GeneralWireless" | dsmod group -rmmbr "CN=user name
,OU=Users,OU=Disabled,DC=corp,DC=company,DC=com"
dsmod failed:CN=GeneralWireless,OU=Wireless,OU=Groups,DC=corp,DC=company,DC=
com:Directory object not found.
type dsmod /? for help.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 500 total points
ID: 40398586
Then it can't find the user DN (which, for whatever reason, produces the same error message as when it can't find the group it's supposed to process).
Note that if the user name contains a comma (as in "LastName, FirstName"), the comma needs to be escaped with a backslash. If in doubt, use dsquery -samid UserSamAccountName to get the DN.
0
 

Author Comment

by:PotreroHill
ID: 40400843
So it worked, and it allowed me to find the problem.
c:\>dsquery user -samid Alanna.Meola
"CN=User  Name,OU=Users,OU=Disabled,DC=corp,DC=appdynamics,DC=com"

I saw it instantly, there are two spaces in the CN.

I can't quite remember how I created my original list, but it had an extra row of data. I opened it in Excel and found massive spaces after many names, so I used TRIM... Obviously it removed the extra space in the CN.

I need to created a list that I don't need to manipulate after created it.
Valuable lessons, don't take shortcuts, and if the output method doesn't provide exactly what you need, find a way that does.

Thank you for all your help!
0
 

Author Closing Comment

by:PotreroHill
ID: 40400845
Extremely helpful, a very straight forward, systematic way to check the constituent elements in a straight forward query.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OfficeMate Freezes on login or does not load after login credentials are input.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question