Skip to content

Commit

Permalink
Added ViaMonstraTatoo
Browse files Browse the repository at this point in the history
  • Loading branch information
DeploymentBunny committed Nov 4, 2016
1 parent fee6719 commit 2e993f4
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tools/Custom-ZTITatoo/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a custom version of the ZTITatoo included in MDT. Use this as a template instead of modifying the ZTITatoo file in MDT, since it could be overwritten dusring upgrades.
85 changes: 85 additions & 0 deletions Tools/Custom-ZTITatoo/ViaMonstraTatoo.mof
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

//==================================================================
// Register Registry property provider (shipped with WMI)
// Refer to WMI SDK documentation for use
//==================================================================

#pragma namespace("\\\\.\\root\\cimv2")

// Registry instance provider
instance of __Win32Provider as $InstProv
{
Name ="RegProv" ;
ClsID = "{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}" ;
ImpersonationLevel = 1;
PerUserInitialization = "False";
};

instance of __InstanceProviderRegistration
{
Provider = $InstProv;
SupportsPut = True;
SupportsGet = True;
SupportsDelete = False;
SupportsEnumeration = True;
};


// Registry property provider
instance of __Win32Provider as $PropProv
{
Name ="RegPropProv" ;
ClsID = "{72967901-68EC-11d0-B729-00AA0062CBB7}";
ImpersonationLevel = 1;
PerUserInitialization = "False";
};

instance of __PropertyProviderRegistration
{
Provider = $PropProv;
SupportsPut = True;
SupportsGet = True;
};


//==================================================================
// ViaMonstra Information class and instance definition
//==================================================================

#pragma namespace ("\\\\.\\root\\cimv2")

// Class definition

#pragma deleteclass("ViaMonstra_Info",nofail)
[DYNPROPS]
class ViaMonstra_Info
{
[key]
string InstanceKey;
string ViaClass;
string ViaRole;
string ViaTag;
string ViaOwner;

};


// Instance definition

[DYNPROPS]
instance of ViaMonstra_Info
{
InstanceKey = "@";

[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\ViaMonstra\\OSD|ViaClass"), Dynamic, Provider("RegPropProv")]
ViaClass;

[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\ViaMonstra\\OSD|ViaRole"), Dynamic, Provider("RegPropProv")]
ViaRole;

[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\ViaMonstra\\OSD|ViaTag"), Dynamic, Provider("RegPropProv")]
ViaTag;

[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\ViaMonstra\\OSD|ViaOwner"), Dynamic, Provider("RegPropProv")]
ViaOwner;
};
107 changes: 107 additions & 0 deletions Tools/Custom-ZTITatoo/ViaMonstraTatoo.wsf
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<job id="ViaMonstraTatoo">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">

' // ***************************************************************************
' // File: ViaMonstraTatoo.wsf
' // Version: 1.0
' // Purpose: Tattoo the machine with ViaMonstra info
' // Usage: cscript.exe [//nologo] ViaMonstraTatoo.wsf [/debug:true]
' // ***************************************************************************

Option Explicit
RunNewInstance

'//----------------------------------------------------------------------------
'// Global Constants
'//----------------------------------------------------------------------------

' No constants are required


'//----------------------------------------------------------------------------
'// Main Class
'//----------------------------------------------------------------------------

Class ViaMonstraTatoo

'//----------------------------------------------------------------------------
'// Class instance variable declarations
'//----------------------------------------------------------------------------

' No instance variables are required


'//----------------------------------------------------------------------------
'// Constructor to initialize needed global objects
'//----------------------------------------------------------------------------

Private Sub Class_Initialize

' No initialization is required

End Sub


'//----------------------------------------------------------------------------
'// Main routine
'//----------------------------------------------------------------------------

Function Main

Dim iRetVal
Dim sMOFFile
Dim sCmd
Dim oInfo

iRetVal = Success

'//----------------------------------------------------------------------------
'// Copy and compile the MOF
'//----------------------------------------------------------------------------

iRetVal = oUtility.FindFile("ViaMonstraTatoo.mof", sMOFFile)
If iRetVal <> Success then

oLogging.CreateEntry "Unable to find ViaMonstraTatoo.mof, information will not be available via WMI.", LogTypeInfo

Else

oLogging.CreateEntry "Copying " & sMOFFile & " to " & oEnv("WINDIR") & "\SYSTEM32\WBEM\ViaMonstraTatoo.mof.", LogTypeInfo
If oFSO.FileExists(oEnv("WINDIR") & "\SYSTEM32\WBEM\ViaMonstraTatoo.mof") then
oFSO.GetFile(oEnv("WINDIR") & "\SYSTEM32\WBEM\ViaMonstraTatoo.mof").Attributes = 0
End if
oFSO.CopyFile sMOFFile, oEnv("WINDIR") & "\SYSTEM32\WBEM\ViaMonstraTatoo.mof", true

sCmd = oEnv("WINDIR") & "\SYSTEM32\WBEM\MOFCOMP.EXE -autorecover " & oEnv("WINDIR") & "\SYSTEM32\WBEM\ViaMonstraTatoo.mof"
oLogging.CreateEntry "About to compile MOF: " & sCmd, LogTypeInfo
iRetVal = oShell.Run(sCmd, 0, true)
oLogging.CreateEntry "MOFCOMP return code = " & iRetVal, LogTypeInfo

End if

' Retrieve the new WMI instance

Set oInfo = objWMI.Get("ViaMonstra_Info.InstanceKey=""@""")

'//----------------------------------------------------------------------------
'// Record Customdata
'//----------------------------------------------------------------------------

oInfo.ViaClass = oEnvironment.Item("ViaClass")
oInfo.ViaRole = oEnvironment.Item("ViaRole")
oInfo.ViaTag = oEnvironment.Item("ViaTag")
oInfo.ViaOwner = oEnvironment.Item("ViaOwner")

' Save the changes

oInfo.Put_

Main = iRetVal

End Function

End Class

</script>
</job>

0 comments on commit 2e993f4

Please sign in to comment.