Microsoft
Software
Hardware
Network
Question : VBSCript
Hi,
Please can someone explain what the following trying perform. I know it trying to change the computer name but it doesn't seem to work. Thanks.
Set WshNetwork = WScript.CreateObject("WScr
ipt.Networ
k")
strComputer = WshNetwork.ComputerName
compnm = strComputer
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfig
uration where IPEnabled=TRUE")
Set hostname = objWMIService.ExecQuery _
("Select DNSHostName from Win32_NetworkAdapterConfig
uration where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress)
Then
For i=LBound(IPConfig.IPAddres
s) to UBound(IPConfig.IPAddress)
arrIp = split(IPConfig.IPAddress(i
), ".")
Next
End If
Next
NamePref = "LDNWS"
strNewCompNm = ucase(NamePref + arrip(2)&"-"&arrip(3))
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
sonate}!\\
" & strComputer & "\root\cimv2")
Dim Compnm
Set colItems = objWMIService.ExecQuery("S
elect * from Win32_OperatingSystem",,48
)
For Each objItem in colItems
OSversion = objItem.Version
If OSversion <> "5.1.2600" then
strFilePath = "\\ldn.nbad.com\root\w2kCo
mputers.lo
g"
Set objFSO = CreateObject("Scripting.Fi
leSystemOb
ject")
On Error Resume Next
Set objFile = objFSO.OpenTextFile(strFil
ePath, 8, True, 0)
If Err.Number <> 0 Then
On Error GoTo 0
Set objFSO = Nothing
Wscript.Quit
End If
strLog = now & " ,Computer Name , " & compnm
objFile.WriteLine strlog
wscript.quit
Answer : VBSCript
At some point, was the VM migrated from one datastore to another? The VM has 0 bytes of data on one datastore. Does it have an ISO mounted on that datastore? (This would also cause it to list that datastore in use.)
Random Solutions
Access beta and deployment
How to bypass UAC Pause during remote sessions (Windows 7)
WordPress FIle Manager w/ Database Integration
Not receiving mail from some internal senders
Asp.net: My DataPager crashes the application on next page, I get a Connection Error from the browser.
Unable to logon to new TSM 6.1 Server "TSM Server1" instance Windows Server starting then stopping!
OneNote 2010 default search using last scope
Get current active application name
Windows Live Messenger XXXX is now friends with YYY
System.InvalidCastExceptio
n was unhandled by user code Error code on LINQ