pharaoh fortune slot
ExamNotes.net
Welcome, Guest. Please login or register.
November 18, 2017, 11:30:44 AM

Login with username, password and session length
* Home Help Search Login Register
+  ExamNotes.net
|-+  Microsoft (MCSE, MCSD, MOUS, MCAD)
| |-+  Server 2003
| | |-+  296 Study Thread...
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: 296 Study Thread...  (Read 1522 times)
jeff_j_black
that's what "THEY" said..
Hero Member
*****
Offline Offline

Posts: 2723

2


View Profile
« on: October 30, 2003, 08:44:44 PM »

Well, we certainly have enough folks going for 296, what say we get a focused thread going? Where are you at? What are you working with? (Lab details, etc.)
Logged
jeff_j_black
that's what "THEY" said..
Hero Member
*****
Offline Offline

Posts: 2723

2


View Profile
« Reply #1 on: October 30, 2003, 08:54:54 PM »

I'll throw out the first pitch...

I tossed this out to the MS newsgroups but don't have a response yet:

"The help files indicate that input for the dsadd command can be redirected from a file containing the specified values. What is the syntax for the command line and the
text document?"

I have toyed with this for several days and dug through the MS site over and over reading the same short descriptions and examples, but have not seen specifics on how to redirect from text. These command line ds tools could be extremely handy with this facet revealed.
Logged
hlang
Member
Jr. Member
**
Offline Offline

Posts: 83

0


View Profile
« Reply #2 on: October 31, 2003, 04:51:50 AM »

Hey jeff

I think the command line for dsadd when in terms of redirection is what sends us old unix guys laughing to the floor.

From the syntax in the help file and from my few small experiments it seems that the ONLY thing you can supply in the redirected stdin would be the DN ( for ONE object ); other parameters must be supplied from the command line

user.inp
cn=newuser,cn=users,dc=mydomain,dc=pri

command line:
dcadd user -ln Smith < user.inp
Logged
Tarzanboy
Senior Member
Hero Member
*****
Offline Offline

Posts: 1013

0


View Profile
« Reply #3 on: October 31, 2003, 05:01:23 AM »

Darn it Jeff, just when I didn't need a distraction to work on you dig up one for me. Wink

I am not sure if this is any help, but I noticed that there are 2 flags for Unicode: 1 for input (-uci) and 1 for output (-uco) from/to a pipe or file. Since I don't have a W2k3 box up and running at the moment, I haven't tested it.

Another possibility would be utilizing a little WSH scripting and having it call the data from another file.

Cheers,
TB
Logged
jeff_j_black
that's what "THEY" said..
Hero Member
*****
Offline Offline

Posts: 2723

2


View Profile
« Reply #4 on: October 31, 2003, 10:25:15 AM »

hlang,
That is pretty much what I am coming down to.

TB,
Don't sweat it too hard, but the scripting is a good idea, time to play.

Microsoft Solutions for Management

This part of Technet has a lot of interesting info, look for the 'Hands-On Lab' under 'Account Management'. This is the best documentation on the ds commands I have found thus far.
Logged
Tarzanboy
Senior Member
Hero Member
*****
Offline Offline

Posts: 1013

0


View Profile
« Reply #5 on: November 05, 2003, 02:08:49 PM »

My assessment after playing with the ds* commands were that they are nice for single instances, but for multiple instances, scripting has to be used.

A rather crude scripting example of dsadd:
Code:
dim ws, fso, file1
set ws = CreateObject("Wscript.shell")
set fso = CreateObject("Scripting.FileSystemObject")
set file1 = fso.OpenTextFile("test.txt", 1)

