Page 1 of 1 1
Topic Options
#27199 - 2002-08-17 12:06 AM Mapping to PDC
Stealth Offline
Fresh Scripter

Registered: 2001-08-09
Posts: 48
Loc: Scotland
What im trying to achive is mapping a network connection to the PDC as follows

If (InGroup("DIV_TRAIN") <> 0)
Use I: @lserver+"\TRAINING"
Use J: @lserver+"\TRAINDB"
;
$nul=WriteValue($HKCUSMWCVEUSF,"Personal","I:\","REG_SZ")
EndIf

I want to connect the I drive to the BDC which works fine but the J drive I want to connect to the PDC I have tried substituting @lserver with @Domain01 computername = domain name01 with no joy can this be done?

Thanks in advance...

Top
#27200 - 2002-08-17 12:48 AM Re: Mapping to PDC
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, searched the registry and no joy. not even on bdc registry.

anyway, I would change your:
If (InGroup("DIV_TRAIN") <> 0)

to:
If InGroup("DIV_TRAIN")

which is the same but little bit shorter [Big Grin]
_________________________
!

download KiXnet

Top
#27201 - 2002-08-17 12:52 AM Re: Mapping to PDC
Stealth Offline
Fresh Scripter

Registered: 2001-08-09
Posts: 48
Loc: Scotland
Yeah but MCA told me to do it, only kidding MCA did a great job of tiding my script up it looks more complicated which is a good thing less people here will muck around with it
thanks anyway.

Top
#27202 - 2002-08-16 01:31 PM Re: Mapping to PDC
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, mca is mca.
he hasn't participated in our golf tournaments! [Big Grin]

anyway, found the info.
try this:
$wksta = CreateObject("WinNTSystemInfo")
"PDC: " $wksta.PDC

{edit}
forgot to add some info...

requirements: Included in Windows 2000 and later.
referencelink: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/adsi/iadswinntsysteminfo_property_methods.asp

[ 16. August 2002, 13:34: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#27203 - 2002-08-16 01:55 PM Re: Mapping to PDC
Stealth Offline
Fresh Scripter

Registered: 2001-08-09
Posts: 48
Loc: Scotland
Unfortunatley all NT4 Wkstn i don't understand why it doesn't work with the @domain01 or @ldomain01 should it have a @domain+01 perhaps?
Top
#27204 - 2002-08-16 01:59 PM Re: Mapping to PDC
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ah, so your pdc's are named with that syntax.. ok.

then it should be only matter of:
Use J: @domain+"01\TRAINDB"
_________________________
!

download KiXnet

Top
#27205 - 2002-08-16 02:05 PM Re: Mapping to PDC
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
When amapping a drive, the use statement need a specific network address (IP address) and resource name (share). The domain name can not be resolved to a specific address. Therefore, you need to provide the name of the server.

In an NT4 environment, I used to use NLTEST.exe from the resourcce kit to find a PDC in a domain.
code:
c:\data\scripts>nltest /dclist:dss_test
Domain 'dss_test' is not an NT 5 domain. (Using NetServerEnum).
List of DCs in Domain dss_test
\\US194DC41 (PDC)
\\US177SS40
The command completed successfully

You can use Pipe() udf or redirect to a file and parse it to find the server name with the PDC role.

{edit} my comments seem to have been off target.

[ 16. August 2002, 14:37: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#27206 - 2002-08-16 02:36 PM Re: Mapping to PDC
Stealth Offline
Fresh Scripter

Registered: 2001-08-09
Posts: 48
Loc: Scotland
Thanks for the replies I will try and get back
Top
#27207 - 2002-12-03 03:42 AM Re: Mapping to PDC
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Lonkero,

We prefer the IF (InGroup("DIV_TRAIN") <> 0) notation. This format works
for all kixtart releases.

A possible partication in board golf tournaments isn't such a good idea.
We doesn't play computer games. Only a little collection we have for
our cousins.
Only we are interesting in the ideas of it. Ideas which show what is really
possible with a programming language.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#27208 - 2002-12-03 03:46 AM Re: Mapping to PDC
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Stealth,

Normally it isn't any problem to map a PDC share. As administrator you have
mostly the rights to choose (temporary) share name and to implement selected
name in your scripts.

Please can you return a status update.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#27209 - 2002-12-03 03:50 AM Re: Mapping to PDC
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep, I know you prefer.
anyway, I must insist on saying you do multiple checks and I would ask for you to show me kix version that does not support my way.

so, lets examine:
IF (InGroup("DIV_TRAIN") <> 0)

your InGroup("DIV_TRAIN") returns true if true.
adding InGroup("DIV_TRAIN") <> 0 does the same with double checking. it also accepts negative input which is bad.
anyway, then having brackets (InGroup("DIV_TRAIN") <> 0 ) around that code copies the TRUE to TRUE which is third "conversion".

so what should be:
if person is in group

turns in your preferred way to:
if expression of different than zero expression from person is in group

eh?
should we run some speed tests too?

[ 03. December 2002, 03:52: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#27210 - 2002-12-03 04:02 AM Re: Mapping to PDC
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
MCA,
Board golf tournaments are not "computer games" but rather programming challenges.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#27211 - 2002-12-03 04:10 AM Re: Mapping to PDC
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Lonkero,

Search through the forums were you can see how much people specifies something like
IF (InGroup("Div_Train") = 1).

Of course you are right about your format, but we find our solution more clear.
In the current release it is also possible to use the NOT operator, which
gives another way of presenting such logical structure.

Another benefit is: when you are using always the same structure you can easily search
for them when a modification is necessary.
Some BAT/script languages have the capability to use full and short keywords which can be
very interesting, but mostly using those short keywords makes reading and maintaining
scripts hard.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#27212 - 2002-12-03 04:14 AM Re: Mapping to PDC
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mca, yes, you are not wrong either.

but I've made one interesting note:
the persons using that format are mostly just copycats or editor users.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.158 seconds in which 0.115 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org