Close Menu
    Facebook X (Twitter) Instagram
    Sunday, May 18
    X (Twitter) LinkedIn
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»SCCM 2007»VBScript check the SMS agent host service status

    VBScript check the SMS agent host service status

    Eswar KonetiBy Eswar KonetiJuly 10, 1:10 pm1 Min Read SCCM 2007 850 Views
    Share
    Facebook Twitter LinkedIn Reddit

    This script requires one notepad file(Input) with list of machines you need for and output(CSV Format) will be opened once the script runs.

    Set fso=CreateObject("scripting.filesystemobject")
    Set objinputfile=fso.OpenTextFile("eskonr.txt",1,True)
    Set objoutputfile=fso.OpenTextFile("servicestatus.csv",2,True)
    Do While objinputfile.AtEndOfLine <> True
    strcomputer=objinputfile.ReadLine
    Set objWMIService = GetObject("winmgmts:"_
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
        Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service WHERE DisplayName like 'SMS Agent Host'")
        objoutputfile.WriteLine("computer name:" & strcomputer)
        For Each objService in colRunningServices
            If Len(objservice.displayname) >= 40 Then
        objoutputfile.WriteLine(Left(objService.DisplayName,40)&vbTab & objService.State)
        Else
        objoutputfile.WriteLine(objService.DisplayName & Space(40-Len(objService.DisplayName))& vbtab& objService.State)
        'Wscript.Echo objService.DisplayName  & VbTab & objService.State
        End if
        Next
    Loop

    msgbox("Done")

    SCCM check SMS agent host status VB Script to check service status for sms agent host
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    Application Deployment with Hybrid Joined Requirement Rules in Intune

    October 06, 8:59 pm

    Troubleshooting Windows KMS Activation Issues with SCCM scripts feature

    September 09, 11:07 pm

    Migrating Windows Update Workloads from SCCM to Intune: How to Verify Management Tool

    August 23, 9:55 pm

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2024 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.