Skip to content

OSD\_IsServer

VB Scripting Library > OSD Scripting Library > OSD functions (OSD)

Detects the chassis type from the WMI Win32_SystemEnclosure class.

No arguments provided.

Boolean, TRUE if function completed successfully.
If the computer chassis is a Server, gbValue will return TRUE otherwise it will return FALSE.

CHASSIS TYPEDESCRIPTION
5Pizza Box
7Tower
23Rack Mount Chassis

This function is called by OSD_Initialize, and the result is stored in the global variable gbIsServer.

The following script will use the global variables, set by the calls to this function from the OSD_Initialize() function, to display a message to the user that tells the detected chassis type.

Private Function IncludeScript(sScriptFile)
'...
End Function
'Begin
bStatus=True
If bStatus Then bStatus=IncludeScript("customlib.cis")
If bStatus Then bStatus=IncludeLibrary("Capalib.cin")
If bStatus Then bStatus=IncludeLibrary("Osdlib.cin")
If bStatus Then bStatus=Job_Start("WS","Script Name","1.0","ScriptName.log","INSTALL")
If bStatus Then bStatus=OSD_Initialize() 'This function calls this function and sets the global varliables gbIsLaptop, gbIsDesktop, gbIsServer
If gbIsLaptop Then sMsg="This is a Laptop"
If gbIsDesktop Then sMsg="This is a desktop"
If gbIsServer Then sMsg="This is a server"
If bStatus Then bStatus=Dialog_ShowInformation(sMsg)
Job_End(bStatus)
'End main

Scripting Guidelines, OSD_IsLaptop, OSD_IsDesktop, Dialog_ShowInformation