Unsolved
This post is more than 5 years old
1 Message
0
7745
November 29th, 2010 14:00
Need OMCI 8 Asset Tag Script Help
I'm trying to create a vb script to update asset tag info. The only ones I can find are for OMCI 7 and older. I took a stab at updating one of the posted scripts but can't seem to make it work. From what I can see there is a ChangeAssetTag method under DCIM_Chassis but I can figure out how to make it work. Here's a condensed version of what I've got so far...
Option Explicit
'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim objInstance
Dim strNewValue(2)
Dim strTimeoutPeriod(2)
Dim strAuthorizationToken
Dim returnValue
Dim objWMIService
Dim ColSystem
Dim oInParams
'*** Initialize variables
strNameSpace = "root/dcim/sysman"
strComputerName = "."
strClassName = "DCIM_Chassis"
strNewValue(0) = WScript.Arguments(0)
strTimeoutPeriod(0) = "60"
strAuthorizationToken = ""
returnValue = 0
'*** Retrieve the instance of DCIM_Chassis class
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate," &_
"AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_
strNameSpace)
Set ColSystem=objWMIService.execquery ("Select * from " & strClassName)
For each objInstance in ColSystem
WScript.Echo "ChassisAssetTag: " & objInstance.ElementName
Set oInParams = objInstance.Methods_("ChangeAssetTag").InParameters.SpawnInstance_
oInParams.NewValue = strNewValue
oInParams.AuthorizationToken = strAuthorizationToken
'oInParams.TimeoutPeriod = strTimeoutPeriod
Set returnValue = objInstance.ExecMethod_("ChangeAssetTag", oInParams)
Next
Option Explicit
'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim objInstance
Dim strNewValue(2)
Dim strTimeoutPeriod(2)
Dim strAuthorizationToken
Dim returnValue
Dim objWMIService
Dim ColSystem
Dim oInParams
'*** Initialize variables
strNameSpace = "root/dcim/sysman"
strComputerName = "."
strClassName = "DCIM_Chassis"
strNewValue(0) = WScript.Arguments(0)
strTimeoutPeriod(0) = "60"
strAuthorizationToken = ""
returnValue = 0
'*** Retrieve the instance of DCIM_Chassis class
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate," &_
"AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_
strNameSpace)
Set ColSystem=objWMIService.execquery ("Select * from " & strClassName)
For each objInstance in ColSystem
WScript.Echo "ChassisAssetTag: " & objInstance.ElementName
Set oInParams = objInstance.Methods_("ChangeAssetTag").InParameters.SpawnInstance_
oInParams.NewValue = strNewValue
oInParams.AuthorizationToken = strAuthorizationToken
'oInParams.TimeoutPeriod = strTimeoutPeriod
Set returnValue = objInstance.ExecMethod_("ChangeAssetTag", oInParams)
Next
0 events found
No Events found!


DELL-Warren B
1.1K Posts
0
November 30th, 2010 08:00
http://support.dell.com/support/edocs/software/smcliins/cli80/EN/refgd/index.htm
Thomas_Jackson
1 Message
0
December 1st, 2010 09:00
If anybody know a link or how to use the method in omci 8 to set the asset tag please post a sample.
Thanks!
DELL-Warren B
1.1K Posts
0
December 2nd, 2010 12:00
DELL-Warren B
1.1K Posts
0
December 9th, 2010 18:00
http://www.delltechcenter.com/page/OMCI+Sample+Scripts
sdean2010
9 Posts
0
December 25th, 2010 23:00
AssetTag = objInstance.Properties_.Item("ElementName").Value.
ServiceTag = objInstance.Properties_.Item("Tag").Value.
But I cannot read back the OwnerTag field. I have tried OwnershipTag, Owner, OwnerTag etc without luck.There is obviously some inconsistency in field names for reading and writing. Why is reading back the OwnerTag important? Because in our large, geographically widely dispersed fleet the OwnerTag field can be used to store many variables.
sdean2010
9 Posts
0
December 26th, 2010 12:00
OwnershipTag = objInstance.Properties_.Item("PropertyOwnershipTag").Value. Sorry.