Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting volume information
Message
 
À
16/09/2013 09:37:39
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01583334
Message ID:
01583350
Vues:
39
I did not look at your code thoroughly but it is most likely to be a rights issue, you need to have enough rights, in both computers, to do this, which it is not easy to setup, I can't remember the details, but making the story short, the easiest and probably not the best way is to be a Domain Admin, otherwise setting up the rights for doing this was not easy (well, at least it was not easy when I did it like 10 years ago! wow, time flies... but even being an admin in both computers did not work if I remember correctly)

Hugo

>I usually do this to get volume information:
>
>
>            ' Use WMI namespace WMI in which management options will be done
>            If cUsername.Length > 0 Then
>                loManagementScope = New ManagementScope("\\" + lcIP + "\root\cimv2", loConnectionOptions)
>            Else
>                loManagementScope = New ManagementScope("\\" + lcIP + "\root\cimv2")
>            End If
>
>            lcSQL = "SELECT * from Win32_LogicalDisk WHERE DriveType=3 AND VolumeName=""" + lcVolumeName + """"
>
>            ' The ObjectQuery class represents a management query which returns instances or classes 
>            loObjectQuery = New ObjectQuery(lcSQL)
>
>            ' The ManagementObjectSearcher class allows the extration of an object management collection
>            ' in regards to the query specified during the instantiation by the use of the
>            ' ObjectQuery parameter or directly by a string
>            loManagementObjectSearcher = New ManagementObjectSearcher(loManagementScope, loObjectQuery)
>
>            ' The ManagementObjectCollection represents various object management collections extracted from WMI
>            loManagementObjectCollection = loManagementObjectSearcher.Get()
>
>
>But, on a domain resource, this does not work. I have for sure to pass the domain. So, I thought the username used would need to be replaced with Domain\Username. But, this gives a "The RPC server is unavailable." message.
>
>Anyone has succeeded to use this across a domain?
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform