Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Windows Server 2008 : Modifying Accounts with dsmod

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
11/28/2012 4:15:03 PM
You can modify account properties from the command prompt with the dsmod command. The basic syntax is
dsmod object-type dn-property property-value

The common object-types you modify with the dsmod command are the same ones you create with the dsadd command: users, computers, groups, and OUs.

Tip

You can also identify different properties for any of these objects with the help command. Useful help commands are dsmod user /?, dsmod group /?, or dsmod computer /?.


The following table shows some common uses of the dsmod command when working with users and computers.

dsmod Commands for Users and ComputersComments
Change a user password.
dsmod user dn -pwd * | password
C:/>dsmod user "cn=joe,ou=east,
ou=sales,dc=pearson,dc=pub" -pwd
*
C:/>dsmod user "cn=joe,ou=east,
ou=sales,dc=pearson,dc=pub" -pwd
P@ssw0rd

You can change a user’s password with the -pwd switch. You can either specify the password or use the asterisk (*). If you use the asterisk, you will be prompted to enter the new password.
Enable or disable a user account.
dsmod user dn -disabled yes | no
C:\>dsmod user "cn=joe,ou=east,
ou=sales,dc=pearson,dc=pub"
-disabled no

You can enable or disable a user account with the -disabled switch. To disable it, use -disabled yes and to enable it, use -disabled no.
Enable or disable a computer account.
dsmod computer dn -disabled yes
| no
C:\>dsmod computer "cn=PC-1,
ou=east, ou=sales, dc=pearson,
dc=pub" -disabled yes

You can also enable or disable a computer account with the -disabled switch. To disable it, use -disabled yes and to enable it, use -disabled no.

The following table shows some common uses of the dsmod command when working with groups.

dsmod Commands for GroupsComments
Change a group type.
Dsmod group DN -secgrp yes | no
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -secgrp no
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -secgrp yes

You can designate a group as a security group with -secgrp yes, or as a distribution group with -secgrp no.

Note

Security groups can have permissions assigned and be used for email lists. Distribution groups can only be used for email lists.

Change a group scope.
Dsmod group DN -scope l | g | u
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -scope u
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -scope l
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -scope u
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -scope g

Group scopes include global, domain local, or universal in a domain. You can use the -scope group to change the scope from one to another. The examples change the scope of the IT Admins group from global to universal, then to domain local, back to universal, and then back to global.

Note

You can’t convert a global group directly to a domain local group, and you can’t convert a domain local group directly to a global group. However, you can convert it to a universal group first, and then convert it to a domain local or global group.

Add a user to a group.
Dsmod group group-DN -addmbr
user-DN
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -addmbr "cn=Joe,ou=east,
ou=sales,dc=pearson,dc=pub"
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -addmbr "cn=Joe,ou=east,
ou=sales,dc=pearson,dc=pub"
"cn=Sally,ou=east,ou=sales,
dc=pearson,dc=pub"

You can add or remove users to a group with the -addmbr switch. The first example adds the user named Joe (created previously) to the IT Admins group and the second example adds both the user Joe and another user named Sally to the group.

Tip

You can add as many members as desired in the same command by adding additional DNs. You need only a space between DNs, not a comma.

Remove a user from a group.
Dsmod group group-DN -rmmbr
user-DN
C:\>dsmod group "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub" -rmmbr "cn=Joe, ou=east,
ou=sales, dc=pearson, dc=pub"

You can remove a user from a group with the -rmmbr command. The example removes the Joe user account from the IT Admins group. Figure 1 shows the IT Admins Members tab after the user is added.
Add a domain local group to a global group.
Dsmod group domain-local-DN
-addmbr global-group-DN
C:\>dsmod group "cn=dl_printer,
ou=east, ou=sales, dc=pearson,
dc=pub" -addmbr "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub"

This example shows how to add a global group (IT Admins) to a domain local group (named dl_printer) with the -addmbr switch. In the IT Admins Member Of tab, you see the dl_printer added after executing this command.
Remove a group from another group.
Dsmod group domain-local-DN
-rmmbr global-group-DN
C:\>dsmod group "cn=dl_printer,
ou=east, ou=sales, dc=pearson,
dc=pub" -rmmbr "cn=IT Admins,
ou=east, ou=sales, dc=pearson,
dc=pub"

This example removes the global group (IT Admins) from the domain local group (named dl_printer) with the -rmmbr switch.

Figure 1. ADUC showing properties of the IT Admins group with member added
Other -----------------
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Unified Messaging Shell Commands
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Monitoring and Troubleshooting Unified Messaging (part 3) - Event Logs
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Monitoring and Troubleshooting Unified Messaging (part 2) - Performance Monitors
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Monitoring and Troubleshooting Unified Messaging (part 1) - Active Calls , Connectivity
- Working with the Windows Home Server Registry : Keeping the Registry Safe
- Working with the Windows Home Server Registry : Starting the Registry Editor, Navigating the Registry
- SharePoint 2010 : Building Composite Solutions (part 2) - External Data Search, External Data and User Profiles
- SharePoint 2010 : Building Composite Solutions (part 1) - External Lists, External Data Columns
- Microsoft Dynamics AX 2009 : Form Customization (part 3) - Displaying an Image on a Form
- Microsoft Dynamics AX 2009 : Form Customization (part 2) - Displaying an Image
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer