# OSD_IsServer

> Detects from the WMI Win32_SystemEnclosure class whether the computer is a server.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/osd-scripting-library/osd-functions-osd/osd-isserver/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

[VB Scripting Library](/capainstaller/vb-scripting-library/) > [OSD Scripting Library](/capainstaller/vb-scripting-library/osd-scripting-library/) > [OSD functions (OSD)](/capainstaller/vb-scripting-library/osd-scripting-library/osd-functions-osd/)

### OSD_IsServer()

Detects the chassis type from the WMI Win32_SystemEnclosure class.

### Arguments

No arguments provided.

### Return Type

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

### Chasis types considered as servers

|   CHASSIS TYPE | DESCRIPTION        |
|---------------:|:-------------------|
|              5 | Pizza Box          |
|              7 | Tower              |
|             23 | Rack Mount Chassis |

### Remarks

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

### Example

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.

**VBScript**

```vb
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

```

### See Also

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/), [OSD_IsLaptop](/capainstaller/vb-scripting-library/osd-scripting-library/osd-functions-osd/osd-islaptop/), [OSD_IsDesktop](/capainstaller/vb-scripting-library/osd-scripting-library/osd-functions-osd/osd-isdesktop/), [Dialog_ShowInformation](/capainstaller/vb-scripting-library/osd-scripting-library/dialog-functions-osd/dialog-showinformation/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
