Page 1 of 1 1
Topic Options
#135794 - 2005-03-16 08:41 PM share a drive
dave219 Offline
Lurker

Registered: 2005-03-16
Posts: 2
I need for the file to search for the d:\production if exist I need to share it, if does not exist than I need to create it and share it.
Im using Win2k active directory
Thanks guys


Edited by dave219 (2005-03-16 09:06 PM)

Top
#135795 - 2005-03-16 09:21 PM Re: share a drive
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
1. What version of KiXtart
2. When is this done, during a logon script or a remote Admin script?
3. Are you checking for this on all your desktops or all your servers?


If this is done during logon on workstations then your users need to have at least POWER USER rights to create the share.

Top
#135796 - 2005-03-16 09:28 PM Re: share a drive
dave219 Offline
Lurker

Registered: 2005-03-16
Posts: 2
it is being done by a remote admin script, and it suppose to check on the desktop that im running the script from. if the drive is there, than share it, if not create it and share it.
Top
#135797 - 2005-03-16 09:49 PM Re: share a drive
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Okay, then unless someone else knows of another way you will probably need to use the Rmtshare utility from Microsoft to create the remote shares.

You can ping the computers on your network to see if there up, then check for the file through the d$ share, then if needed share it out.

Top
#135798 - 2005-03-16 10:28 PM Re: share a drive
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Assuming you have a list of computer names, this might do the trick, but I haven't tested it and there's no error checking...

Code:

$folder = '\d$\production'
$ = open(1,'c:\comps.txt')
$curComp = readline(1)
while @error = 0
if not exist('\\' + $curComp + $folder)
md '\\' + $curComp + $folder
endif
$shares = getobject('WinNT://' + $curComp + '/lanmanserver')
$new = $shares.create('fileshare','Production')
$new.Path = 'd:\production'
$new.SetInfo()
$shares = 0
$curComp = readline(1)
loop

$ = close(1)



How To Manipulate File Shares with ADSI (VB Sample)
_________________________
Eric

Top
Page 1 of 1 1


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

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

Generated in 0.197 seconds in which 0.168 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