vbscript to auto assign site code
Do you have any vbscript that will auto assign an sccm client to a site?
September 5th, 2012 10:11am

Hi, this script will assign the client to a site: http://gallery.technet.microsoft.com/scriptcenter/Change-sccm-configmgr-cf6e0327 Regards, Jrgen-- My System Center blog ccmexec.com -- Twitter @ccmexec
Free Windows Admin Tool Kit Click here and download it now
September 5th, 2012 10:15am

the script is not auto assign..you need to enter the site code in the script
September 5th, 2012 10:31am

Hi, Why do you want to use the vbscript to auto assign the client to the site without enter the site code? Auto-site assignment can occur during client deployment or when you click Discover in the Configuration Manager Properties: Advanced Tab. The Configuration Manager client compares its own IP address with the site boundaries configured in the Configuration Manager 2007 hierarchy. When the client IP address falls within the boundaries of a site, the client is automatically assigned to that site. Configuration Manager 2007 clients that use auto-assignment attempt to find site boundaries published to Active Directory Domain Services. If this method fails (for example, the Active Directory schema is not extended for Configuration Manager 2007, or clients are not within the same forest), clients can find boundary information from a server locator point. The server locator point can be directly assigned to the client during installation, or the client can attempt to locate it using WINS. If the client cannot find a site configured with boundaries that match its own IP address, the client will retry every 10 minutes until it is able to assign to a site. See How Auto-Site Assignment Works Regards, Sabrina
Free Windows Admin Tool Kit Click here and download it now
September 7th, 2012 4:35am

i use this script to run the auto discovery . let me know if it helps Sub SetAssignedSite (newSite) On Error Resume Next Dim oSMSClient Set oSMSClient = CreateObject ("Microsoft.SMS.Client") nSite = oSMSClient.AutoDiscoverSite If Err.Number <>0 Then wscript.echo "Could not create SMS Client Object - quitting" Exit Sub End If ' Set the assigned site. WScript.Echo "Current site: " & oSMSClient.GetAssignedSite oSMSClient.SetAssignedSite nSite,2 Wscript.Echo "Assigned site is now: " & oSMSClient.GetAssignedSite Set oSMSClient=Nothing End Sub SetAssignedSite (newSite)
September 7th, 2012 4:39am

any chance you could add a section in this script to target a remote computer. I work for a large corporation and I am taking over a bunch of Clients and need a good way to do this remotely thanks Philip Hayes
Free Windows Admin Tool Kit Click here and download it now
September 19th, 2012 1:41pm

Hi Philip, You need to save the script as autosdisc.vbs and run it using psexec on a list of machines . Sub SetAssignedSite (newSite) On Error Resume Next Dim oSMSClient Set oSMSClient = CreateObject ("Microsoft.SMS.Client") nSite = oSMSClient.AutoDiscoverSite If Err.Number <>0 Then wscript.echo "Could not create SMS Client Object - quitting" Exit Sub End If ' Set the assigned site. WScript.Echo "Current site: " & oSMSClient.GetAssignedSite oSMSClient.SetAssignedSite nSite,2 Wscript.Echo "Assigned site is now: " & oSMSClient.GetAssignedSite Set oSMSClient=Nothing End Sub SetAssignedSite (newSite) Let me know if it helps
September 30th, 2012 8:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics