Skip to content

vb script concerns regarding my SCCM clients plz help

Featured Replies

Hi All,

 

I've notice my SCCM clients not responing to my main server. So I started looking and notice the following in our login script. I'm not a expert in scripting but please explain to me what will the following do to my SCCM clients

 

==================

Sub SMSSite()

Dim smsClient, inParam, result

If Site <> "DurbanPlessey" OR Site <> "Killarney" Then "This will only exclude these sites"

Set smsClient = GetObject("winmgmts://127.0.0.1/root/ccm:SMS_Client")

Set inParam = smsClient.Methods_.Item("SetAssignedSite").inParameters.SpawnInstance_()

inParam.sSiteCode = "C00"

Set result = smsClient.ExecMethod_("SetAssignedSite", inParam)

End If

End Sub

==================

 

Advice will really be appreciated.

 

Thank you

Jakes

This script is just setting the site code C00 in your SCCM Client if the computer object is not located in the AD Sites DurbanPlessey or Killarney. Check the clientlocation.log on you clients to see if they can resolve the management point.

  • Author

Set smsClient = GetObject("winmgmts://127.0.0.1/root/ccm:SMS_Client")

 

Thank you Peter33

 

The line in red why would the loopback address be used?

The loopback device is addressing the local machine. You can replace that by a simple dot which will have the same effect "winmgmts://./root/ccm:SMS_Client".

It's just a matter of personal preference.

I'm wondering though why this code snippet is placed in the logon script, since you need admin rights to change the site settings of the client.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.