Solved

vb.net initiating sccm repair via wmi

Posted on 2014-11-06
3
288 Views
Last Modified: 2014-11-12
Attempting to run a client side sccm repair with below code, it acts like it runs but no repair happens:

        Dim answer As New MsgBoxResult
        answer = MsgBox(("Are you sure you want to reboot workstation: " & targetpc & "?"), MsgBoxStyle.YesNo, "Confirm Action")
        If DialogResult = DialogResult.Yes Then
            Dim smsClient As Object = GetObject("winmgmts://10.555.1.10/root/ccm:SMS_Client")
            smsClient.RepairClient()
        Else
            Exit Sub
        End If

Open in new window

0
Comment
Question by:derek7467
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40428648
What version of WMI are you using?

If I look at the documentation for SMS_Client on TechNet, I don't see the RepairClient method (article from 2009).

SMS_Client Client WMI Class
http://msdn.microsoft.com/en-us/library/cc146352.aspx
0
 

Author Comment

by:derek7467
ID: 40429061
ahh weird, i was trying to convert vbs into vb.net. I took a look at that site and do not see a repair option.  You know of any way to initiate a remote sccm repair?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40429354
No, I don't.  Everything points to the root/ccm:SMS_Client namespace, but I don't see that anywhere.  It has to be related to a particular software application installation.  You should be able to see the namespaces from the Servers node on the Servers Explorer dialog.

1) Expand the local machine

2) Right-click on the Management Classes, and select Add Classes...

3) On the left is a list of available namespaces.
Snapshot.png
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Synchronize a new Active Directory domain with an existing Office 365 tenant
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question