Posts

Featured Post

From .vbs to .ps1: Why We Are Still Talking About VBScript in the Cloud Era (And How to Finally Let Go)

It has been a long time since the golden era of SMS 2003 and SQL Server 2005. If you are reading this on DotVBS , you likely landed here for one of two reasons. First, you might be maintaining a legacy environment that simply refuses to die. You have a server rack somewhere running an OS that hasn’t seen a patch in a decade, and a critical login script just failed. You needed that specific WMI query I wrote in 2008 to pull a hardware ID or fix a cache location. Second, you might be a systems engineer in transition. You grew up on On Error Resume Next and CreateObject("WScript.Shell") , but the world has moved on to cloud instances, CI/CD pipelines, and PowerShell. This post is for both of you. It’s ironic that a site dedicated to "Windows Systems Management" via VBScript is seeing a resurgence in traffic not because the technology is new, but because it is now "rare earth" knowledge. We are entering the long-tail end of VBScript's lifecycle. M...

The End of an Era: VBScript, WMIC, and the "Feature on Demand" Future of Windows Server 2025

For nearly two decades, the safety net of any Windows Administrator was the assumption that "it's just built-in." No matter how locked down a server was, you could always count on Notepad, Calculator, and the Windows Scripting Host (CScript/WScript) being there. With the release of Windows Server 2025 last year, that assumption is officially dead. Now that many organizations are moving past the "wait and see" phase and starting their upgrades, we are seeing the real-world impact of Microsoft's list of removed and deprecated features . If you are still relying on legacy scripts (and if you read this site, you probably are), here is what is breaking in production environments right now. 1. VBScript is now a "Feature on Demand" (FOD) This is the big one. In Windows Server 2025, VBScript has been moved to a Feature on Demand status. "VBScript is available as an FOD... before its removal from the operating system in a later release...

Reading the SCCM Client GUID

Recently I encountered an issue with the SCCM client GUID missing from the  %windir%\SMSCFG.INI file. We wanted to write a script to put the GUID back, so I was asked how to read the SCCM Client GUID from a script or command line. VBScript: Set objWMIService = GetObject("winmgmts:\\.\root\ccm") Set colItems = objWMIService.ExecQuery("Select ClientID From CCM_Client") For Each objItem in colItems Wscript.Echo "Client ID" & objItem.ClientID Next WMIC via commandline: wmic /namespace:\\root\ccm path ccm_client get clientid PowerShell: Get-WMIObject -namespace root\ccm ccm_client clientid | Select-Object clientid Suggested Reading: MSDN Article on How to Get the Unique Identifier Value for a Client (Includes Code Snippets) MSDN Article on Using the Get-WMiObject Cmdlet About the Author Emmanuel Tsouris is a Systems Management veteran and Dev...

How to Troubleshoot SMS Client Install Errors

Often time, I'm asked how to troubleshoot SMS client installation errors. First thing I would recommend is to check WMI by running wmidiag.vbs on the troubled computer, be sure to run it under admin context. The beauty of wmidiag is, it tells you how to fix the problem. Secondly, if WMI is fine, look through the installation or client logs. About the Author Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin." Ready to move from VBScript to the Cloud? Check out his book, Pro PowerShell for Amazon Web Services . Visit EmmanuelTsouris.com for his latest projects. As an Amazon Associate, I earn from qualifying purchases at no...

SMS SQL for Last Hardware Inventory

The following SQL Query will return last HW Inventory date for a specific computer. Code is based on the client health queries by Paul Thomsen . -- Last hardware inventory select Name0, LastHWScan as 'HW Inventory' from v_R_System sys full join v_RA_System_SMSAssignedSites ass ON ass.resourceID=SYS.resourceID full join v_GS_WORKSTATION_STATUS WS ON WS.resourceID=sys.resourceID where client0=1 and Name0 = 'computername' About the Author Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin." Ready to move from VBScript to the Cloud? Check out his book, Pro PowerShell for Amazon Web Services . Visit EmmanuelTsouris.com for his la...

SMS SQL for Last Discovery

The following SQL Query will return last discovery date for a specific computer. Code is based on the client health queries by Paul Thomsen . -- Last discovery date select Name0, AgentTime as 'Discovery' from v_R_System sys full join v_RA_System_SMSAssignedSites ass ON ass.resourceID=SYS.resourceID full join (select ResourceId, MAX(AgentTime) as AgentTime from v_AgentDiscoveries where agentname 'SMS Discovery Data Manager' AND agentname not like '%!_AD!_System%' ESCAPE'!' group by ResourceId) disc on disc.resourceid=sys.resourceid where client0=1 --and IsNULL(AgentTime,@NullVal)>@olddate and Name0 = 'computername' About the Author Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin." ...

VBScript to Set SMS Client Cache Location

Need to set the SMS Client Cache Location? Well it's pretty easy, here's a basic VBScript to help you get started. This will set the Advanced Clients Cache Location, just be careful to set it correctly. Test, Test, Test! I'd suggest an SMS Package with different cache locations passed via command line (in seperate programs) for maximum flexibility. ---- Begin VBScript ---- On Error Resume Next Dim oUIResourceMgr Dim oCache Set oUIResourceMgr = CreateObject("UIResource.UIResourceMgr") Set oCacheInfo = oUIResourceMgr.GetCacheInfo ' Set the new location, default is "C:\WINDOWS\system32\CCM\Cache" oCacheInfo.Location = "C:\WINDOWS\system32\CCM\Cache" 'Return the error so SMS can report it WScript.Quit(Err) ---- End VBScript ---- About the Author Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS...