Page 1 of 1 1
Topic Options
#195777 - 2009-09-07 11:25 AM Com Error
dlisterjr Offline
Fresh Scripter

Registered: 2003-05-12
Posts: 19
Loc: East Chicago, IN
I'm having a problem with creating a new local user on a computer. I am doing this from the local machine, but I keep getting the following error:

 Quote:
COM exception error "SetInfo" ((null) - (null)) [-2147352567/80020009]


This is the script I'm using. I converted from an vbscript that works:

 Code:
; ------ SCRIPT CONFIGURATION ------
$strUserName = "naadmin"
$strFullName = "NA Admin"
$strDescr = "North America Administrator"
$strPassword = "Testing1234$" 
$strComputer = "IHE-GLBIMG31"
; ------ END CONFIGURATION ---------
$objSystem = GetObject("WinNT://" + $strComputer)
$objUser = $objSystem.Create("user", $strUserName)
$objUser.FullName = $strFullName
$objUser.Description = $strDescr
$objUser.SetPassword $strPassword
$objUser.SetInfo
? @Serror
Get $

Top
#195778 - 2009-09-07 11:55 AM Re: Com Error [Re: dlisterjr]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Did you also see a
 Quote:

Testing1234$

before the
 Quote:

COM exception error "SetInfo" ((null) - (null)) [-2147352567/80020009]

Maybe try
 Code:
$objUser.SetPassword($strPassword)

Maybe you also have to include the domain:
 Code:
; ------ SCRIPT CONFIGURATION ------
$strUserName = "naadmin"
$strFullName = "NA Admin"
$strDescr = "North America Administrator"
$strPassword = "Testing1234$" 
$strComputer = "IHE-GLBIMG31"
$strDomain = 'MyDomain'
; ------ END CONFIGURATION ---------
$objSystem = GetObject("WinNT://" + $strDomain + '/' + $strComputer)
$objUser = $objSystem.Create("user", $strUserName)
$objUser.FullName = $strFullName
$objUser.Description = $strDescr
$objUser.SetPassword($strPassword)
$objUser.SetInfo
? @Serror
Get $

I just copied some code from this thread:
http://www.kixtart.org/forums/ubbthreads...=true#Post36268

Top
#195781 - 2009-09-07 12:48 PM Re: Com Error [Re: Witto]
dlisterjr Offline
Fresh Scripter

Registered: 2003-05-12
Posts: 19
Loc: East Chicago, IN
Thanks. It was the () around the string.
Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 456 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.243 seconds in which 0.209 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org