+ Post New Thread
Results 1 to 4 of 4
Windows Server 2000/2003 Thread, dsget / dsmod script in Technical; Is it possible to pipe the results of a 'dsquery' of users of a particular security group and then pipe ...
  1. #1

    Join Date
    Oct 2009
    Location
    North Yorkshire
    Posts
    28
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    dsget / dsmod script

    Is it possible to pipe the results of a 'dsquery' of users of a particular security group and then pipe results to 'dsmod addmbr' script?
    If so can somebody show me an example please?

  2. #2
    djwingfield's Avatar
    Join Date
    Mar 2010
    Posts
    33
    Thank Post
    7
    Thanked 10 Times in 10 Posts
    Rep Power
    10
    Hi, i use a dsget Script with a dsmod pipe, to activate exams accounts on and off, like shown below.

    Exam Users - Enable
    Code:
    dsget group "cn=10rggn,ou=Controlled Assesments,ou=Exam Users,ou=Users,ou=School,dc=school name,dc=org,dc=UK" -members | dsmod user -disabled no
    Exam Users - Disable
    Code:
    dsget group "cn=10rggn,ou=Controlled Assesments,ou=Exam Users,ou=Users,ou=School,dc=school name,dc=org,dc=UK" -members | dsmod user -disabled yes
    As you can see dsget looks up the users in the 10rggn group then dsmod change the accounts to enable or disable.

    Dan

  3. Thanks to djwingfield from:

    marty (17th January 2011)

  4. #3

    Join Date
    Oct 2009
    Location
    North Yorkshire
    Posts
    28
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Absolutely super smashing great. Thanks Dan!

  5. #4

    Join Date
    Oct 2009
    Location
    North Yorkshire
    Posts
    28
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    For those interested I ended up using this:
    Code:
    dsget group  "CN=SIMS Y11_DT1,OU=LJS,OU=Establishments,DC=abbeycourt,DC=internal"  -members | dsmod group  "CN=cachepilot,OU=LJS,OU=Establishments,DC=abbeycourt,DC=internal"  -addmbr
    It queries for the members of the SIMS Y11_DT AD security group and adds them to the cachepilot security group.

SHARE:
+ Post New Thread

Similar Threads

  1. Have I done this right? - VB Script
    By Johan in forum Windows
    Replies: 4
    Last Post: 22nd September 2010, 03:30 PM
  2. Script
    By Ryno in forum Web Development
    Replies: 6
    Last Post: 13th April 2010, 09:09 PM
  3. DSMod & DSMove via a web page
    By MPorter in forum Web Development
    Replies: 0
    Last Post: 2nd February 2009, 07:01 PM
  4. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  5. DSGET alternative
    By mattx in forum Scripts
    Replies: 0
    Last Post: 1st May 2007, 10:49 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •