connecting to remote server chosen dynamically
Posted on 2006-04-28
I am trying to coonect to a remote server from a local machine and all is working well.
However when I try to change the server name dynamically (user input) i.e instead of setting a hardcoded servername, I get an error saying you cant use a string for the System.Manageement.ManagementPath
dim dynamichost as string ="\\" & inputservername & "\root" & "\cimv2"
Dim oMs As New System.Management.ManagementScope(dynamichost, oConn)
It would work if I did Dim oMs As New System.Management.ManagementScope("\\Server100\root\cimv2", oConn)
Please advise as to how I can get around to setting my servername dynamically!