AddComputerToGroup issues

Sep 16, 2010 at 5:10 PM

Hi all

Trying to make a AddComputerToGroup wsf script to use with the WebService from codeplex that I can use in my SCCM OS deployment Task Sequence (using customsettings.ini and calling it during the TS etc etc) and I seem to be getting it not quite right somehow.

Quite new actually customising things like this, rather than just using the bits n bobs that are already there, so what I've done is make a copy of the SetComputerDescription.wsf and edit it entries throughout it appropriately with AddComputerToGroup instead of ZTISetComputerDescription. I've added in <script language="VBScript" src="ZTIDataAccess.vbs"/> also too for good measure.

In the CustomSettings.ini, i have added the following:

[AddComputerToGroup]
WebService=http://webserver/webservice/ad.asmx/AddComputerToGroup
Parameters=GroupName.OSDComputerName
Groupname=theADgroupname
OSDComputerName=ComputerName

I'll have to finish this later however I've just noticed something it might be :)

Anyone with ideas or what they've done, please let me know thanks.

Cheers
Nathan

 

Sep 16, 2010 at 6:03 PM
Edited Sep 16, 2010 at 6:39 PM

Ha Ha, this is crazy, I just had the same problem and thought I post here to get help and the first thing i see is your post!

Sorry for the hijack, but since we have the same problem maybe we can share thread :-)

 

Errormessage when started from TaskSequence:

 The operating system reported error 2147942487: The parameter is incorrect.

This is my script(relevant parts of it atleast):

Function Main

Dim oService
Dim oXML
Dim sGroupname

iRetVal = Failure
 sGroupname = "name-of-group"

' Create the web service instance
Set oService = New WebService
oService.iniFile = "Customsettings.ini"
oService.SectionName = "AddComputerToGroup"
 
oEnvironment.Item("Groupname") = sGroupname

' Make the web service call
Set oXML = oService.Query
If oXML Is Nothing then
oLogging.CreateEntry "Unable to call AddComputerToGroup web service.", LogTypeWarning
Else
oXML.setProperty "SelectionNamespaces", "xmlns:mk='http://maikkoster.com/Deployment'"
If UCase(oXML.SelectSingleNode("mk:boolean").Text) = "TRUE" Then
iRetVal = Success
End If
End If

This is my customsettings.ini in the MDTFiles SCCMPacket:

[Settings]
Priority=Default,Make,Model
Properties=MyCustomProperty,Groupname

[AddComputerToGroup]
WebService=http://se-srv-app506/SCCMWS/AD.asmx/AddComputerToGroup

Parameters=ComputerName, Groupname
OSDComputerName=ComputerName

 

And as always, I am on a tight schedule so any help is really appreciated !

Sep 16, 2010 at 6:23 PM
Edited Sep 16, 2010 at 6:39 PM

This is my CCM logfile for ZTIAddGroup, hmm, why can't customsettings.ini be found? Looks like the problem or what? I start the ZTIAddGroup script in the "State Restore" section of my Task Sequence. Note that I am a beginner so I could have done something fundamental wrong.

<![LOG[Microsoft Deployment Toolkit version: 5.0.1641.0]LOG]!><time="18:42:54.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[The task sequencer log is located at C:\WINDOWS\system32\CCM\Logs\SMSTSLog\SMSTS.LOG.  For task sequence failures, please consult this log.]LOG]!><time="18:42:54.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[FindFile: The file CustomSettings.ini could not be found in any standard locations.]LOG]!><time="18:42:54.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[Unable to find CustomSettings.ini, rc = 1]LOG]!><time="18:42:54.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="3" thread="" file="ZTIAddGroup">
<![LOG[CHECKING the [AddComputerToGroup] section]LOG]!><time="18:42:54.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[No parameters to include in the web service call were specified]LOG]!><time="18:42:54.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[Property Groupname is now = MC-app-Granskning]LOG]!><time="18:42:55.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[Property UserDomain is now = corp]LOG]!><time="18:42:55.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[Property UserID is now = MC-ser-NwAccAct]LOG]!><time="18:42:55.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[<Message containing password has been suppressed>]LOG]!><time="18:42:55.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[About to execute web service call using method POST to : ]LOG]!><time="18:42:55.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="1" thread="" file="ZTIAddGroup">
<![LOG[ZTI ERROR - Unhandled error returned by ZTIAddGroup: wrong parameter.
 (-2147024809  0x80070057)]LOG]!><time="18:42:55.000+000" date="09-16-2010" component="ZTIAddGroup" context="" type="3" thread="" file="ZTIAddGroup">

Sep 17, 2010 at 7:32 AM

Ok, got it working, just added the settingspacket with customsettings.ini to the run commandline tasksequencestep where I start the script.

 

Thank you for providing this great webservice for free!

 

 

Sep 17, 2010 at 12:40 PM

Sorry.... never got a chance to reply.

I'm still stuck with it and deadlines looming for me too :(

Any chance you could post all the bits to the appropriate section of the CustomSettings.ini, and the full .WSF file if possible (as I'm getting weird errors now, although I am trying to use the TS to set the variable GroupName instead of setting it in the .WSF or the customsettings.ini files mainly because i need to set more than one group during the TS process so I'm setting the var and then calling the script, then later on setting the var to something else and then calling the script.

Any thoughts on that would be great. Should just work I would have thought :S

Cheers
Nath

 

Sep 17, 2010 at 5:03 PM

Fixed it and it works :)

Dont have time this minute but I'll happily submit what you would need to do to get it to work fully with a TS in a SCCM+MDT set up :)

Cheers
Nath