![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | "add domain group to local group" stopped working i have been using a script for years to add a domain group to the local Administrators group but it stopped working when the "powers that be" decided to turn off the WINS server. the basic code is: Set objLocalGrp = GetObject("WinNT://" & strHostName & "/ Administrators,group") Set objDSO = GetObject("WinNT:") Set objGroup = objDSO.OpenDSObject("WinNT://mydomain.com/ MyAdminGroup,group", strUserID, strPassword, 3) objLocalGrp.Add(objGroup.AdsPath) On any network segment that has the WINS set via DHCP this works. On any network segment that has WINS unset, this fails at the "third" line with "The network path was not found". I tried specifying a specific domain controller but am not sure i used the correct syntax, so if you know that please share. Or if you know of a different method of adding a domain group to a local group, i'm all ears. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: "add domain group to local group" stopped working Here is what I use and I do not use WINS. Hope it helps. ' Specify AdsPath of domain group to be added to ' local Administrators group. strDomainGroup = "WinNT://domainname/GroupName,group" ' Bind to domain group. Set objDomainGroup = GetObject(strDomainGroup) ' Retrieve local computer NetBIOS name. Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName ' Bind to local Administrators group. Set objLocalGroup = GetObject("WinNT://" & strComputer _ & "/Administrators,group") ' Check if domain group is already a member. If Not objLocalGroup.IsMember(objDomainGroup.AdsPath) Then ' Add domain group to local group. objLocalGroup.Add(objDomainGroup.AdsPath) End If ' Cleanup Set objDomainGroup = Nothing Set objNetwork = Nothing Set objLocalGroup = Nothing "billy" <wcasse@newsgroup> wrote in message news:6e5451a5-420c-470d-8107-3401146797ce@newsgroup Quote: >i have been using a script for years to add a domain group to the > local Administrators group but it stopped working when the "powers > that be" decided to turn off the WINS server. the basic code is: > > Set objLocalGrp = GetObject("WinNT://" & strHostName & "/ > Administrators,group") > Set objDSO = GetObject("WinNT:") > Set objGroup = objDSO.OpenDSObject("WinNT://mydomain.com/ > MyAdminGroup,group", strUserID, strPassword, 3) > objLocalGrp.Add(objGroup.AdsPath) > > On any network segment that has the WINS set via DHCP this works. On > any network segment that has WINS unset, this fails at the "third" > line with "The network path was not found". > > I tried specifying a specific domain controller but am not sure i used > the correct syntax, so if you know that please share. Or if you know > of a different method of adding a domain group to a local group, i'm > all ears. > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: "add domain group to local group" stopped working On Sep 18, 10:48*am, "jmhj" <j...@newsgroup> wrote: Quote: > Here is what I use and I do not use WINS. *Hope it helps. > > ' Specify AdsPath of domain group to be added to > ' local Administrators group. > strDomainGroup = "WinNT://domainname/GroupName,group" > > ' Bind to domain group. > Set objDomainGroup = GetObject(strDomainGroup) > > ' Retrieve local computer NetBIOS name. > Set objNetwork = CreateObject("Wscript.Network") > strComputer = objNetwork.ComputerName > > ' Bind to local Administrators group. > Set objLocalGroup = GetObject("WinNT://" & strComputer _ > & "/Administrators,group") > > ' Check if domain group is already a member. > If Not objLocalGroup.IsMember(objDomainGroup.AdsPath) Then > ' Add domain group to local group. > objLocalGroup.Add(objDomainGroup.AdsPath) > End If > > ' Cleanup > Set objDomainGroup = Nothing > Set objNetwork = Nothing > Set objLocalGroup = Nothing > > "billy" <wca...@newsgroup> wrote in message > > news:6e5451a5-420c-470d-8107-3401146797ce@newsgroup > Quote: > >i have been using a script for years to add a domain group to the > > local Administrators group but it stopped working when the "powers > > that be" decided to turn off the WINS server. the basic code is: Quote: > > * *Set objLocalGrp = GetObject("WinNT://" & strHostName & "/ > > Administrators,group") > > * *Set objDSO = GetObject("WinNT:") > > * *Set objGroup = objDSO.OpenDSObject("WinNT://mydomain.com/ > > MyAdminGroup,group", strUserID, strPassword, 3) > > * *objLocalGrp.Add(objGroup.AdsPath) Quote: > > On any network segment that has the WINS set via DHCP this works. On > > any network segment that has WINS unset, this fails at the "third" > > line with "The network path was not found". Quote: > > I tried specifying a specific domain controller but am not sure i used > > the correct syntax, so if you know that please share. Or if you know > > of a different method of adding a domain group to a local group, i'm > > all ears. it failed also. So i will not say that the cause of the problem is that WINS went away, but instead is connected to the change that was made when they disabled WINS. I did solve the problem though with good old ... WshShell.Run "NET LOCALGROUP .... |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| add a global group to a domain local group | VB Script | |||
| Difference between a domain group and a local group | VB Script | |||
| How to activate "file group option" under the Local Folders? | Vista mail | |||
| Add domain group to local group question | VB Script | |||
| adding a domain user to the local group | PowerShell | |||