Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I remove a resource using ADSI

Posted on 1999-07-01
2
Medium Priority
?
361 Views
Last Modified: 2012-05-04
I am trying to use the IADsFileServiceOperations to disconnect a resource.  Here is my syntax...

Dim fso As IADsFileServiceOperations, Resource As IADsresource
Set fso = GetObject("WinNT://Domain/Computer/LanmanServer")

For Each Resource In fso.Resources
    fso.Resources.Remove Resource.Name
Next

I'm getting an error that says object doesn't support this action.  Any help would be appreciated.
0
Comment
Question by:HeavnerJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1521341
Take a look at this site. It contains kinds of code about administrating NT

http://www.netfokus.dk/vbadmincode/codevb.html
0
 
LVL 3

Accepted Solution

by:
BGillham earned 1000 total points
ID: 1521342
You are using late binding.
Try setting a reference to ADSI and use early binding.
If you are using VB6 then if do not have SP3 with ADO2.11 installed you will get all sorts of spurious problems.
I had many problems of a similar nature until I installed the service packs.


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question