Displaying 2 results from an estimated 2 matches for "objcomput".
Did you mean:
objcomputer
2005 Jan 13
1
Using WMI Classes to join worksation to domain
...join. The workstations are WinXP.
The code i'm using is
$objWMIService = GetObject("winmgmts:" + "{impersonationLevel=impersonate, authenticationLevel=Pkt}!\\.\root\cimv2")
$colComputers = $objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each $objComputer in $colComputers
$ERRH = $ObjComputer.joindomainorworkgroup(domainname,"password","domainname\root","",1)
Next
if $ERRH <> 0
color r+/n
AT (2,6) "[ERROR: DOMAIN JOIN FAILED - " + $ERRH + "]"
exit
else
color g+/n
AT (2,6) "[INF...
2014 Mar 04
0
Anybody have issues joining machines to a S4 AD domain using VBS
...."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'Join Computer to domain
Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName
Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\"
& _
strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
strComputer & "'")
ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _
strPassword, strDomain & "\&qu...