DirectoryEntry and invoke problems - Help!
I am trying to call the backup method within IIS://LocalHost. This works easily via a VBS script but appears to be a real pain in VB.NET (console application). All this does is create a metabase backup on the host. Here is my code:
Code:
Dim MetaCon As New DirectoryEntry("IIS://LocalHost, "username", "password")
Dim oParams As Object() = {"server", "MyBackups", "MD_BACKUP_NEXT_VERSION", "MD_BACKUP_SAVE_FIRST or MD_BACKUP_FORCE_BACKUP"}
Try
MetaCon.Invoke("backup", oParams)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Once it executes I get this error:
Exception has been thrown by the target of an invocation.
Any help would be GREATLY appreciated!