This Blog consists of all computer error, difficulties, repair, security and troubleshooting encounters.
DSMOD foundation course 101
DSMOD foundation course 101
This is intended to show the principles for changing many AD objects' properties in one go. There are lots more clever things you could do with this - like a lot of command line stuff, the principles are very simple but can be strung together to very powerful end results with a bit of thought and a step-by-step logical approach.
Basically, DSMOD allows you to change many (not all) of the AD properties of an object, usually a user, computer or group. This tutorial discusses users specifically, but the principles extend to other objects.
It uses the full canononical name for the object ie "CN=Eliza Doolittle, OU=etc." but you don't need to worry about that. The way to use it in practice is by using dsquery to do a "search" (even if this is for only one object) and pipe the returned results to dsmod, where you change one or more properties of that object.
First try something with dsquery:
Code:
dsquery user -name Chris* "OU=Building 1, dc=internal,dc=mycompany,dc=co,dc=uk"
This should give you several results for everyone whose common name matches Chris* (* as wildcard as usual, note that this also matches zero characters so *Chris* would also return these same results even though there is nothing in front of the "Chris", but would also find "John Christopher" if he existed)
We can now find users who match certain criteria. Then we can pass the results straight into dsmod to modify the properties.
a simple example:
Code:
dsquery user -samid JHC "OU=Building 2, dc=internal,dc=mycompany,dc=co,dc=uk" | dsmod user -tel "555 - 112 233" -u AdminUser -p AdminPassword
No comments:
Post a Comment