Jump to content


Darkstarhammer

Established Members
  • Posts

    6
  • Joined

  • Last visited

Darkstarhammer's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Quick update to answer Peter we use IP ranges on the primary of the servers we removed all boudaries. and readded them and now it seems to work and clients are no longer swining over to it. i suspect it was as peter sais misconfigurarion in the bouandaries
  2. Hi Peter Exelent tool, do i need the mac adress every time as i want to put existing machines in that collections aswell? or is there a way i can just have the name and move it
  3. if workstation primary is pr1 with boundary 10.0.10.1 server primary is pri2 with boundary 10.0.20.2 the Machines ip is in the boundarie of the 10.0.10.1 range the machines should find pr1 one? or am i confused
  4. Hi Guys please help me i have 2 primaries one looking after purely servers the other one only workstations both have there own boundaries and non are over lapping if the machines to site discovery they swing to the server one and not there workstation one like they should as the boundaries is in the workstation primary. i have no idea where to start looking? please can you guide me wher i can start looking
  5. Hi guys hope you can help me found this HTA a wile ago and im trying to adapt it to sccm2012 but my hta skills are bit Noob based, can you help me my mission is to have desktop support to be able to add machine to collections thats basicaly defined by myself. Change this to match your setup ("<SMSSERVERNAME> or <SMSSQLServer>","root\SMS\site_<SMS SITE CODE>") Add Computer to Collection.hta <head> <title>Add computers to Collection</title> <body background = "background.jpg"> Add Computer to Collection <BR> <hr> <HTA:APPLICATION ID="Addcompcol" APPLICATIONNAME="Addcomputer" SCROLL="NO" SINGLEINSTANCE="yes" WINDOWSTATE="normal" SYSMENU="no" > </head> <script language="VBScript"> Sub Closeme window.close() end sub Sub Window_Onload window.moveTo 200,200 window.resizeto 500,500 'width x height end sub </script> <body onload=Window_Onload onkeypress="Checkenter"> <script language="VBScript"> On error resume next Set Shell = CreateObject("Wscript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") Set SWbemLocator=CreateObject("WbemScripting.SWbemLocator") set SWbemServices = SWbemLocator.ConnectServer("<SMSSERVERNAME> or <SMSSQLServer>","root\SMS\site_<SMS SITE CODE>") If Err.Number Then Err.Clear Closeme() End If sub search() count=0 if findcomp.value <> "" Then strQuery = "select * from SMS_CM_RES_COLL_SMS00001 where name like '%"& findcomp.value &"%'" Set Computers= SWbemServices.ExecQuery(strQuery) strHTML= strHTML & "<select size=""6"" name=""Computerlisting"" multiple width:200"">" for each Computer in Computers count=count+1 if count<50 then ' strHTML= strHTML & "<BR>" & Computer.Name ' msgbox Computer.ResourceID strHTML= strHTML & "<option value="& Computer.ResourceID &">"& Computer.Name &"</option>" End if Next Output.InnerHTML = strHTML End if end sub '''''''''''''''' Sub Checkenter If window.event.Keycode = 13 Then search() End If End Sub sub searchcollection() count=0 if findcoll.value <> "" Then strQuery = "select * from SMS_Collection where name like '%"& findcoll.value &"%'" Set Collections= SWbemServices.ExecQuery(strQuery) strHTML= strHTML & "<select size=""6"" name=""Collectionlisting"" multiple width:300"">" for each Collection in Collections count=count+1 if count<50 then ' strHTML= strHTML & "<BR>" & Computer.Name ' msgbox Computer.ResourceID strHTML= strHTML & "<option value="& Collection.CollectionID &">"& Collection.Name &"</option>" End if Next strHTML= strHTML & "</select><BR><hr>" strHTML= strHTML & "<input type=""button"" value=""Add to Collection"" onClick=""addcomputers"">" OutputCol.InnerHTML = strHTML End if end sub sub addcomputers() '''''''' For Each Computerselect in Computerlisting.Options if Computerselect.Selected then ComputerResourceID = Computerselect.value ' this is the resource value of the computer selected end if Next '''''''' For Each Collectionselect in Collectionlisting.Options if Collectionselect.Selected then collectionquery = "SMS_Collection.CollectionID='"&Trim(Collectionselect.value)&"'" Set oCollection = SWbemServices.Get(collectionquery) Set newDirectRule = SWbemServices.Get("SMS_CollectionRuleDirect").SpawnInstance_ newDirectRule.ResourceClassName = "SMS_R_System" newDirectRule.ResourceID = ComputerResourceID ' Add the new query rule to a variable. Set oCollectionRule = newDirectRule oCollection.AddMembershipRule oCollectionRule end if Next '''''''''' 'oCollection.RequestRefresh True strHTML="Computer has been added!" Output.InnerHTML = "" OutputCol.InnerHTML = strHTML end Sub '''''''''''''''' Sub Checkentercollection If window.event.Keycode = 13 Then searchcollection() End If End Sub </script> Computer Name Search <input type="value" style="background-color:#ffb7d6" name="findcomp" size="20" > <input type="button" value="OK" name="acceptcomp" onClick="search" style="background:red; "> <BR> <hr> <span id="Output"></span> <BR> <HR> Collection Name Search <input type="value" style="background-color:#ffb7d6" name="findcoll" size="20" > <input type="button" value="OK" name="acceptcoll" onClick="searchcollection" style="background:red; "> <BR> <hr> <span id="OutputCol"></span> <input type="button" value="Close Window" name="Closeout" onClick="Closeme" style="background:white; "> </body>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.