J
Jeremy
I have been doing this for years in XP and Server 2003, but recently I have
been installing Vista x64 Edition for some specific needs. This code is
part of a workstation startup script that pulls the description from AD and
makes it the local description on the computer. This does not work in Vista
x64 or Server 2008 x64 and I have found no explanation on the Internet as of
yet. I have not tested in x86 installs of the same OS. Yes, I am running
it as administrator while testing, if I do not, I receive Access Denied.
sComputer = "."
Set Obj = GetObject("winmgmts:\\" & sComputer &
"\root\cimv2").InstancesOf("Win32_OperatingSystem")
For Each x In Obj
x.Description = "This is the computer description."
x.Put_
Next
The object is being created just fine. I can use other methods on the
object successfully like GetText_ . I have found no documentation that says
Put_ shouldn't work.
Any help would be appreciated. This one is driving me crazy.
When running, I receive the following error:
---------------------------
Windows Script Host
---------------------------
Script: C:\Users\username\Desktop\test.vbs
Line: 6
Char: 4
Error: Value out of range
Code: 8004102B
Source: SWbemObjectEx
been installing Vista x64 Edition for some specific needs. This code is
part of a workstation startup script that pulls the description from AD and
makes it the local description on the computer. This does not work in Vista
x64 or Server 2008 x64 and I have found no explanation on the Internet as of
yet. I have not tested in x86 installs of the same OS. Yes, I am running
it as administrator while testing, if I do not, I receive Access Denied.
sComputer = "."
Set Obj = GetObject("winmgmts:\\" & sComputer &
"\root\cimv2").InstancesOf("Win32_OperatingSystem")
For Each x In Obj
x.Description = "This is the computer description."
x.Put_
Next
The object is being created just fine. I can use other methods on the
object successfully like GetText_ . I have found no documentation that says
Put_ shouldn't work.
Any help would be appreciated. This one is driving me crazy.
When running, I receive the following error:
---------------------------
Windows Script Host
---------------------------
Script: C:\Users\username\Desktop\test.vbs
Line: 6
Char: 4
Error: Value out of range
Code: 8004102B
Source: SWbemObjectEx