dim a, b, test
Do while File1.AtEndOfStream <> True
 dim list
 list = "dsadd;DN;-desc;-samid;-loc;-memberof;-qlimit"
 strNextLine = File1.ReadLine
 a = Split(strNextLine , ";")
 b = Split(list,";")
 test = b(0) & " " & a(0) & " " & chr(34) & a(1) & chr(34)
 If Lcase(a(0)) = "ou" OR Lcase(a(0)) = "computer" Then
  fit
 ElseIf Lcase(a(0)) = "quota" Then
  test = b(0) & " " & a(0) & " " & "-part " & chr(34) & a(1) & chr(34)
  fit
 ElseIf Lcase(a(0)) = "user" Then
  list = "dsadd;DN;-display;-ln;-fn;-mi;-upn;-pwd;-mustchpwd;-canchpwd;-reversiblepwd;-pwdneverexpires;-disabled;-acctexpires;-memberof;-desc;-hmdir;-hmdrv;-profile;-loscr;-title;-dept;-office;-company;-mgr;-tel;-email;-hometel;-pager;-mobile;-fax;-iptel;-webpg"  
  b = Split(list,";")
  fit
End If
Loop

Function fit
 dim x, go
 For x = 2 to UBound(a)
  If a(x) <> "" Then
   test = test & " " & b(x) & " " & chr(34) & a(x) & chr(34)
   x = x + 1
  Else
   x = x + 1
  End If
 Next
 wscript.echo test
 ws.exec test
 test = ""
End Function


Data source:
Code:
Ou;OU=Test OU,DC=Nothing,DC=here;A Test OU
ou;OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;Yet another test
User;CN=Test Account,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;Test Account;Doe;John;Q;testacct@nothing.here;gh!tsUm;no;no;yes;yes;yes;30;CN=Domain Users,CN=Users,DC=Nothing,DC=here;Test User account;;;;;worker;Production;Denver;Bogus Co;;;gone@home.com;;;;;127.0.0.1
computer;CN=Test System3,OU=Test OU,DC=Nothing,DC=Here;A test system;;Tempe;;
User;CN=Test Account 6,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;Test Account 6;Doe;John;Q;testacct6@nothing.here;gh!tsUm;no;no;yes;yes;yes;30;CN=Domain Users,CN=Users,DC=Nothing,DC=here;Test User account6;;;;;worker;Production;Denver;Bogus Co;CN=Test Account,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;;gone@home.com;;;;;127.0.0.1
ou;OU=Another Test 2,OU=Test OU,DC=Nothing,DC=Here;Yet another test 2
coMputer;CN=Test System2,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;A test system 2;;Tempe;;
User;CN=Test Account 7,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;Test Account 7;Doe2;John;Q;testacct7@nothing.here;gh!tsUm;no;yes;no;yes;no;30;CN=Domain Users,CN=Users,DC=Nothing,DC=here;Test User account 7;;;;;worker;Production;Denver;Bogus Co;CN=Test Account,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;;gone2@home.com;;;;;127.0.0.1
User;CN=Test Account 8,OU=Another Test 2,OU=Test OU,DC=Nothing,DC=Here;Test Account 8;Doe3;John;Q;testacct8@nothing.here;gh!tsUm;yes;yes;no;no;no;30;CN=Domain Users,CN=Users,DC=Nothing,DC=here;Test User account 8;;;;;worker;Production;Denver;Bogus Co;CN=Test Account,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;;gone3@home.com;;;;;127.0.0.1
User;CN=Test Account 9,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;Test Account 9;Doe4;John;Q;testacct9@nothing.here;gh!tsUm;yes;yes;no;no;yes;;CN=Domain Users,CN=Users,DC=Nothing,DC=here;Test User account 9;;;;;worker;Production;Denver;Bogus Co;CN=Test Account,OU=Another Test,OU=Test OU,DC=Nothing,DC=Here;;gone4@home.com;;;;;127.0.0.1


Cheers,
TB
Logged
jeff_j_black
that's what "THEY" said..
Hero Member
*****
Offline Offline

Posts: 2723

2


View Profile
« Reply #6 on: November 06, 2003, 02:09:27 PM »

The best I got off the MS Newsgroups was probably a little simpler to create. Just use a batch file that would use a loop and read the values from a text file.
Logged
Tarzanboy
Senior Member
Hero Member
*****
Offline Offline

Posts: 1013

0


View Profile
« Reply #7 on: November 11, 2003, 02:18:14 PM »

With the rather crude example I gave, you could customize it to include other types or include/remove fields that may or may not be used. As for data input, you could theoretically do a db or spreadsheet export to CSV file with a delimiter other than "," and modify the script or create a text file.

Cheers,
TB
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!