Discussion:
JoinDomainOrWorkgroup
(too old to reply)
Scott Woods
2005-06-15 00:27:02 UTC
Permalink
Raw Message
Hi,

I am on a Windows Xp Pro machine and I am trying to do a WMI
JoinDomainOrWorkgroup call. I am always getting back an error code of 1323.
Does anyone know what this means? Are there any examples of scripts that can
do this. I have attached my example below:

set objLocator = CreateObject("WbemScripting.SWbemLocator")
set objService = objLocator.ConnectServer(".", "root\cimv2")
objService.Security_.ImpersonationLevel = 3
objService.Security_.AuthenticationLevel = 6
objService.Security_.Privileges.AddAsString "SeTcbPrivilege", true
set colItems = objService.ExecQuery("SELECT * FROM Win32_ComputerSystem")

for each objItem in colItems
if RemoveFromDomain then
Result = objItem.UnjoinDomainOrWorkGroup(Password,UserID,0)
MsgBox "Unjoin = " + CStr(Result)
end if
Result =
objItem.JoinDomainOrWorkgroup(NewDomain,Password,UserID,Null,FJoinOptions)
if Result = 0 then
ChangeDomain = true
end if
MsgBox "Join = " + CStr(Result)
next
end function
Torgeir Bakken (MVP)
2005-06-15 00:35:38 UTC
Permalink
Raw Message
Post by Scott Woods
Hi,
I am on a Windows Xp Pro machine and I am trying to do a WMI
JoinDomainOrWorkgroup call. I am always getting back an error code of 1323.
Does anyone know what this means? Are there any examples of scripts that can
(snip)
Hi,

Output from net.exe:

C:\>NET.EXE HELPMSG 1323

Unable to update the password. The value provided as the current
password is incorrect.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Scott Woods
2005-06-15 15:30:04 UTC
Permalink
Raw Message
I know the password is correct. If I copy and paste it from the script code
and do a manual join it works, could there be something else wrong or another
reason for this error?

Thanks
Post by Torgeir Bakken (MVP)
Post by Scott Woods
Hi,
I am on a Windows Xp Pro machine and I am trying to do a WMI
JoinDomainOrWorkgroup call. I am always getting back an error code of 1323.
Does anyone know what this means? Are there any examples of scripts that can
(snip)
Hi,
C:\>NET.EXE HELPMSG 1323
Unable to update the password. The value provided as the current
password is incorrect.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
http://www.microsoft.com/technet/scriptcenter/default.mspx
PB
2006-01-23 23:08:04 UTC
Permalink
Raw Message
I had this problem and in my search for a solution, I came accross this
unanswered question :(

The good news though is that I have found a solution for my case. prefix
the username with the domain...

eg: "mydomain\myaccount"

Hope this helps others with the same issue :)

Loading...