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

Preguntas similare

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



Respuesta Responder a este mensaje
#2 Carlos Castillo
11/11/2003 - 23:19 | Informe spam
Bueno Gracias Fernando, pero el metodo delete() que se usa en fileshare no
funciona en sessions ni resources. ya que lo que pretendo hacer con el
script es eliminar sesiones activas o cerrar archivos abiertos, estas
sesiones y archivos son los que aparecen en la salida que presenta el net
file y set session respectivamente desde la linea de comando.

Te agradeceria cualquier otro comentario

Saludos

"Fernando Rubio [MS]" wrote in message
news:
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
>
>
>


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida