• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

How do I remove a resource using ADSI

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
HeavnerJ
Asked:
HeavnerJ
1 Solution
 
MirkwoodCommented:
Take a look at this site. It contains kinds of code about administrating NT

http://www.netfokus.dk/vbadmincode/codevb.html
0
 
BGillhamCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now