Help ADSI Script

10/11/2003 - 22:33 por Carlos Castillo | Informe spam
I have been trying to make a script that close sessions in a file server
running W2K server, I am using ADSI, the problem is that i can list the
sessions but i can not close sessions. I have tried to use Remove() method
and Delete() method but it does not work.

Please help me, here you have my code.

lf = Chr(13) & Chr(10)
Set s = GetObject("WinNT://Domain/Server/lanmanserver, fileservice")

WScript.Echo "Closing sessions in Server: " & lf
For each session In s.Sessions
nombre = session.Name
WScript.Echo "Sesion: " & nombre & lf
s.Delete "Session", nombre
Next
 

Leer las respuestas

#1 Fernando Rubio [MS]
11/11/2003 - 15:55 | Informe spam
Hi Carlos
This is a spanish newsgroup so you should ask in spanish or ask in a
english newsgroup;-) Anyway i think the following article may help you, take
a look at it.
169398 HOWTO: Manipulate File Shares with ADSI (VB Sample)
http://support.microsoft.com/?id9398
Regards
Fernando
Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no
otorga ningún derecho.

"Carlos Castillo" wrote in message
news:
I have been trying to make a script that close sessions in a file server
running W2K server, I am using ADSI, the problem is that i can list the
sessions but i can not close sessions. I have tried to use Remove() method
and Delete() method but it does not work.

Please help me, here you have my code.

lf = Chr(13) & Chr(10)
Set s = GetObject("WinNT://Domain/Server/lanmanserver, fileservice")

WScript.Echo "Closing sessions in Server: " & lf
For each session In s.Sessions
nombre = session.Name
WScript.Echo "Sesion: " & nombre & lf
s.Delete "Session", nombre
Next



Preguntas similares