I have a short bit of code which I really need to convert into .net. All it does is to find the site code of an SCCM server. Can anyone suggest how I might convert this into VB.Net?
set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
set objSWbemServices= objSWbemLocator.ConnectServer("SMS_SITE_SERVER", "root\sms")
Set ProviderLoc = objSWbemServices.InstancesOf("SMS_ProviderLocation")
For Each Location In ProviderLoc
If Location.ProviderForLocalSite = True Then MsgBox Location.SiteCode